![]() |
CRT and set FPS bugs - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: CRT and set FPS bugs (/showthread.php?tid=2305) |
CRT and set FPS bugs - System64 - 03-28-2024 Hi! I found 2 bugs in Tilengine. The first one is about the CRT filter. When I set a bitmap as background and a tilemap as layer, I have a strange glitch with the CRT enabled (nothing special if disabled) : ![]() Here is the code : Code: #include "Tilengine.h" The second is when I change the FPS, seems the animations of the flowers are always at the same speed. Is that normal? Shouldn't it be slower (or faster if above screen refresh rate)? Thanks for your answer! RE: CRT and set FPS bugs - megamarc - 04-02-2024 Hi! I've just returned from holidays and seen your post. Let me check it and answer soon. The CRT issue happens when the front layer is scrolling, or just standing still? I may need the "elis.bmp" image you're using as background, maybe this is something related to palette/color depth/transparent pixels that cannot reproduce with any random image I use for testing. Regards, RE: CRT and set FPS bugs - System64 - 04-02-2024 (04-02-2024, 04:20 AM)megamarc Wrote: Hi! Hi, here is the ZIP of my project. Thanks for your help! RE: CRT and set FPS bugs - megamarc - 04-04-2024 Hi, I've found the explanation for both issues: CRT filter The problem here is that the background bitmap is smaller than the framebuffer. When thete's no background bitmap, each frame is cleared with the default background color. A background bitmap is supposed to cover the entire framebuffer, so the background color clear is disabled. The CRT effect applies a slight blurring, and because the rightmost part of the framebuffer isn't being cleared between frames, a feedback effect appears. If you make the layer scroll, you'll see how the right part outside the background bitmap gets smeared even if you don't enable the CRT effect. Just make sure that your background bitmap is at least as big as the framebuffer. FPS throttling The animation data inside the tmx file is expressed as delay between frames, in milliseconds. No matter how you play with fps, the delay between frames is respected, that's why you see the flowers always running at the same speed. I've tweaked a bit your example.
Hope to have answered your questions! Code: #include "Tilengine.h" |