Jump to content

View more

Image of the Day

I've been working on making the market place and waterfall prettier this morning #screenshotsaturday #indiedev https://t.co/n4zYqOpKkE
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

[DX9 C++] HLSL lighting problem - occluded objects

2: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 cebugdev   Members   

591
Like
0Likes
Like

Posted 14 May 2011 - 12:07 AM

Hi All,


I have a small problem when I implemented my lighting in HLSL (I havent tried if this happens when using fixed function pipeline),

The situation is when i place a light on the scene, other objects are affected by the light even some objects like a a simple

plane ploygon or a wall is in front of the object completely occluding the object against the light,

this happens since computing the normal of the polygon against the direction of light, it is indeed facing the light therefore the

factor that there is an occluding object was not consider.


how can i fix this?

Thanks,
Ruell

#2 TiagoCosta   Members   

3645
Like
1Likes
Like

Posted 14 May 2011 - 03:47 AM

If I understood what you are asking Im guessing you are a beginner in DirectX... :rolleyes:

(Unless you are using a raytracer) Simple lighting shaders dont take into account if an object is occluded or not... They simply calculate the influence of a light in a object based on the view point, etc.

To do what you want to accomplish you must implement shadow mapping, but it might be "too advanced" for you, idk take a look at the link and google. If you have any question just ask :lol:

#3 cebugdev   Members   

591
Like
-1Likes
Like

Posted 14 May 2011 - 05:45 PM

what im trying to say is;
example i have a light object a wall and another object behind that wall,
the object behind that wall can still be lit up.

Heres the illustration

                 | W |
                 | A  |
point ligh       | L  |  object                  <--- Camera looking behind the wall
                 | L  |


SInce the object normal is facing the point light, it is lit up.

If I understood what you are asking Im guessing you are a beginner in DirectX... :rolleyes:

(Unless you are using a raytracer) Simple lighting shaders dont take into account if an object is occluded or not... They simply calculate the influence of a light in a object based on the view point, etc.
To do what you want to accomplish you must implement shadow mapping, but it might be "too advanced" for you, idk take a look at the link and google. If you have any question just ask :lol:


Yes, Im new to HLSL and i understand that Lighting does not take into account if an object is occluded
or not that is why Im asking people where on how to fix the problem i posted above.

Adding shadow map, is a good idea ill try that one.

Anyways, other than shadow map, is there any other approach?

#4 Tom KQT   Members   

1703
Like
0Likes
Like

Posted 15 May 2011 - 03:16 AM

Shadows really are what you need in this case.

Here's a list of various shadow mapping techniques, and also other techniques (not shadow mapping) are mentioned, with links to them:
http://en.wikipedia.org/wiki/Shadow_mapping

Also feel free to use google or the search feature on this forum, shadowing is a very common topic.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.