QUESTION Strange shadows / lighting on my track and other objects

Discussion in 'Tracks' started by RzLWhizzy, Jun 15, 2020.

  1. RzLWhizzy

    RzLWhizzy New Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    1
    When adding in extra objects into my track (e.g. walls, sponsors, etc.), I noticed some extremely exaggerated dark areas due to the lighting of the scene. This occurs both in KSeditor and in AC, however not in Blender. I have tried to adjust multiple illuminations and lighting settings but not one setting which I have found 'gets rid' of these dark patches. Examples are shown below.

    upload_2020-6-15_14-51-30.png

    upload_2020-6-15_14-52-38.png

    upload_2020-6-15_14-59-2.png

    upload_2020-6-15_15-1-10.png

    upload_2020-6-15_15-1-27.png

    Any suggestions would be appreciated as I don't really know why this is happening. I am currently using CSP (v. 0.1.46) as well as Sol
     
  2. RzLWhizzy

    RzLWhizzy New Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    1
    Don't worry, just solved the issue. Was to do with the 'ksAmbient' setting, which was one of the settings which I didn't pay attention to. Basically the ksAmbient setting shouldn't be zero, instead it needs to ideally be between 0.1 < x < 1 which works for me.

    upload_2020-6-16_12-54-39.png

    upload_2020-6-16_12-51-47.png

    Thanks for the help though :)
     
    luchian likes this.
  3. xXxKOKExXx

    xXxKOKExXx Member

    Joined:
    Dec 25, 2019
    Messages:
    56
    Likes Received:
    51
    Ksambient and diffuse are very very very kmportant. One day i read this from lilsky: put the sun at noon or where the angle irradiate the higher light level -> adjust diffuse. put the sun very low, low ligth irradiation on the object -> adjust ksambient

    And finally touch specular if needed
     
  4. GRLap

    GRLap Member

    Joined:
    Mar 15, 2021
    Messages:
    97
    Likes Received:
    1
    I have a similar problem with dark/black shadows on objects; see marshals and garbage cans from opposite angles in images.
    I've tried adjusting ambient and diffuse, turning off cast shadows, etc., nothing fixes it. Any help available is appreciated. 1.jpg 2.jpg ?
     
  5. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    How frustrating that you're left tuning arbitrary variables.

    Ambient 1, diffuse 0, specular 0, shininess 0, would mean a completely rough material
    \/\/\/\/\/\/\/\/\/\/
    Ambient 0.5, diffuse 0.5, specular 0.5, shininess (half), would be a half glossy/rough material
    \/\/\/\/\/\/\/\/\/\/
    Ambient 0, diffuse 1, specular 1, shininess (max) would mean a completely glossy material


    I'm not sure if KS did any work to conserve energy and balance them internally, but that is what the principle is for a 'basic' material.
    Also adding a reflection map/layer messes things up even more, because that contains the specular element in it (sun), the diffuse element (sun), and the ambient element (everything else) already.



    Is there any wonder that a decade ago people were all running to PBR rendering and never turned back for photo-real type rendering needs?
     
  6. Fuzo

    Fuzo Member

    Joined:
    May 24, 2018
    Messages:
    101
    Likes Received:
    18
    Location:
    Bydgoszcz, Poland
    This is what I was thinking about for a long time, basically 99% of modders are just copying Kunos values from other tracks/cars but they don't know what each value actually does. To be honest I was doing it as well, but I put some effort to actually learn what those shader values should do or what do they mean so I have a little better idea now. But information I found were very general and I still need to rely on my eyes. But I bet there are some formulas or tables how to get specific shader values, I think we shouldn't do it just "by eye", right? After those years, did someone do some tutorial for kunos shaders?
     
  7. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    I'm fairly sure that is the fundamental logic at play.

    The problem is in reality, most materials are defined massively by their glossiness/roughness, and yet the nature of these older systems is that glossiness/roughness is hard-set across an entire material, by those variables noted above.
    So your entire texture sheet is hard-set to a specific 'look'
    We just try to fudge the effect of no gloss control by scaling specular with a specular map instead, which will give an unreal appearance, because it kills off specular entirely, rather than smudging it out over a larger area, or tightening it up in glossier areas, and is a good chunk of the reason why stuff looks fake and finding good settings is so hard.



    You can 'do it by eye', but the problem is as the time of day varies and the sun in the sky moves lower, things like ambient/diffuse/specular balance might look worse, so you tweak for that time... but then in midday sun, it looks wrong, so you tweak it back.
    There is genuinely no right or wrong way. The method is just unreal, so chasing realism is a circular problem. You'll just have to pick a good compromise and run with it.




    But yes, the above principle is grounded in how real materials work, so consider that as your starting point.

    - Roughly how 'glossy' is your texture sheet. Use that to define the diffuse/ambient/specular/shininess settings.

    - Use a specular map to tweak stuff up and down a bit, to fake the variance.

    - If the ranges of gloss are huge, then consider splitting materials. Ie, a building with glass windows. With PBR you'd just have a single shader to do the matte concrete, metal supports, and reflective windows... with ACs system ideally you need two or three shaders to get the same quality look.

    - Then tweak values within 10-20% perhaps... but go too far out and you'll get unreal looking materials.




    Ooooor, hopefully, someone will write some decent PBR shaders for AC... a job KS should have done in the pre-release days but didn't.
    This stuff is so well documented there really isn't too much of a reason it couldn't be done easily and quickly by someone at a moderate level.

    Ie, in Free Racer, Ruud (the creator) had written in some core elements (similar to what KS has in AC), but then just one or two people (Stereo one of them iirc) wrote in the PBR materials side of things using the widely available references and some fudges (for the blurred env map), and they did this in a few days of their free time.

    It really shouldn't be a big issue unless KS did a poor job initially, which I'd be very surprised by as they don't seem incompetent.
     
  8. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    seems like in AC values are at 1/3 of that and all other things done by CSP are oriented on that.

    using ksPerPixelMultiMap or ksPerPixelMultiMap_NMDetail gives you plenty of options to make the thing detailed
    list of car materials: https://ascobash.wordpress.com/2015/09/10/kunos-materials/
    list of all bare params, might be outdated: https://site.hagn.io/assettocorsa/modding/shader-values-template
    https://ascobash.wordpress.com/2015/12/17/about-alpha-channel/
    https://ascobash.wordpress.com/2015/10/04/some-suggestions-about-models-and-other-things-part-1/
    https://ascobash.wordpress.com/2015/10/06/some-suggestions-about-models-and-other-things-part-2/
    https://ascobash.wordpress.com/2015/12/29/some-suggestions-about-models-and-other-things-part-3/

    upload_2022-2-11_14-1-53.png
    upload_2022-2-11_14-14-2.png
     
    Last edited: Feb 11, 2022
  9. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    maybe normals are wrong? in Blender i would try this in edit mode for all those objects:
    ALT+N -> Normals -> "Set from faces"
    ALT+N -> Normals -> Average -> "Face area"
    and this in object mode:
    W -> Object -> "Shade smooth"

    edit: oh your problem was that old :)
    edit2: nice blender addon: https://github.com/fedackb/yavne/
     
    Last edited: Nov 17, 2022
  10. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    As noted, reflection map materials are all broken because the env map contains light… so cars would appear to glow if you had too high ambient and diffuse.

    Ie, the fresnel application of the reflection map over the base coat would be additive, but in reality the energy that is reflected off the lacquer isn't passed through to the base coat to then be 'diffused'


    Also for the asphalt types, they're playing with 'specular' multiplying, which is not photo-real any way. Specular is always 1, and it's either very soft and spread out (essentially the diffuse term), or it's very tight and bright (essentially the specular term)
    But really specular and diffuse are the sun's influence on a material. Imagine the sky is black and we just have the sun... we have no ambient, and we have no reflection map.
    You just have the spot on the material, it's essentially one and the same thing, specular >> diffuse. Shiny >> rough.


    As noted, it all just falls apart when you approach any kind of realistic rendering because diffuse and ambient and specular and the reflection of things are all just one and the same process.

    They're not individual discrete properties that we should tweak, they're all the same.


    But ultimately, my guide values are for standard shaders. Ie, no reflection map, no specular modification (like road grain)... so for track-side props as per the example the Whizzy posted.


    Indeed, now I've confused myself again.

    If we do indeed imagine a black space, with just a single point light (the sun in outer space), and a simple material like a plastic.
    You have 0 ambient light. You have no environment reflection to speak of.
    So as you ramp from completely diffuse/matte (diffuse 1) to completely glossy (specular 1, shininess max), you find the relationship.

    Diffuse 0, specular 1, shininess (max)
    \/\/\/\/\/
    Diffuse 0.5, specular 0.5, shininess (half)
    \/\/\/\/\/
    Diffuse 1, specular 0, shininess 0


    But as noted, the key part here is energy conservation, because specular and shininess are tied together. Ie, as we drop shininess we should also drop specular value, and there is a physical property/coefficient that drives that, and if it's *not* implemented at a core part of the AC renderer, then you'd have to calculate it ideally, to know the ramp of specular as shininess is altered.
    Or maybe it's automatic? I'm not an expert on KSs system. Nor would I want to be because it's clearly in need of being retired for something better.
    In any case, as one goes up, the other goes down.

    In theory you then have the environment reflection, which is "ambient", ie, how much the sky lights the item up.
    Ambient will be constant then in theory, and just ramp from 1 for a matte material, to 0 for a glossy material, and the 'reflection map' would ramp from 0 for a matte material, to 1 for a glossy material.
    Though in practice you really just have the reflection map go from very blurry to very sharp.


    Without knowing how AC works it's hard to say, but these are the fundamentals of this type of rendering engine and how to approximate it to what's really going on in real life (ie, realistic look)


    Iirc, that mod someone has written goes towards making these changes doesn't it? I've seen track reflections when it's wet etc...?
    If you have a static reflection map on the track, then you can blur it, and if you can do that, then you can do PBR rendering... so having a PBR shading set for AC can't be that far away?



     
  11. Mitch9

    Mitch9 Member

    Joined:
    May 2, 2021
    Messages:
    35
    Likes Received:
    9
    Interesting read but I bet that has nothing to do with GRlap´s issue, looks more like he needs to define some sharp edges
     
  12. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    I dunno, looks like ambient and diffuse are pumped so the props are just ‘glowing’

    But on Whizzy’s original posts, yeah that looks like normals are rounded over the walls and making the lighting all weird looking.
     
  13. Christoph Leipold

    Christoph Leipold New Member

    Joined:
    Oct 17, 2020
    Messages:
    20
    Likes Received:
    1
    I have a similar problem on the new road surface that I put into the existing track model.
    Now there are these strange shadows.
    strasse-schatten.jpg
    It looks like the reflection is "switched" from left to right as I shift the "zenith".
    I can redmove them only by setting the "diffuse" to "0" , keeping only "ambient".
    strasse-schatten1.jpg
    But then the lighting is "gone".
    I cannot find any problems with "normals" in Blender though: strasse-schatten-blender.jpg


    I had no problem with the same textures at a different track.

    Any thoughts about that?
    I would be really glad if there was a different solution than doing the whole track new from scratch as i already worked a lot of time on this one.
     
  14. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    upload_2022-2-22_14-8-24.png
    this param is 1 for that meterial in ksEditor?

    oh i see, no you dont have...:lol:
     
  15. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    make new normal map texture from your diffuse with this macro for photoshop:
    assettocorsa\sdk\dev\car_pipeline_2.0rev\Photoshop Action\Normal_MAP_Rotation.atn

    if you dont have photoshop....idk still make new nm map

    edit: not sure, but maybe dont use this shader:
    upload_2022-2-22_14-15-18.png

    use one that has a normal NM map slot, like mentioned here for the road:
    https://assettocorsamods.net/threads/photo-quality-road-surface.834/
     
  16. Christoph Leipold

    Christoph Leipold New Member

    Joined:
    Oct 17, 2020
    Messages:
    20
    Likes Received:
    1
    I found the solution here:
    https://assettocorsamods.net/thread...itor-but-smooth-in-original-3d-programe.2094/

    It is the "SCALE" problem! I always step into this trap again and again!
    Do a "ctrl-A/scale" in Blender before exporting to FBX and everything is OK :banghead::banghead::banghead:
    schatten3.jpg

    I hope that I will remember this one forever! :rolleyes:
     
    fughettaboutit likes this.
  17. Christoph Leipold

    Christoph Leipold New Member

    Joined:
    Oct 17, 2020
    Messages:
    20
    Likes Received:
    1
    As this mistake (not applying "SCALE" to your model) seems so common - and can be solved with so little efford, I would suggest to put this as a solution in first place of any reply to strange problems:

    1. DID YOU APPLY SCALE? :nerd:

    This might not be completely serious - but still with a grain of salt.

    Cheers! :)
     
  18. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    It has been documented on this thread for a few years now:
    https://assettocorsamods.net/threads/build-your-first-track-basic-guide.12/#post-18

    But the problem we constantly face is new modelers attempting something for the first time and not reading the tutorials, troubleshooting tips, advice, etc.

    Guess its easy to just ask instead of read.
     
  19. Christoph Leipold

    Christoph Leipold New Member

    Joined:
    Oct 17, 2020
    Messages:
    20
    Likes Received:
    1
    Problem for me was strange shadows on the road surface.
    Applying "SCALE" in Blender didn´t come to mind as a problem solver.
    And NOBODY - I really mean NOBODY - didn´t give this easy answer to my desperate question.
    (I was researching for 2 days now) - I stumbled on the thread more or less by chance.

    And also i could not find this graphics issue referenced in the basic guide - maybe you can show me.
    So I think it might be OK to point this one out expicidly - as I dont´seem to be the only problem child.
     
  20. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    You mentioned the problem you were having 4 hours ago. No one owes you an immediate answer.

    And no one would be able to point out your track is out scale... You would notice it really small in kseditor, like flying around it really fast.
     
    John Harding likes this.
: Shadows, Lighting
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice