|
I have a shader that combines two textures based upon a projection matrix. This shader works fine in the editor but the uvs don't seem to map properly while the game is running. The texture is vertically compressed and tears at the bottom of the screen. I rewrote the below shader as a cg shader and the effect was the same, vertically compressed and torn. So what would cause a shader to behave differently in editor as opposed to in play mode in engine.
(comments are locked)
|
|
It would look like your _ProjMatrix might be the only possible culprist. How do you process it? How do you set it? The _ProjMatrix is set by a script that calculates it based upon the camera angle. It seems to calculate it properly because it displays properly in the the editor (it would be impossible for it to display like that without the _ProjMatrix).
Apr 28 '11 at 04:35 PM
Fraser
(comments are locked)
|
|
The issue was caused by the matrix not properly transforming at non-zero values. I still don't know why it behaved differently in editor than in game (as the object is static and never moves).
(comments are locked)
|

Where are you setting _ProjMatrix? Also, you don't ever need to use { combine texture }, if you care.