Lighting questions

I have a lot of questions in lighting
here is a project with outside and inside scene , after struggling with lightning them both I reached to acceptable result except that I had a light bleeding throw my mesh like that 2016-01-05_1417

now I can play with shadow bias to solve it but it will give me a very bad artifacts strips so it is not a solution

also I managed to solve this problem by using ray traced distance shadow but it will give me wrong shadows at the corners like taht 2016-01-05_1413

all of that was by using a movable light and if I turn it to stationary it will give me wrong shadows like that 2016-01-07_0958
and here is another question …Is it ok to use a stationary light inside blueprint class as long blueprint is movable and also will it give a right shadows on movable actors like a blueprint movable door

on the other hand is skylight the only solution to get light shadow?
because if I do not use it shadow will be pure black and if I use it it will affect the whole scene and prevent me to have a full dark scene inside my room if I turned the light off like that lighting_ceramic

and for the god sake is it so hard for UE4 programmers to add an option to control shadow opacity? ( I guess not )

and the last question is it because the light in UE4 not real like so …the program called unreal :wink: ? ( just kidding )

although I am really serious about this problems in lighting and it took months with me before writing this questions
so please help me cause I really loved the program and want to have a real results in unreal

Hi trytoh,

I’ll break down your questions into sections and respond accordingly since there is a lot of information here. :slight_smile:

I also see that you’ve marked that you’re using 4.11 P1, which has some known and not known issues right now. Preview builds are best for being used for testing our new features, but not actively developing in. 4.11 is going to introduce a lot of new Rendering features, but there are some pretty hefty known issues right now with some features like skylights and exponential height fog.

Q1/Image 1: Light Bleed

As you’ve pointed out you’ll want to adjust some of the settings in the dynamic light, although if you’re using a Directional Light like your image shows, I wouldn’t adjust the shadow bias or filter sharpen before first adjusting the options under the Cascaded Shadow Maps category.

You can refine the lights quality and shadow casting by adjusting these values first. Then maybe slightly tweaking the shadow bias. Point/Spot Lights will not have these options though. Only shadow bias and filter sharpen.

This page I wrote on the Lighting Troubleshooting and Tips Guide on the Wiki should help you with this to some degree.

Q2/Image 2: Distance Field RayTraced Shadows

Unfortunately, that image doesn’t really help identify the main shadowing issue with the scene. You will want to use the Viewmode > Show > Visualize > Mesh Distance Fields to see what your mesh distance field representation looks like in the scene. There are a few things that can affect the mesh distance field. These can include the size of the mesh and the distance field resolution needs to be raised in the build settings. Distance fields work best with modular pieces rather than larger geometric pieces, if that is the case just break the mesh up into smaller pieces and rebuild the scene.

This page here can help you identify quality and troubleshooting these types of issues. Even though this is on the Distance Field Ambient Occlusion page, the method applies to Distance Field usage in general.

Q3/Image 3: Stationary Light BP

If the root of the BP is set to movable the light will be forced to be movable, but if for instance you have a BP and there is a root component and two other components, like a light and a static mesh. You can set the Light to be Stationary and the mesh to be static or movable without issue, but if the BP as a whole is movable based on the roots mobility it will determine what the other components should be set to.

So by your question if you set the BP to movable, the light will now be movable as well. If you want to use Stationary Lights these can cast shadows that are baked/precomputed and the quality will depend on the lightmap resolution of the mesh where the shadow is being cast.

Q4/Image 4: Direct Shadowing/Sky light shadow color

I cannot answer the question specifically about direct shadowing and opacity. I’m sure there is some limitation here that I’m not really aware of and I’m not a rendering programmer, or even a programmer. The skylight can produce the soft ambient occlusion, but only for static and stationary. If you want it dynamically it would be best to set the Skylight to movable and if you have Generate Mesh Distance Fields enabled for your project this will use dynamic AO. You can use the viewmode Show > Visualize > Distance Field Ambient Occlusion to see it’s representation in your scene. You can also adjust the light color and Intensity to get the shadow color that you would like. The distance field ao page linked above covers this information as well along with quality and troubleshooting to get the best results.

Q5/Image 5: Unreal Lighting

Lighting can be an art in itself to get right and understanding all the things that can affect or go into setting something up takes a while to get a grasp on. :wink:

I hope this helps.

Tim

Hi Tim …

First of all I want to thank you for fast responding , which is so appreciated , and honestly I was hoping that is you are the one who will answer my questions due to your experiences and helping me and a lot of other people throw your answers before .

and I will use your method to reply…

1: light bleed

I know that there is a Cascaded Shadow adjustments for directional light but it was not enough to solve my bleeding cause as they said it has limits , and that is way I had to use ray traced shadow which is solved my problems outside but the picture that I put its link before 2016-01-05_1417 was showing bleeding from inside which is coming from point lights and as you said it has no Cascaded Shadow adjustments, and even if there is an option like so , I wonder if it will be effective , and that is why I turned my point light shadow to ray traced shadow too but then it gives me this problem 2016-01-05_1413 , and it will disappear when the shadow is not ray traced , so I’ am between two problems either bleeding lights or not accurate shadows.

2: Distance Field RayTraced Shadows

and here is my mesh distance field visualization http://screencast.com/t/IQAE4ZlGo5 wondering if it will help to show my problem http://screencast.com/t/l978vvX3 and this Link did not help me to identify quality and troubleshooting these types of issues although it was pretty useful .

3: Stationary Light BP

CLEAR

4: Direct Shadowing/Sky light shadow color

changing the light color and Intensity will not help me at all cause the the light color is already white and nothing is brighter than white and changing them will not only effect the shadow but the light too

I hope that you can help me more but I really thank you so so much :slight_smile:

If you’re using RayTraced Distance Field shadows, I think depending on the mesh construction that you should only need to increase the Distance Field Resolution in the Build Settings of the Static Mesh Editor.

When distance fields are generated they will generate a mesh that is representative of the graphics mesh which you view with Visualize > Mesh Distance Fields. This generated mesh will also not be 100% accurate, so for sharp edges on a box or wall it can produce rounded corners. The larger the mesh the more rounded the corners will be and will need to be increased.

As an example here is a simple mesh I made:

This is the mesh:

Default Distance Field Resolution of 1.0:

Distance Field Resolution of 5.0:

You can change the DF Resolution in the Static Mesh Editor under the LOD0 settings here:

As the Distance Field Resolution is increased this can produce better results. The main thing to keep in mind is that Distance Fields are meant for modular assets and not for large geometry so if you break the mesh into smaller pieces it can produce better results.

From your image from your original post, and even with the mesh distance field view it’s hard to tell exactly for sureabout the quality, but looking at the mesh in the front where you’ve got the door ways that is one continuous mesh and you can see the rounding in the corners, which can be an issue for shadowing if you didn’t have the door there to block light because this rounded mesh will be used for the shadowing which wouldn’t be accurate to what the grahics mesh looks like.

My friend Tim…

I cant thank you enough for helping me , and your advice was right indeed , it worked for me but to be honest not hundred percent but pretty good result ( at least I knew how to control it ) and that encourages me to go on with another question…

I’ll try to explain it accurately to have the right answer

here is my inside scene when my lights are off considering that I had a blueprint light with on/off switch controller

so the question is why is my ceramic so bright, if we know that if I turn it’s roughness and metal to 0 then it will be black as it should be when the lights are off

of course this brightness are coming from indirect lighting from my skylight cause if I turn my skylight to 0.05 I’ll have this…


but I don’t want to turn it off because I don’t want to have a black shadow as this picture

and it is not a solution to have a blueprint that turn this indirect lighting off when I turn my lights off cause when going outside or even if I look outside my room while my lights are off then I’ll see a black shadow .

How can I solve this problem ?! , please help , and thank you very very much :slight_smile:

Hi…

I don’t know should I put the new question in a new separate page ?

I wish to have an answer from Tim or anybody has an experience in lighting and shadows

thank you very much