Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jackthemeangiant

Lighting up terrain...

This topic is 6063 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 am creating a terrain engine generated from a heightmap, and I just finished the code to calculate all the vertex normals. But I am fairly inexperienced with OpenGL Lighting, and when I enable a GL_LIGHT, and set up the diffuse and ambient properties, it just doesn't look right at all... I basically want the terrain, to look like terrain, with light coming from a particular spot(a sun). When I tried it, it was either all white, or the tops of my mountains were all white, or the light didn't reach one end of the terrain. I have read the chapter on Lighting in the Red book numerous times, but I am still stuck. Please help me =) Thanks Edited by - jackthemeangiant on November 10, 2001 3:10:04 PM

Share this post


Link to post
Share on other sites
Advertisement
the problem sounds very much like your supplying the incorrect normals.
theres a lot of info/demos/tuts on the net on how to calculate the correct normals
if u have the red book check out appendix E.

first find the normals to all the tris/quads + NOT the vertex normals once u have that info u can work out the vertex normals later

Share this post


Link to post
Share on other sites
Could you post your code or portions of it, perhaps screenshots of the improperly lit landscape? Maybe with a bit more info we can help you better.

Share this post


Link to post
Share on other sites
For starters, just post the light initialization code.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
Alright, I can post it later tonight...

My stupid computer crashed when i had VS6 open, and the file with all my normal calcualtions ans lighting in it became corrupted....and i have to re-write it....

Share this post


Link to post
Share on other sites
wow.... that sux.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
jack even though it still looks like the normals to me.
try making ambient light 0,0,0,0 + use a directional light not a positional one.
about the corrupt file from vc (i take it youre using win2000/XP)

right click on the harddisk select properties->hardware->properties->diskproperties and uncheck disk cache enabled.
u will need to do ths every time u reboot the machine.
ive been bitten a few times by crashes in win2000, when the current open c++ file has been turn into junk. grrrrr

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!