# Parallax Mapping problem

This topic is 4646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites

//get eye vector
float3 eye = mul(inVertex.pos, s_matWorldView);

You might do :

float3 eye = mul(inVertex.pos-s_CameraPos, s_matWorldView);
? :)

EDIT: In fact, you might not multiply by matWorldView all your data concerning offset mapping. This is incorrect I think.

then

float3 eye = inVertex.pos-s_CameraPos;

float3x3 matTangent;
matTangent[0] = inVertex.tang;
matTangent[1] = inVertex.bino;
//matTangent[2] = inVertex.norm; ===> is unuse for offset mapping

then dont use a mtrix, do

OutVertex.ToEye.x = dot(inVertex.tang, eye);
OutVertex.ToEye.y = dot(inVertex.binorm, eye);

ToEye => vector2;

##### Share on other sites
Hmm that didn't work. Only one side of the cube came out textured, and it wasn't really parralaxing either.

##### Share on other sites
I think the idea behind parallax mapping was never that it looked like the object was parallaxed from all angles as you seem to be requesting. It's meant to "look 3-d" from a certain set of angles, but once you've overstepped that angle set, it just looks like an ordinary texture again, with silly-looking bump mapping applied to it. Have to look into this one tho...

##### Share on other sites
This line:

outVertex.toEye = mul(eye, matTangent);

I think it should be
outVertex.toEye = mul(eye, matTangentInverse);

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 76
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632968
• Total Posts
3009585
• ### Who's Online (See full list)

There are no registered users currently online

×