Jump to content
  • Advertisement
Sign in to follow this  
reallycoolme

Terrain normals

This topic is 4579 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, I have a terrain (a bunch of vertices with an index buffer) and I want there to be lightning flashes which light up the place (make the terrain brighter). What do I have to do to make it happen? I have a normal data x,y,z in my vertex structure and i included the normal flag in my FVF. Also, I am using a white directional light for my lightning flash (with a strong white ambient), but it isnt doing anything. anything im not doing?

Share this post


Link to post
Share on other sites
Advertisement
Are you doing this with the Fixed Function or Programmable Function pipeline.

Dave

Share this post


Link to post
Share on other sites
The maximum lighting contribution in the fixed function path is 1.0. Even if you add 10 lights, they will all saturate to 1.0. You have to go vertex shader if you want more than that (and then, ideally, vs_2_0 or better).

An alternative is to turn OFF lighting, and/or setting the ambient light and material property to 1.0; this will cause the darker (shadowed) pieces to be lighter. That will give a brighter impression.

However, real lightning is very directional, so you're probably better off setting ambient to 0, diffuse to 1, and binding an entirely white texture. This will make the ground black where it's facing away, and white where it faces the lightning. I bet this will look pretty decent.

If you go shaders, you can do all kinds of things with over-brightening, runtime brightening/dodging of textures, etc.

Share this post


Link to post
Share on other sites
I do not have any shaders or anything (my graphics card doesnt support them). I think that white texture idea is best suited for this, but im still wondering how to illuminate the terrain with an actual light in case i have an effect which uses different colored lights. My vertex structure has a diffuse, does that affect it? im setting the color to 0xff010101

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!