A quick one I hope. I want to generate texture co-ords in a vertex shader prog by taken the two smallest of the three vertex components (for simple spherical mapping)
if v.x > v.y
if v.x > v.z
u = v.y
v = v.z
else
u = v.x
v = v.y
end if
else
if v.y > v.z
u = x
v = z
else
u = x
v = y
end if
end if
How simply can this be translated into Vertex Shader code ?
im not sure it can be, because this is per polygon, and vertex program works on the vertex level, but maybe if you put the other verts in the registers, it is possibile.
Cubemapping is probably a better approach, but if you really want to implement that specific thing, you can do so with SGE/SLT followed by some MULs, ADDs, or MADs. Not sure how many total instructions it would take, but I would think not many.
I’m doing a surface texture using a cube map and i’d like to blend in a highly repeated detail texture. If I use a cube map for the detail texture would I have to repeat the detail texture 6 times? and does cube mapping allow repeated/wrapped textures ?
Oh and I guessed it would require a series of SGR/SLT/MAD’s etc