Hi all,
I’m trying to implement this technique :
Projective Texture Mapping
Yes, there is already the projector, but “we cannot have a whole control” on this component (its shader script), and in addition, there are lots of problem if we switch the texture.
Hence, I would like to write absolutely the shader in cg. I’ve found this tutorial (link above) but I cannot find out how to access to this matrix into Unity and how can we fill it : “TexGenMatrix”.
My goal is to get animated pictures onto the scene’s object.
Thanks in advance !
Other informations, I’ve found this topic :
Nvidia forum - Projective texture mapping
To initialize the texture matrix :
…
glGetFloatv(GL_PROJECTION_MATRIX,tmp);
…
cgGLSetStateMatrixParameter(cgEffect->kVariables[“TextureMatrix”],CG_GL_TEXTURE_MATRIX,CG_GL_MATRIX_IDENTITY);
Hence, how access to this matrix in my C# script ? What is the correct syntax ?
(I know how to send the matrix to my shader) …
Thanks !
Ps : Sorry for the big mistakes … my english is poor 
Hi, Did you find a solution? I would also like to use functions such as cgGLSetStateMatrixParameter in my Unity shader. How canone access these? Thanks in advance.
Yes I have succeed to develop it.
At the moment, I’m trying to get two projectors on one mesh.
When I’ll end with this, I’ll share it on the unifycommunity.com because the projector in Unity doesn’t work very well…
Hi @kev42100 , I know this is an old thread but could you by any chance share your code for the custom projector in Unity?