I’ve been experimenting with parallax, maping yesterday, but faced some problems.
What I’ve been doing was:
2nd: draw geometry stage + passing tangent, binormal, normal to vp
3rd: passing eyepos, + MVP,MV,MVIT matrices to cg vp
4th: cg vp -> mul(mvit,eyepos), E=eyepos-IN.pos, mul(TBN, E)
5th: cg fp, fetch height from texture, normalize E, use the function to calculate offset offset=(h*E.xy/E.z)
The problem seems to be connected with transformations, as the texture appears to rotate vhen crossing some point (moving with gluLookAt)
Yup, right now I’m trying to sort things out on plane, then I’ll go into 3D + I think I’ll pass only 2 of 3 TBN vectors to GPU, 3rd will be cross on GPU (gonna see how FX5200 will handle that). And I’ve learned that uniform parameters are real pain in a** when you have 10+ shaders in one app.
[This message has been edited by M/\dm/
But I noticed that there are prety ugly artifacts when parallax is applied on some of my textures:
W/O parallax http://www.lapas.dau.lv/salitis/1.bmp
W parallax http://www.lapas.dau.lv/salitis/2.bmp
Tried experimenting with biases, but that doesn’t seem to be a good solution, as you’ll have flaws or no parallax
Of course my textures arn’t very nice as they have a lot of sharp angles.