Hi, I'm wondering if anyone could give me some pointers creating a sphere map shader in shaderfx. There's one in the examples but I can't seem to get it to display correctly (it says set the vector space to world, but it appears that's the default anyway. it just looks like a smudge of colour)
any tips?
cheers!
-rich
Replies
Use this normal as UV coordinate to sample from texture. The ss. normal will probably be in -1 to 1 range, while UV's are in 0-1 range. Plus, the normals need to start sampling from the center of the texture.
So, divide surface normals by 2 to scale them into a range of 1, then add 0.5 to them to translate them to the center.
Then just use only the X and Y components as UV's coordinates to sample.
Should be all there is to it save for some details.
did a spheremap node once
should do the job
shaderfx cant convert from tangent to view space
first you have to convert to modelspace then to viewspace
then add 1 and divide by 2
do I need another file to go with it?
cheers!
http://knol.google.com/k/shader-fx-environment-mapping#
http://dl.dropbox.com/u/1484680/GRP_SphereMapping.ms
http://dl.dropbox.com/u/1484680/GRP_SphereMapping.sfx
copy both files to
3ds Max root\Scripts\ShaderFX\Nodes
and it should work
nothing to object to XD