+2
Under review

Inputs for interpolants from vertex -> pixel shader stages on root node

Jason Booth 10 years ago updated by Freya Holmér (Developer) 10 years ago 1
I would love to have inputs on the root node for the various interpolants passed to the pixel shader. For instance, UV coordinates or Vertex Colors. This would allow you to compute information in the vertex shader stage and have it automatically interpolated by the hardware in the pixel shading stage, rather than computing those values for every pixel. As an example, scrolling the UV coordinates in the vertex shader instead of in the pixel shader. 

This has a number of benefits, most of which are optimizations:

If your working on a mobile project, doing UV scrolling or rotation in the vertex shader is going to be significantly faster than doing it per pixel.

You could compute information in the vertex shader, store it in the vertex data, and have those values interpolated for you at the pixel level without having to compute that data for every pixel. 


It would be a nice thing to have, but it's also a very tricky thing to implement. I might have to look into it at some point, but right now, other things have priority.