- The second opengl texture coordinate (gl_TexCoord) are now filled
in as well, and will give canvas coordinates from 0.0 to 1.0. The
first texture coordinates still give the coordinates in the texture
that is being used, which may not match the canvas exactly, so both
coordinates are needed.
Now 3d views in the right side of the screen use a smaller gl_Texture buffer and should performance better. You can also check for the canvas coordinate to process your shader only inside the canvas (the gl_Texture buffer is bigger than the current 3dview).
I’m attaching a file here to demonstrate this use - example file
Press 1 to see the shader using texcoord, texcoord and getting color information from the canvas coordinates
Press 2 to see the same shader using the uniform calculated from python instead
I hope you can make a good use of it,
and a thank you for Brecht for the help in this matter and for the debug info in shader compilation errors (maybe a menu option to enable/disable it could help as well).
I forgot to say a small detail. It’s currently only available in SVN (post Blender.248a). You can use one recent build from Graphicall
EDIT2:: this example is outdated. To make it work replace texcoord per texcoord. and read this
2Dfilter_texCoord.blend (33.6 KB)