Jump to content

Exclude objects from Ambient Lighting.


photo

Recommended Posts

Hi, we are trying to exclude certain objects in our scene from being affected by the World Environment light. For example we have a railway scene with above ground and in Tunnel sections - We would like the sections in the tunnel to not be affected by the world environment lights and Ambient settings.

 

We have used a Mask to effectively stop the Sunlight from affecting our Indoors/underground areas, but they still seem to be affected by some sort of environmental Ambient light.

 

playing with the Ambient Texture or the Ambient modulation in the material does not stop these surfaces from having different lighting at different times of day... obviously an underground building should only be affected by its own lights, not the world (sun) light.

 

Thanks in advance for any help.

 

Shane

Link to comment

I have the same problem, but only one solution, put some trigger and write some scripts. but this way still have another problem, if player was about to enter the tunnel, the lighting is still wrong.

Link to comment

Thanks for the replies... however,.

 

Setting disabling light world pass made no difference, and i cannot see the setting "environmental ambient light state" in the version i have of the SDK

 

As far as Set environment scale to zero and create additional LightProb sources, i cannot find a set environment scale anywhere?

 

Surely there has to be an easy way to exclude inside areas from the world ambient lighting? how have other people done this that have done levels with both indoor and outdoor areas?

Link to comment

well, I want to extend this problem how to exclude the objects completely from AO pass?

 

for example, I have 1000-2000 speedtree model in scene, of course all these trees have lod, if I don't need all these trees computed in ao pass, ao in these trees didn't improve the quality of render, but Indeed, I need the WorldLight to lit these trees, seems there is no way to do that.

 

In this situation, exclude trees from ao pass must have improvement in performance, but almost no impact with rendering quality.

Link to comment

Setting disabling light world pass made no difference, and i cannot see the setting "environmental ambient light state" in the version i have of the SDK

 

As far as Set environment scale to zero and create additional LightProb sources, i cannot find a set environment scale anywhere?

 

Surely there has to be an easy way to exclude inside areas from the world ambient lighting? how have other people done this that have done levels with both indoor and outdoor areas?

 

It should have helped. Do you use Render settings->Ambient color? If yes, that is really not a good way to simulate lighting, as it is applied to everything in the scene.

 

Here is a how to set up lighting for your outdoor area:

 

  1. Add the world light (sun).
  2. Grab and set the environment texture (see how to do it).

And here is step-by-step how to set up your indoor area:

 

  1. Click on the material that you have indoors (walls, for example).
  2. Go to Materials editor -> States tab and set Light world to Skip (see on the picture above). After that, it will not be affected by any world lights.
  3. Go to Parameters tab and set Ambient Environment scale to 0. After that, material color will not be modulated with environment texture.
  4. However, we still need some kind of subtle environment lighting even for indoors. That is what LightProb sources are for.

    1. Set up dynamic lights (for example, omni or spot lights) that will simulate your ambient lighting in the tunnel.
    2. Add and bake LightProbs.
    3. Click on the indoor material. Go to Materials editor -> States tab and set Light prob to Default.
    4. Delete dynamic lights.

And your indoor environment lighting is set. After that, you can add dynamic lights that will cast shadows (omni or projected light sources).

Link to comment

well, I want to extend this problem how to exclude the objects completely from AO pass?

 

for example, I have 1000-2000 speedtree model in scene, of course all these trees have lod, if I don't need all these trees computed in ao pass, ao in these trees didn't improve the quality of render, but Indeed, I need the WorldLight to lit these trees, seems there is no way to do that.

 

In this situation, exclude trees from ao pass must have improvement in performance, but almost no impact with rendering quality.

Ambient occlusion is calculated only in screen space. It practically does not depend on the content. If you want improvement in performance tune AO settings. (Default AO settings are quite performance demanding).

  • Decrease Screen radius
  • Increase Distance power

(See the details).

Link to comment

Thanks for the help everyone, but i think you are missing the point.

 

i am not talking about SSAO at all, or anything to do with shadows - i am talking about world ambient lighting color affecting indoor areas.

Link to comment

We had similar problem. Ambient color is necessary for our outdoor environment to avoid complete darkness because sun has to be turned off. Use triggers if you need ambient color in outdoor areas and wish to exclude indoor areas from its influence. We were using triggers also to set up areas with special outdoor (very different from other parts of the world) environment settings.

Link to comment

I think that the Ambient color can be used to illuminate the darkest areas in your scene (for example, if you plan to use SSAO). It represents the minimum value of scene illumination. In your case, orient on the minimum lighting in indoor areas - that is your minimum and that should be your Ambient color. Environment ambient light (Render->Environment + Materials->Textures->Ambient texture, Parameters-> Ambient Environment scale) represents environment outdoor lighting (for example, sky light). If your indoor doesn't have any openings, exits and windows, the Ambient texture for your indoor objects should be black.

If your outdoor objects are too dark in the shadows, you can make your Ambient texture lighter to avoid complete darkness (use additional bounces in your lightmap rendering engine or adjust levels for the texture).

Link to comment

Adjusting Ambient color to minimum indoor lighting will work for illumination in general, to avoid too light and too dark areas. There will be a problem if different Ambient color gamma values are used to represent night - day changes (blue for night, orange for the sunset). Ambient color gamma will change for both outdoor and closed indoor scenes.

Link to comment

Use different Render Environment texture (Render settings -> Environment) for different lightning. Grab it by grabber (Tools -> Grabber) for each outdoor light conditions.

Link to comment
  • 2 weeks later...

We have 24-hour day/night cycle, so how many those environment textures should we have?

And we have to build them for every different scene separately.

This does not sound like a perfect way to go, honestly.

 

Using Ambient light value on the other hand gives you fast and effective control if you can mask certain geometry/materials out so they are not affected...

 

We looking at the universal solution independent on the scene and not requiring having a set of additional textures. :(

Link to comment
  • 3 weeks later...

We have 24-hour day/night cycle, so how many those environment textures should we have?

And we have to build them for every different scene separately.

This does not sound like a perfect way to go, honestly.

 

Using Ambient light value on the other hand gives you fast and effective control if you can mask certain geometry/materials out so they are not affected...

 

We looking at the universal solution independent on the scene and not requiring having a set of additional textures. :(

  • Ambient light may seem universal from the first sight, but is an extremely bad choice for lighting. With it the rendered image looks flat, dull and does not have any details at all!
  • On the other hand, Using environment textures is easy and pays off with MUCH more realistic results.
    • You need only 4 textures (day, evening, night, morning) to interpolate between; even 2 textures will do. See samples > render > ambient_00 for interpolation example.
    • Environment textures are VERY small: 32x32 cubemap is enough. There will be no memory overhead, fear thou not :) For example, for Heaven 4 environment textures were only 96 KB worth.

Additional boxes for excluded ambient light mean increased shader complexity. And that in its turn means drop in speed and performance. It's really not worth powder and shot. Simply compare the pictures below. With ambient light all you'll get is flatly colored blots. With environment texture these are realistically lit models with all details.

post-13-0-00265300-1311586965_thumb.jpg

post-13-0-29338700-1311586977_thumb.jpg

post-13-0-97251500-1311587011_thumb.jpg

Link to comment

Thanks manguste, this sounds like the best solution. However i have a question regarding this in our special case.

 

The worlds we are developing will be very large, generally 60km at the smallest and potentially up to a few thousand KM of scenery using the new large world support.

 

My question is how often, or far apart should i be sampling environment maps, and is it even possible to not only have multiple light maps for different times of day, but for different regions? or is it ok to have a set of environment maps for the entire world? (my feeling is no).

 

If we have a solution for this with our large size worlds, i think it could be a winner :(

Link to comment

Now matter how far the world stretches, using 1 environment texture is actually enough. It is basically only sky light/color that matters. For baking the environment texture, all objects are disabled first, so its pure and bare environment (sky+ground) in any case and they do not change with the distance.

 

If you want to, you can always lerp textures, but it does not seem necessary.

Link to comment

excellent information , thankyou.

 

Now matter how far the world stretches, using 1 environment texture is actually enough. It is basically only sky light/color that matters. For baking the environment texture, all objects are disabled first, so its pure and bare environment (sky+ground) in any case and they do not change with the distance.

 

If you want to, you can always lerp textures, but it does not seem necessary.

Link to comment
×
×
  • Create New...