Jump to content
  • Advertisement
Sign in to follow this  
kRogue

doom3 bumpmaps (agian)

This topic is 4881 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

HI all, does anyone know how the values are encoded in doom3 bumpmaps? (the _local.tga textures)... Currently my guess was: normal.xyz= 2.0* ( TextureValue.rgb - vec3(0.5,0.5,0.5) ) but this produces not so knd of odd visual results... so I also tried: normal.xy= 2.0*( TextureValue.rg - vec2(0.5,0.5) ) normal.z=sqrt( 1.0 -dot(normal.xy,normal.xy) ) also odd results... ( I _believe I have already setup correctly the transformation from "normal" of the texture to the normal of the model via Normal,Tangent and BiTangent vectors... anyone know the encodnig for the doom3 bump map textures?? Best Regards

Share this post


Link to post
Share on other sites
Advertisement
normal.xyz= 2.0* ( TextureValue.rgb - vec3(0.5,0.5,0.5) )

is correct, or, as I do

normal.xyz = normalize(TextureValue.rgb * 2.0 - 1.0);


Do you transform the normal from tangent space to object space? Transforming the lightvector to tangent space in the vertex shader is much better...

Share this post


Link to post
Share on other sites
Hi,

I just found a mistake in my GLSL code: I had left a normalization in when I should not have, now it _looks_ ok... and I am an idiot for missing it too!

right now I do the chang of norma vector into object space at the fragment shader; I definitly should change that to change change the light vector into tangent space at the vertex shader level; will get to that sooner or later (though, if I leave the transofrmation of the light vector in the fragment shader, I can do lots and lots of lights[well restricted by ow long a frag shader I can do and register space] while if I do the transofrmation of light vector into tangent space,my number of allowed lights is limited by the number of interpolaters.

Best Regards.

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!