Godot Version
4.5-stable
Question
Hello! I’ve been trying to include a lighting system in my game, where the environment around the player is light, while the surroundings are dark. I attached a point light 2D node to the player and gave it a white pixel circle texture:
However, inside the game (and inside the editor) the light texture is blurry and jitters on player movement:
All of the other sprites are crisp and not blurry, it’s just the light. Is there any way to make the light crisp and be just a pixel circle? Would be grateful for any help!
Set texture filtering to “nearest” in light’s properties in the inspector.
Hello! Thank you for the reply. I did set it to nearest (under CanvasItem → Texture → Filter), but that didn’t solve the problem, it’s still blurry.
Hmm, seems that texture filtering for light textures other than default linear is still not implemented.
opened 01:54PM - 21 Oct 23 UTC
topic:rendering
topic:2d
### Describe the project you are working on
A 2D isometric pixel art game whi… ch uses Godots 2D light and shadows features.
### Describe the problem or limitation you are having in your project
Currently lighting and shadows use interpolation and blending to avoid a pixelated effect. This works well but means that in pixelart games the shadows will appear to be in a higher resolution to the art of the game.
It is currently possible to use viewport as a stretch mode and upscale a low resolution rendering of shadows / light. This would achieve a similar effect for shadows but using this stretch mode comes with other limitations which may not be desirable. These include the inability to achieve smooth diagonal movement.
### Describe the feature / enhancement and how it helps to overcome the problem or limitation
A project wide setting could be added. Once activated, shadows and light could be rendered using nearest neighbour and not use any interpolation or blending.
This would give the desired pixelated effect.
### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A project setting under General / Rendering / Lights and Shadow could be used to ensure that light and shadow are rendered using nearest neighbour scaling and do not interpolate / blend.
The setting could be an additional option on the preexisting quality flags for directional or positional shadows or a new flag in this section.
### If this enhancement will not be used often, can it be worked around with a few lines of script?
Any 2D pixel art game using an isometric perspective will require diagonal movement and this is extremely unsatisfying when stretch mode is set to viewport.
I dont believe there is any way to achieve this using the core engine features while using a stretch mode which allows for smooth diagonal movement in a 2D game.
### Is there a reason why this should be core and not an add-on in the asset library?
The engine is likely already doing what is desired. The addition of this option would be to stop the engine doing something undesirable in certain use cases.
You can try using a regular sprite in additive mode instead of the light node.
2 Likes
Thank you! I ended up using a sprite with a multiply mode to make the surroundings around the player darker.
since it’s pixel art,in low res the blurry-ness will just go away(I think so)