• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: VWR-3224
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Haravikk Mistral
Votes: 6
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
1. Second Life Viewer - VWR

Culling ambient lights

Created: 16/Nov/07 03:26 AM   Updated: 30/Sep/09 01:31 PM
Return to search
Component/s: Graphics
Affects Version/s: Other (please specify in issue description), 1.18.3 Release Candidate, 1.18.0, 1.18.1.2, 1.18.2.0, 1.18.3.5, 1.18.4 Release Candidate, 1.18.4.3, 1.18.5 Release Candidate, First Look: WindLight, 1.22, 1.23
Fix Version/s: None

Issue Links:
Relates
 


 Description  « Hide
The following proposal was inspired by this thread, where you can see my original post:
http://forums.secondlife.com/showthread.php?t=223486

Many of you may know about occlusion culling, it is a feature whereby objects that are hidden by other objects are "culled", meaning that they are no longer rendered because you can't see them.
You will also notice that ambient-light from the sun/moon is currently able to penetrate buildings and thus render inside houses. This is a bit weird, as a completely closed box can be bright and sunny inside!

Well, the basic idea behind this proposal is to take occlusion culling and apply it to the ambient light sources (sun and moon). What this will mean is that when you are underneath a roof or some other object which blocks out the sun/moon, then they will simply stop being rendered, resulting in a nice dark room.

So what about over-hangs, doors and windows? Well, these can be approximated. When occlusion culling is performed it should mark areas where there are gaps, the idea then is to simply place light sources in these gaps that mimic the ambient lights, but for the smaller area. The result is that a closed room with a window would still have light coming in from the window, but would now be darker overall than were it to have no roof.

This would essentially give us a more realistic lighting system, without requiring tons of processing, by leveraging an existing feature (occlusion culling).

An alternative implementation for handling gaps could use an additional shader pass. Basically, if the sun and moon are picked up for occlusion, and gaps are found, then the area within the occluding primitives (the indoor area) is rendered using a darker shader with less contrast, which renders light/dark based on proximity to the detected gaps, creating an indoor effect.
If the sun and moon are picked up for occlusion and no gaps are found, then the a fully indoor shader is used, which basically adds a small amount of ambient light so that the scene isn't completely black, but is otherwise intended only to work with local-lights to render the indoor area.

This is not intended to create super-realistic shadows or anything like that, but simply to decrease the level of light in indoor or otherwise "sun-blocked" areas.
If the cases including gaps seem overly complex, then simply allowing for ambient lights to be optionally excluded in the event that you are in a self-contained box would be a good step toward having realistic indoor and outdoor environments where you can open a door and suddenly the room is flooded with light.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Simon Nolan added a comment - 16/Nov/07 12:11 PM
Wow! This seems like a relatively light-weight way of at least partially handling VWR-1601 and its duplicate VWR-3189. Linking as related.

AnnMarie Otoole added a comment - 08/Jul/08 07:58 PM
A MUCH SIMPLER SOLUTION:-

How about adding [PRIM_AMBIENCE, float reflection] to llSetPrimitiveParams()
Zero reflection represents no response to ambient light, 1 = full response (default)

To get the inside of a room dark you have to adjust all colors to black. The problem then is a light source is also unable to shed light on the room. By setting ambient light response to zero or nearly dark, an avatar can then walk around with a light that would have normal illumination response from surroundings within the light fall off range.

This feature exists already in response to sunlight so it should be straight forward to add it to specific prims using this setting.