Jump to content
Sign in to follow this  
LaughingJack

Lighting: Dynamic Lighting and Shadows > help needed please

Recommended Posts

Hi All,

Having Troubles with dynamic lighting:

Before peeps suggest or link to tutes or docs - i have watched and read extensively (like, most of last weekend) as much as i could find related to this.

 

One thing i did discover form my trawling is that UE's Dynamic Lighting is pretty rough and not very accurate (read: Crappy)

I also bcame quite confused after being informed that Squad's lighting is fully dynamic, yet most (non-Squad)"fixes" advise adding in Static lighting elements  as well as other Lighting "Helpers" - turning "Easy" Dynamic Lighting into a brain-melt.

 

extra info for the above link: my buildings using Corrugated-Iron-over-Frame for roofs and walls have a 5mm gap between the Frame and the Iron.

 

i have also asked in the Gen Disc thread about the possibility of the VXGI thing happening - looks lightyears ahead of UE's homebrand lighting.

 

one last thing: is it possible for the Dev(s) to post about their default setup and settings? i have tried to copy the Jensens lighting but i must be missing something still.

 

 

Cheers!

.LJ

Edited by LaughingJack

Share this post


Link to post
Share on other sites

@oxygencube.  Hi there and thanks for the reply.

 

" Here is a stream "   - was this meant to be a link?

 

Ive gone through the Guide (Dynamic Lighting part) two or threee times now, adjusting things as i go, getting most things sorted out - shadow gaps / light leaks, down to a minimum, but ive not been able to eliminate them and if i go too far to remove the artifacts i end up with a whole bunch of new shading issues.

I cannot get the ambient light right either - it seems too strong unless turned alomst off and the Ambient does not "follow" or change in relation to the "sun" light when its moved which is pretty lame really.

As ive stated i used Jensens Range as a guide and Fools Road as reference but both use very different setups for the lighting, which is very confusing and makes it nigh on impossible for me to try and understand what will work and when/where. Does this mean that every map needs to be lit individually and in different ways - thats crazy!

 

I am only having this issue (visibly, that ive noticed so far) with the "framed, iron roof" buildings. << everything

 

I really cannot understand why UE renders light through solid two-sided polys, period. <this is the crux of the problem, i think>

 

The ONLY way i can eliminate the leaks for this type of building is to lower the dynamic (sun) light to very low levels (virtually zero). - the Leakage is directly proportional to the Movable Dynamic Light(sun) intensity.

 

 

 

Cheers!

.LJ

Edited by LaughingJack

Share this post


Link to post
Share on other sites

@oxygencube,

 

I had a look at your vid, did a lot of fast-forwarding through the slow bits (coz time), other than that it looked like good info. Most of what you go over is what ive done already, like i say, ive used settings from Jensens' and tweaked them a bit, but within range of the settings you use, and i have issues. The only thing you do different is add the reflection mapping assets, which im not interestred in at this point and cannot see how they would possibly affect the issue im having.

 

i did come across some information that suggested that errors like this may benefit from re-building the lighting after removing all Static and LightMapUV stuffs to Purge any residual LM-UV info. You guys set up the editor to ignore static and LM-UV stuff by default, which is good, but i cannot re-build the lighting to purge any resident LM-UV's from the editor, as the option is inaccessible.

 

Therefore, IF  my issue is due to LM-UV interference from inadvertantly generating LM-UV's on import of my models, how can i now purge them?

 

If my issue is not residual LM-UV stuff then i need to find out which setting(s) will stop UE from rendering light through solid polys.

 

ps: ive not had a chance to go back and check through my map yet - hopefully tonight i will get a chance.

 

 

.LJ

Edited by LaughingJack

Share this post


Link to post
Share on other sites

@oxygencube,
 

i think i might have found some info regarding this lighting problem i have - the description fits the problem i have nearly exactly.

 

here> https://answers.unrealengine.com/questions/345034/bug-static-mesh-planes-and-landscape-do-not-proper.html

 

seems my initial thoughts may be correct that dynamic lighting is a bit broken in places.

 

Can you or any other of the Devs confirm this, please?

 

Cheers!

.LJ

Share this post


Link to post
Share on other sites

I've added my vote to this now.

 

First screenie showing objects being lit from under the landscape. To "fix" this i placed a light blocking plane underneath the terrain, now it only breaks when the light is at a low angle (Sun-Rise/-Set).

lighting through terrain_1

 

Second one shows how all the normals are being lit when the light is at certain angles below the terrain - this is even with the blocking plane in place.

lighting through terrain_3_normals lit

 

so it looks like the normals are being lit regardless of other polygons in between that should block the light.

 

will just have to wait for a fix.

 

meanwhile i'll get back the the six-wheeler i'm trying to get to work. ;)

 

Share this post


Link to post
Share on other sites

@oxygencube, hi there,

 

I have enabled "force no pre-computed lighting" in the world settings (finally found it). It still wants me to re-build the lighting to purge any residual lighting information.

 

How do i re-build within the Squad Editor?

EDIT: so ive given up on recomputing the light as nobody seems to be able to help me

Edited by LaughingJack

Share this post


Link to post
Share on other sites

Im posting this from phone so I cant remember the exact name, but under the object's lighting parameters there's a checkbox called Dynamic Insert Shadow. It makes more sharp and nicer shadows in exchange of performance and it does fix your problem. I dont know if you should use it and I would like to know what devs think about using it.

Share this post


Link to post
Share on other sites

Hey there, thanks for the reply  :)

 

I think i have already tried this , but i will check and make sure - see if it fixes the problem.

 

 

Cheers!

.LJ

Share this post


Link to post
Share on other sites

@IhanaMies @oxygencube: well i tried the Dynamic Inset thing - it actually made the light bleed worse in some areas and did nothing for the incorrectly lit framework inside the hanger.

 

yesterday i tried turning off the SkyLight by disabling "affect world", i turned of the skybox as well, so only the Directional Light was active.

i ended up with dense hard shadows as you would expect - in all buildings except the hanger. the hanger looked as though it had zero shadowing from the roof inside and the framework steel was clearly being lit, through the roof iron, by the Dir.Light.

 

so i'm still having trouble with the Roof, which is single thickness, two-sided polys set to "double-sided" in UE, allowing light to be rendered through.

 

 

cheers!

.LJ

Share this post


Link to post
Share on other sites
Posted (edited)

so, i've finally had time to dabble again and i've made something of a discovery:

{Edited}

i saw a video tute by a German guy that was vary helpful in getting the dynamic lighting to work properly. i had neglected a few things regarding the Distance Field and Ambient Occlusion stuffs. after i got this working - and subsequently broke it again (another story to tell) - i was still having the issue with light "leaking" through the roof iron, as seen in the above posts. the "roof iron" material is used on my Roof and Awning parts and is applied to Double-Sided polygons that represent those parts on some buildings i've made that represent iron-on-timber-frame type buildings, and also the shade awnings on the concrete buildings.

after messing around with, amongst others, the Ambient Occlusion (above), i decided to try finding the Visualisation for AO, to see it's effect more easily. i found it  { actually i found Render: Lighting Only - soz, my bad } and set it ON.

so, everything is rendered grey, showing the AO lighting, which is brilliant, but i realised that my Roofs and Awnings were now missing in the viewport >

 

Lighting_RENDER lighting only_missing roof and awnings_1

 

and with missing awnings from the foreground building as well >

 

Lighting_RENDER lighting only_missing roof and awnings_2

 

so. does anyone know what i'm doing wrong here?

this looks like the Parts, or, the Material, are being ignored by AO Lighting, for some reason.

 

Cheers for any help.

 

.LJ

 

PS: of course iv'e not had time to check back on the Light-through-the-Landscape yet - hopefully soon (hopefully my recent messing with the DF and AO stuff will fix it ;P ).

Edited by LaughingJack
edited

Share this post


Link to post
Share on other sites
Posted (edited)

Can you please show the material properties and object settings from details pannel which you're using for your roof?

 

About GI and stuff...

As far as I know OWI refused to use Distance Fields for now.

At least they are disabled it in project settings by default in current SDK version. 

 

VXGI is very heavy. I think they are heavier than Distance Fields (and DFAO, for example, divide my FPS by two). At least I don't know any games which are using nvidia's VXGI. Cryengine has "SEGI" which is voxel based GI technology as well, Kindomecome: Deliverance using this for their lighting and it looks fantastic. SEGI aslo very heavy, but I guess still usable unlike VXGI. Maybe later we will see a special processor for GI calculation which NVIDIA will start to built inside their video cards, who knows. We also got enlighten which, as I know, somehow making dynamic lightmaps on the fly. They even got a video with demonstration on UE4. You are familiar with enlighten - Frostbite using it, you saw it in Battlefield series staring from BF3.

But enlighten works only with companies which project budgets starts from 1 million dollars and you can't release their technoligy in your SDK - this mean no mod support.

Unity has native support of enlighten, but as far as I know there are some limited version of this.

 

There are no product-ready GI solitions in UE4 exept lightmass which is static (well they got LPVs, but this technology was never finished, I even not sure whether it can be used or not, something tells me that the answer is "no"). But static lighting will not work for Squad.

In the near future, you should not expect anything about global illumination in UE4. Cause Epics developing technology only for their needs, and they don't need realtime GI especially when they making VR-projects which requires a huge amount of resources only to render some basic graphics (cause we need giant resolutions for VR) :D

 

So if we want some good lighting we have to fake it. Fortunately there are some things that you could do, for example bake some indirect shadows for trees in vertex colors, 3ds max can do it. Also you can make materials which using their local space to make some gradients which can be used for lighting purposes. Here is the example:

pic.jpg

You can add fake lights to make indirect lighing (for example if you got a blue tent through which light passes you can add blue light there to simulate this effect, like on this screenshot (on the left) for example), but u should be aware that fake lights will make your scene pretty stationary this mean that you should do it only after you finish the geometry of your level. For caves and windows you could make post process planes which using Z-Buffer for lighting adjustments, so the insides looks darker from outside. And you could use post-process volumes to adjust the exposure, again to make the interior darker like they did in Whicher 3.

Edited by FishMan

Share this post


Link to post
Share on other sites

Hi @FishMan, thanks for the reply, and very interesting too ;)

 

below is a screenie of the Object - polys are(should be) Double-Sided within my modelling program before export -(one of a few, but if i get one right the rest should work too) (hope these are what you asked for.)

 

Roof Iron_Object

 

 

and the Material (Squad Material; i just renamed and scaled a bit).

 

Roof Iron_Material

 

i've turned off Distance Field thing in the Project settings.

 

And as i 've Edited above, i used the Render: Lighting Only = missing polys; the Render: Detail Lighting showed the parts fine, though. . . ?!

 

 

Cheers!

.LJ

 

Share this post


Link to post
Share on other sites

And here is what I've got on my side:

pic.jpg

 

Hm. Pretty strange. This is how it react on a tesselated material. BUT! If I switch back to lit mode - I still got the shadow, but in "Lighting Only" it disappear, I think it is some kind of bug.. or a feature may be :D  And this bug (or a feature) seems like was reported here.

 

Ok. So there is a material called "roof5" what was done by OWI, as far as I can see you took it as a base. First of all I don't understand why it's not parameterized to be a master material from which you can make an instances. I mean in that case you don't have to duplicate it to change tesselation factor for example, it should be a parameter, or may be I dont know something. Anyway.

 

Are you sure, that you need tesselation for this?

In my opinion for asset like this usual normal map will be enough.

Especially when you're using so small tesselation factor (or your mesh is pretty dence?). Just saying.

 

Uh.. let's start from other question have you got any problems in lit mode?

If it's not, if you still have your shadow, then just ignore this. It just how it reacts on a tesselated materials.

If it still disappear try to apply another material, if shadow will stop to disappear at least we will know that its not because of the mesh or its parameters.

Share this post


Link to post
Share on other sites
Posted (edited)

By the way this leaks should be at the top or they just looks pretty strange.

 

pic.jpg

 

There is a node called TexCoord in your matirial (the one on the top) which controls how often the leaks repeat.

I suggest you to change your UVs so they fill inside [0..1] coordinates (fit inside a texture sheet without any vertical tiling) at least for a doors, so that the leaks starts at the top and stops at the bottom without any tiling and then change the second (which is at the bottom) texcoord parameter to get a descent tiling for a painted metal thing. 

But if you ask me - I will just get rid of this leaks at all :D Or did another way so the material move it to the right postion automatically. Math from this example can be used for it.

 

Or!

The other (better) way (the one that OWI should do from the start). You can disable vertical tiling at all in the texture preferences (but don't forget to duplicate it before change something, cause it will be erased after any SDK updates). After that you have to rebuild the material. And don't forget that you should link the right texture in Texture Sample node after the duplicate.

 

pic.jpg

 

BUT! Be aware that, after that changes, leaks will only be visible on the polygons that placed in [0..1] coordinates (inside the texture sheet) or on the right and left from it.

You can even use this in your advantage for places where you don't need leaks at all. But be aware that it will still tile horizontally, so if you don't need any leaks just place your UV sheells at the top or at the bottom from [0..1] coordinates.

 

Also you can modify the material to add some parameters that will control the tiling and position of the leaks texture like this:

pic.jpg

 

I hope you will understand everything that I just said :D 

 

Also if you ask me - all this textures inside this material are just ****ing awful especially the tiling, not just because they looks bad, but because they are just not suppose to tile... But who I am to tell this? Im just quite stubborn ignorant siliy miserable bastad aka inadequate Russian troll aka random guy from Internet! OF COURSE I AM! :D 

Edited by FishMan

Share this post


Link to post
Share on other sites
18 hours ago, FishMan said:

Hm. Pretty strange. This is how it react on a tesselated material. BUT! If I switch back to lit mode - I still got the shadow, but in "Lighting Only" it disappear, I think it is some kind of bug.. or a feature may be :D  And this bug (or a feature) seems like was reported here.

good to know, thanks. that bug report is now nearly 2.5 years old and still nothing fixed - Soon(tm) seems to apply here!!

 

18 hours ago, FishMan said:

let's start from other question have you got any problems in lit mode?

Normal LIT mode render - standard view - is where i first noticed the issue, here >

JO_Asset_CI_Hanger1_light leaking_1

 

18 hours ago, FishMan said:

If it's not, if you still have your shadow, then just ignore this. It just how it reacts on a tesselated materials.

If it still disappear try to apply another material, if shadow will stop to disappear at least we will know that its not because of the mesh or its parameters.

will try these out. i agree, i dont think i actually need Tess. as Normals should be fine, so i will also remove any settings related to tesselation, and see what happens.

And, yes i've got some cleaning up to do with my texture palcements ;)

 

Cheers @FishMan, much appreciated.

 

.LJ

Share this post


Link to post
Share on other sites

Oh, you mean this leaks?

pic.jpg

 

Well I think that you could just ignore this, cause they are really tiny.

I guess it's just how cascaded shadow maps works, they are not very accurate, but still no one has come up with anything better.

In my opinion it's not a big deal.

 

But you could try messing up with mesh thickness and shadowmap settings, cause I'm pretty sure that this is because this parts are just pretty small and touching (or penetrating) the roof mesh. Also that you could try is combine this model to one, cause I've noticed that you divided it to two parts for some reason, combining them might help as well.

 

Here some reading about the lighting issues. The part which you might be interested starting from Dynamic (Movable) Lighting, but I'm suggesting you to read the whole article, it really interesting.

 

5 hours ago, LaughingJack said:

i will also remove any settings related to tesselation

 

Yeah, you can do it here in case someone doesn't know that.

 

Also if your mesh has thickness you can disable "two sided" as well, cause you only need them when your model has no thickess like planes for tree leafs for example, cause this make your material a little bit more expensive.

Share this post


Link to post
Share on other sites
16 minutes ago, FishMan said:

Here some reading about the lighting issues. The part which you might be interested starting from Dynamic (Movable) Lighting, but I'm suggesting you to read the whole article, it really interesting.

 

 

He's right, it was a fantastic read. Thanks for the share!

Share this post


Link to post
Share on other sites

You're welcome.

Here some information about cascaded shadow maps as well in case someone need some technical information. I presume it was not written for artists, but for a programmers, so it might be hard to understand in some parts. But fortunately you really don't need a deep understanding of it to use it efficiently.

Share this post


Link to post
Share on other sites
Posted (edited)
14 hours ago, FishMan said:

Well I think that you could just ignore this, cause they are really tiny.

I guess it's just how cascaded shadow maps works, they are not very accurate, but still no one has come up with anything better.

In my opinion it's not a big deal

i guess you're right from a playing POV - just looks terrible in the editor - yeah the CSM stuff is pretty average.

 

14 hours ago, FishMan said:

Also that you could try is combine this model to one, cause I've noticed that you divided it to two parts for some reason, combining them might help as well.

it was all one piece but i had troubles and various things convinced me i had to split the models' roof off to a seperate object - of course that did nothing in the end so i will most likely go back to a single piece model.

 

i will read that article you have linked to ;)

 

 

Edited by LaughingJack

Share this post


Link to post
Share on other sites

so, that article is the Troubleshooting Guide. been there quite a few times already - coz CSM stuff. most things in the Dynamic Lighting section i've already tried, cheers tho ;)

 

so i've decided that i'm just going to ignore UE4's problems from this point forward, accept it and concerntrate on making stuff and getting stuck into doing my Mod instead.

 

Cheers again, fellas :)

 

.LJ

Share this post


Link to post
Share on other sites
Sign in to follow this  

×