Jump to content

get shadow info for stealth game (thief like)


MexSource
 Share

Recommended Posts

If directional light, just perform a raycast to the light - if clear line of sight then you are in the light. For spot / point lights, try setting up trigger shapes that match closely to the light's cone/diameter. If triggered, then you are in the light. If looking for stages of blending between light and shadow, maybe have multiple trigger shapes at various cone heights/ radii. Sounds like a perfect place to make heavy use of prefabs.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Yeah, prefabs would be great for that. You could combine a cone with a spotlight, and attach a script that could maybe resize the cone with the spotlight values inside Script:Start(). Same with a sphere and pointlight. Then just use the prefabs wherever you want to place your lights and you won't have to think about it ever again when you place a bunch in your scene.

Link to comment
Share on other sites

  • 1 month later...

Well, culling will tell you if the object is within a light's volume. Point and spot lights do not use occlusion culling when rendering shadowmaps because the test involves latency, and the results are only available 1-2 frames after the fact. Since point and spot lights are only updated when needed, this would not be useful for them.

 

The raycast test would tell whether the object's center has a clear line of sight to the light, and is a pretty good blunt solution.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...