In order to make certain texture manipulations work using rectangle textures (sampler2DRect) the shader needs to know the absolute pixel dimensions of the image.  The only way to do this is to pass the shader those values from an outside source.  The two methods I have figured out are as follows: 
<br><br>1) Create a reserved uniform variable like &#39;TextureUnit1Dimensions&#39; and pass the dimensions from the GemState to any shader with that uniform in the shader.&nbsp; <br><br>2) Use pix_info to read the dimensions and pass them to the shader using a message to glsl_program.&nbsp; The shader just needs a uniform vec2 that matches the message.
<br><br>The first one is more automagic but it requires knowing the exact magic variable name(s) to make working shaders.&nbsp; The second follows the Pd paradigm better and allows for the shader to use any name for the uniform.
<br><br>I&#39;m leaning to the second option as the most flexible and sensible even though it probably presents a higher margin of user error and makes for additional patch clutter.&nbsp; It also requires no change to the existing code!
<br><br>Thoughts?<br><br>cgc<br><br>PS- This came up while working with Anton to get the vade shader set fully functional in GEM.&nbsp; These changes will make that happen.<br>