How to pass a float3 to a customized uv?
I need to convert a vector form world space to tangent space in an unlit material. I realized I can save a few instructions by performing the conversion in the vertex shader and pass the result using customized UVs, but seems the TexCoord nodes only outputs float2 values so I cannot pass float3 vectors from the vertex shader to the fragment shader. Is there any way to use float3 (or even float4) texture coordinates?
asked Aug 15 '14 at 01:26 PM in Rendering
Everything you want can be done, but not within the material editor. There is no vertex to fragment struct access in the material editor. Everything happens in the fragment shader, except for whatever you do in the world position offset. So you would have to dive into the shader code. Here is a good starting point:
answered Aug 28 '14 at 09:01 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here