Hi there,
I’m developing a shader that has the following requirements:
- A vector of at least length 3 must be passed in from the Unity engine
- That value must be passed into and interpolated by the fragment shader
Currently, I’m accomplishing #1 by attaching the data I’d like to pass in as a vertex color. I would do it as a texture coordinate, but they’re only float2 within Unity. They seem to be float4 inside the shader though, which is confusing.
When I pass the data through the color, the problem is that it seems to get clamped. I’m not sure if it happens at the vertex or fragment shade. Either way, I’d like to turn it off, because it’s ruining the shader. I kind of have a bunch of related questions here:
- Which values are interpolated inside the fragment shader and which ones are not?
- Are all values interpolated that are passed to the fragment shader?
- Why is the texture coordinate for the mesh (uv, uv1, uv2) a float2, but seems to be a float4 inside the shader?
- Is there a way to stop clamping from happening on the color values passed to a fragment shader?
Thanks!