Skip to main content
GameDev.net gamedev.net
🔒 Locked

DX11 - Lighting - Does it affect the mesh?

Started by Veiled Glitch May 26, 2013 at 11:13 AM 5 replies 2.7k views
Original Post
Veiled Glitch
Veiled Glitch

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?

belfegor
belfegor

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.

Veiled Glitch
Veiled Glitch

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

belfegor
belfegor

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

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

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.

MrCodeSushi
MrCodeSushi


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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.