Hi all :)
I just started looking into making some GLSL shaders, and I have a few questions about the coordinate system.
1: What are the units for the vTex coordinate values? (e.g. pixels, sprite lengths, etc)
2: What is the origin for the vTex coordinates? (e.g. corner of layout, corner of sprite, etc)
3: Does the background need some kind of special coordinate conversion to ensure that it is sampled correctly? I ask because the "dodge" effect has the following line:
[quote:sdoz8br7]lowp vec4 back = texture2D( samplerBack , mix( destStart , destEnd , vTex ) );
It looks like "mix()" might be a lerp style function. It makes me wonder if vTex values run from 0 to 1 across a sprite, and so they are being used to lerp between the screen cords of the relevant patch of background, or something.
4: What are the "destStart" and "destEnd" variables, and what are their units and origin?
Just curious, thanks. :)