Jump to content
  • Advertisement
Sign in to follow this  
J b O n E

help with lighting...

This topic is 4895 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'm hopin someone else has done/come across this problem and can help me come to a speedy solution. i'm not a novice and know what _should_ be working to put light in my scenes, however, it's not. the program i am working with uses a matrix stack for transformation, that's the only thing i can think of that could be making my lights useless. i have turned off all lighting/vertex/pixel shaders so the only light should be coming from the one point light i have placed in scene. but for going on 36 hours now the entire screen has been lit like i was using a sun and not casting any shadows. so i've either got off - or blinding - nothing in between. is there a trick to getting lights in the proper position in matrix stack that is just not documented ? tia for any insight/help... pEAcE JbOnE

Share this post


Link to post
Share on other sites
Advertisement
hi
I think that's better to get rid of point light and use something like lightmaps or off-screen render to make what you need. If you can use shaders, it means you can simulate a point light with HLSL regardless of matrix stacks, of course it depends on your project, but I think that's better not to use lights for illuminating the scene...

Share this post


Link to post
Share on other sites
are you scaling? i forget the call in Direct3D, but if your scene has been scaled up your normals and unless you normalize them they will look like this.

Share this post


Link to post
Share on other sites
yes anist - there's tons of scaling going on - but i was under the impression that the matrix stack would keep that all in order. vcGamer - thx for the tip. unfortunately it's an xbox title i'm working on, so i am stuck with dx8.1 so no hlsl for me hehe - but i'll look into getting the lighting handled in vertex shaders. there's already a few used - what's a few more right :) thx again for the input - now i guess my question is if anyone has any 'lighting with vertex shaders for dummies' links lol

pEAcE
JbOnE

Share this post


Link to post
Share on other sites
Quote:
Original post by J b O n E
yes anist - there's tons of scaling going on - but i was under the impression that the matrix stack would keep that all in order.

The normals will be scaled using the same scaling values as the vertex positions. If you have a unit-length vector as a normal, you'll get correct lighting. If you scale your mesh x10 then you no longer have a unit vector and consequently your lighting (in places) will appear x10 brighter...

Try setting D3DRS_NORMALIZENORMALS to TRUE - if that calms things down and starts to look correct, then you've found your problem [smile]. If that doesn't make any difference, examine the properties for your lights and materials.

hth
Jack

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!