PixelEffects have flipped screen_coords.y (bugfix of a bugfix???)

Issue #435 resolved
created an issue

the following shader code: {{{


extern vec2 ul, lr; vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ) { vec2 coords = (screen_coords.xy - ul.xy) / (lr.xy - ul.xy);

return vec4(coords.x, coords.y, 0.0, 1.0);

} }}}

when given the position of the upper left and lower right corners of a drawn rectangle, should effectively duplicate the behavior of texture_coords, but without requiring a texture. however, the y-coordinate of screen_coords is flipped, preventing this from working unless the programmer manually corrects it.

probably related in ways to #324

this is especially noticeable when, say, you want a shader effect to be relative to some shape's position

Comments (6)

  1. Log in to comment