• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

# 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.

4 replies to this topic

### #1Cem  Members

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?

### #2solenoidz  Members

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.

### #3Cem  Members

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 ?

### #4solenoidz  Members

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.

### #5Cem  Members

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.