Jump to content

  • Log In with Google      Sign In   
  • Create Account


Terrain Normal Mapping


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Cem   Members   -  Reputation: 123

Like
0Likes
Like

Posted 26 March 2010 - 08:22 AM

I am about trying to make normalmapped heightmap terrain.Is it just enough to pass "Terrain's world transform" to the shader for tangent space calculations in it?

Sponsor:

#2 solenoidz   Members   -  Reputation: 513

Like
0Likes
Like

Posted 26 March 2010 - 08:46 AM

If your terrain do not rotate I believe you do not need tangent space, tangents and binormals to normal-map your terrain. Normals would be in object/world space, so keep your light in that space and you are good.

#3 Cem   Members   -  Reputation: 123

Like
0Likes
Like

Posted 26 March 2010 - 08:50 AM

you are suggesting a world space normalmap approach.fast but less preferable. so ı already calculated vertex normals successfuly. now which steps should i follow when you said keep your light in this space. the light already in worldspace. ı already have vertex normals and then ?

#4 solenoidz   Members   -  Reputation: 513

Like
1Likes
Like

Posted 26 March 2010 - 09:23 AM

Calculate the dot between the light direction and the normal in the vertex shader and pass that float to the pixel shader. In pixel shader, sample your bump-map texture sampler extract a normal from it, add it to the "float dot" passed from the vertex shader and use that "float dot" for your final color calculation of the pixel. That works for "detail normal mapping" with conjunction with vertex normals being present and used to calculate the "overall" lighting.
That is simply one of the ways of doing it.
For example for normal maps in object space as those exported from L3DT for example, you don't need vertex normals i think.

#5 Cem   Members   -  Reputation: 123

Like
0Likes
Like

Posted 26 March 2010 - 09:28 AM

i will give it a try. thanks for your clear explanation. just rated you!.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS