Jump to content
  • Advertisement
Sign in to follow this  

Help with Steep Parallax Mapping shadows

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got Parallax Mapping up and running using a linear depth trace and the tangent view vector to obtain the displaced texture coords. The paper i'm following uses ps3 and while loops, but i want it to work with ps2 hardware.

vec3	displacementTrace(int numIterations, vec3 tangentViewVector, sampler2D texture, vec3 texcoord){

    float 	distance2Trace;
    float	normalizationFactor	=	1.0/numIterations;
    vec3 	offset 			= 	normalize(tangentViewVector)*normalizationFactor;
    vec3	texCoord 		= 	vec3(texcoord);
    // RAY MARCH  
    for (int i = 0; i < numIterations; i++) {
	distance2Trace = texture2D(texture, texCoord).a;
	texCoord += distance2Trace * offset;
    return texCoord;
vec3 	texCoord = displacementTrace(NUM_ITERATIONS,tanEyeVec,tex2,gl_TexCoord[0]);

Now I want to add self-shadow to the above, but am having problems understanding the methods I have found on the internet. As I understand it, I need to do another linear trace using the tangent light vector, but my results are incorrect. Any help would be appreciated. [Edited by - _Lopez on August 12, 2008 5:03:41 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!