Hello. adding <style type="text/css"> CANVAS{image-rendering😛ixelated;}</style> to my index.html file renders my game with beautiful crisp sprite graphics which looks great on my character sprites. However, every non-sprite that appears on screen looks very low quality and uglier in comparison. I have tried to recreate the exact pixelation effect from image-rendering😛ixelated; to apply to my character bitmaps but have not been able to get anywhere close to the same level of quality. I am pretty new to CSS, is there a way to tell the canvas to render only my characters with the nearest-neighbor interpolation that happens when image-rendering is set to pixelated? Picture included for reference
Rendering canvas elements with different effects?
RPG Maker MV SupportI know this isn't exactly the answer you were looking for, but have you tried looking into plugins which are made for pixel perfect display purposes?
Here's one i found which works with MV:
galenmereth.itch.io
Here's one i found which works with MV:
Pixel Perfect for RPG Maker MV/MZ by Galenmereth
A free pay-if-you-want plugin for RPG Maker MV and MZ that enables pixel-perfect scaling mode
galenmereth.itch.io
I think all that plugin does is swap to the same pixelated rendering style that OP is using.
Correct. It seems like rmmv doesn't want me to have direct access to the rendering context of the sprites which is quite an annoyance. Unless there's a workaround I'm aware of I'm probably just stuck for now.
I think you need to tell PIXI what mode to use, since PIXI is responsible for graphics batching etc.
In case it helps:
In case it helps:
From a quick look at the code of Galenmereth's plugin, I believe it handles this correctly for MZ (in which all bitmaps are smooth by default) but not MV, due to core script differences.
Using nearest-pixel scaling just isn't the same, not even close from my extensive testing. Unless I am just not actually applying the effect to my characters (which, I doubt) using nearest-pixel scaling is identical to just using the default scaling algorithm. Maybe if I can find exactly where the engine is handling the rendering of all sprites I could tell it to use a different rendering style, but I truly think this might be impossible
yeah I just don't understand it. ImageManager.loadCharacter does disable smoothing during character rendering and ImageManager.loadBitmap too. But it still just, isn't the same thing. I just don't understand why <style type="text/css"> CANVAS{image-rendering😛ixelated;}</style> uses a much MUCH better scaling algorithm.
Just as a tip, you should use the CODE tags (the </> in your edit bar) when you're typing in code.
It preserves indentation, brackets, and see how the middle of your code keeps getting turned into an emoji? 😛
It preserves indentation, brackets, and see how the middle of your code keeps getting turned into an emoji? 😛
Original thread: https://forums.rpgmakerweb.com/threads/rendering-canvas-elements-with-different-effects.164659/