Jump to content

tell how much light is on something?


Rick
 Share

Recommended Posts

I was wondering how I can tell how much light is on some model. Say I want a game where you can use dark areas to hide, but those dark areas are dynamic in that sometimes light shines there and sometimes it doesn't. Is there a way I can tell this using some kind of light information or would I have to use some tricks to get this to work.

 

I would prefer it to be real lighting information. For in the case where there is a round hallway with little side areas and a floating light ball travels around the hallway that shines light on one side of the hallway and then the other side, forcing the player to alternate sides to stay out of the light. There could be many different scenarios so faking this with triggers and such would kind of suck.

Link to comment
Share on other sites

I would use some ultra low res buffer, like 32x32, and render the light of each object using a camera which is positioned at the object, then turned away from the player's camera, and then moved back that it's slightly outside the object's mesh's AABB.

 

When the pixel in the center of the buffer is brighter than the current AmbientLight value, then it's hit by a light. If it's darker, the mesh might be black color, but it works then also because the black color eats all light, so even if it's hit by a light, it's not affected by it, so it's the same as not being hit by a light at all.

 

You can do this routine maybe every 600th frame, since reaction time to light is supposed to be realistically delayed (iris adjustment, light speed limit, etc...), so it won't cost any FPS either.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Are you going to make a remake of Alan Wake?

 

Sounds more like Splinter Cell to me

 

since reaction time to light is supposed to be realistically delayed .. -> .. light speed limit

 

Speed of light. Well, uh... It's pretty fast. "Frame rate" of the human eye is much more of limiting factor. That said, I believe that airline pilots have to demonstrate that they can see upto 220 frames per second

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

  • 2 weeks later...

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