help with lighting...

Started by
3 comments, last by jollyjeffers 18 years, 11 months ago
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
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...
Visit galaxyroad.com which soon will have english contents too
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.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
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
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement