How to judge whether the object is covered with shadows?

Problems building or running the engine, queries about how to use features etc.
Post Reply
chiminh
Gnoblar
Posts: 1
Joined: Fri Jun 12, 2015 4:08 am

How to judge whether the object is covered with shadows?

Post by chiminh »

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 ?
User avatar
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?

Post by areay »

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.
Post Reply