Jump to content
  • Advertisement

Archived

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

browny

Real Time Lighting.....

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

Advertisement
Guest Anonymous Poster
Very carefully?

Share this post


Link to post
Share on other sites
Cosine shading.

Given a surface normal and a direction vector for your light source(s), add the product of the color value and the cosine of the angle between the normal and the light to the surface''s color value. ie,

vector3d snorm; // surface normal
vector3d light; // magnitude and direction of light
// It''s often helpful to keep these vectors normalized, but it may not work for you...
float shading_factor = light * snorm; // dot product yields cosine of angle
// now when drawing, multiply light color by shading_factor and add to surface texture/color

Share this post


Link to post
Share on other sites
I store my lightmaps in my Leveleditor in 8bit lightmaps....
R3_G3_B2 or so :o).. works great hehe..

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

R3_G3_B2 !! yuk !! You''re joking about that, are you

- JL

Share this post


Link to post
Share on other sites
Well I think I''d do normal RGB shading and then find the closest match in the palette for the resulting color. But that might be too slow to be real-time?

Share this post


Link to post
Share on other sites
No I''m not joking about that R3_G3_B2 stuff... it''s only for the lightmaps and it works fine! even for colored ones hehe.. they''re blended anyhow... and I need to save memory in my Leveleditor :O)))

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
R3_G3_B2 is horrible, even for lightmaps. I use 16 bit textures R5_G6_B5, OK they take twice the memory, but they look so much better. You can also use 8bit paletted textures for lightmaps, they look even better, but need to be quantized first.

- JL

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.

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!