I know, that project development is stopped, but I need fix a legacy code: draw Vignette effect programmatically on the sprite. I started from adaptation this shader: https://github.com/mattdesl/lwjgl-basics/wiki/ShaderLesson3 without sepia and other effects, but still not know, how to pass "resolution" vector analog. Currently, I'm passing sprite's width & height, but result light spot is not on center. Maybe, there are some another way to get normalized texture coordinates?
Shader is copied from PositionColorTextureCoordinatesShaderProgram
Fragment shader is defined as follows:
I know, that project development is stopped, but I need fix a legacy code: draw Vignette effect programmatically on the sprite. I started from adaptation this shader: https://github.com/mattdesl/lwjgl-basics/wiki/ShaderLesson3 without sepia and other effects, but still not know, how to pass "resolution" vector analog. Currently, I'm passing sprite's width & height, but result light spot is not on center. Maybe, there are some another way to get normalized texture coordinates? Shader is copied from PositionColorTextureCoordinatesShaderProgram Fragment shader is defined as follows:
where UNIFORM_RESOLUTION is 2d array with sprite width & height bound. Maybe, I have to pass another values here?