I’m trying to create an effect much like the one in Subway Surfers.
That means bending geometry in the vertex shader to give the appearance of a curved world.
It’s working great, but I would really like to be able to use an array of some sort as a lookup-table inside the vert shader.
It would be used to sample displacement values depending on the players position.
At first I thought I could use a Texture2D as a placeholder, but by reading up on it, it doesn’t appear to be available in the vert shader, atleast not on android (Tex2DLod)?
Is there some other way to do it?
If not, is there a great performance drop if I would use multiple vectors as properties in the shader to be used for cubic interpolation, and update them every frame from a script?
Okay, I guess I’ll use a number of sample vectors in front of the camera instead and update them from a script.
On a side-note, do you if there’s supposed to be a difference in lighting if you use SetReplacementShader on a camera?
I’ve tried in numerous ways to use it when I hit play so that the scene-view will use a cut-down version of my shader while the main camera will have it replaced with the real one.
What I’ve noticed is that per vertex lighting seems to stop working after the replacement, and also that lightmaps from beast aren’t displayed properly. If I don’t use SetReplacementShader everything works.
If it’s not possible to have everything working with a replaced shader, is there som other way of disabling parts of a shader in the scene-view (I don’t want to see displaced geometry while editing the scene).