Jump to content
  • Advertisement
Sign in to follow this  
Migi0027

DX11 DX11 - Lighting - Does it affect the mesh?

This topic is 2023 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

Hi guys! Again!

 

Lets imagine that I have a sample scene where I have a huge plane and a point light. Now I'm trying to figure out if the light is going to affect the plane. 

 

I would Imagine that in this example I had to use sphere to plane collision, but Imagine that I had a more complicated mesh, like a building, what would I do there?

 

So the question is, how can I check weather that the point lights is going to affect a complex mesh on the CPU, real time?

Share this post


Link to post
Share on other sites
Advertisement

I would make 6 light "cameras" (like for cube map reflection) and cull (frustum, occlusion queries...) objects for each. But first normally  you cull from player view each light face.

Share this post


Link to post
Share on other sites

But just because the point light can see the mesh as a camera, doesn't mean that the light reaches the mesh wacko.png

Share this post


Link to post
Share on other sites

Camera has a far clip plane (light range) so it doesn't reach mesh. wink.png

Edited by belfegor

Share this post


Link to post
Share on other sites

Mesh has a bounding sphere, light has a bounding sphere; do an intersection test -> if they intersect then the light effects it.

That will not work for Directional Lights. Just wanted to give my two cents on it.

Edited by BornToCode

Share this post


Link to post
Share on other sites

Mesh has a bounding sphere, light has a bounding sphere; do an intersection test -> if they intersect then the light effects it.

That will not work for Directional Lights. Just wanted to give my two cents on it.

His only concern is just point lights at this moment. But if he would check for directional lights he can just use the camera's generated PVS frustum culling.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!