I’m trying to colour an array of boxes via a volume texture, so as I see it I need to use the xyz positions of the objects as the TexCd coordinates.
As my array is a uniform array, I thought maybe I could use the index of the object to work out its sample position in the pixel shader, or I could normalise the positions to generate them.
Alternatively in the shader semantics pdf from node there are
• OBJUNITTRANS , float4x4 : transform to move the model back into a unit box (-0.5 to 0.5)
• OBJSDFTRANS , float4x4 : transform to move the model into a standard sdf space
transform (0 to 1)
But neither of these seems to work in the shader.
If I can do this in sm4 that would be nice, but its not obligatory!
Can anyone suggest a way of doing this?
I’ve attached a quick patch of what I’m doing, but theres not really anything there ATM, appart from an array of boxes and a volume texture to sample!
volume array (3.8 kB)