How to judge whether the object is covered with shadows?
-
- Gnoblar
- Posts: 1
- Joined: Fri Jun 12, 2015 4:08 am
How to judge whether the object is covered with shadows?
Now I use a directional light to illuminate an object A, object B in the shadow of object A, I want to know How to judge whether an object B in the shadow of A ? could you tell me the about function or method in OGRE ?
- areay
- Bugbear
- Posts: 819
- Joined: Wed May 05, 2010 4:59 am
- Location: Auckland, NZ
- x 69
Re: How to judge whether the object is covered with shadows?
Search for depth shadow mapping. This is how shadows are usually done.
If you're wanting to base some sort of game logic on whether or not an object is in shadow then perform a raycast from object B towards the light and if it intersects object A then you know it's in A's shadow.
If you're wanting to base some sort of game logic on whether or not an object is in shadow then perform a raycast from object B towards the light and if it intersects object A then you know it's in A's shadow.