Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Flat Lighting (FL)

Discussion in 'Assets and Asset Store' started by BogdanGochev, Jul 29, 2016.

  1. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    Thank you gamezuk, I have just fixed the issue and will publish the new version. Which have a couple of more fixes.
    If you need a patch before the version is released send me a message/email.
     
  2. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    76
    Hi planning to switch to LWR pipeline. Do the flat light surface shaders support LWR ? TY
     
  3. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    Hi, the main shader of Flat Lighting do support LWR.
    The ones that use Unity Surface currently don't work. But the point of LWR is to be more performant and the main flat lighting shaders are more performant that the Unity surfaces.
    That being said, I'm still looking into LWR and in the future I might release a special version of the Unity Surface shaders adapted to LWR as well.
     
    Last edited: Jun 15, 2019
  4. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    76
    Cool. I just want to use unity's shadows with your shaders hence I want to use surface shaders. If you can make an option to enable unity shadows on main shader of Flat Lighting...that would be awesome. Thanks.
     
  5. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    49
    Last edited: Jul 9, 2019
  6. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    That seems quite interesting. I didn't know about Material Property Block, so will explore that idea a bit and definitely add it. I will pm for some details
     
  7. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    49
    Great, thanks! Sure, happy to help however I can :)
     
  8. nathansisler

    nathansisler

    Joined:
    Sep 21, 2013
    Posts:
    4
    I have a problem on Galaxy Note 10. Looks like the transparent areas in water will render as white using the water shader. I think you mentioned this, have you found any solutions?
     
  9. nathansisler

    nathansisler

    Joined:
    Sep 21, 2013
    Posts:
    4
    I did some more testing and it turns out it's not the but actually the use of the (use symmetrical Colors) variable.
     
  10. PolyCurseGames

    PolyCurseGames

    Joined:
    Jan 25, 2018
    Posts:
    48
    @BogdanGochev Is this asset still being developed or is it at its end of life? Seems it hasn't had any updates in almost a year, and not much forum traffic either.
     
  11. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    Hi, I have just responded to your email but will paste the response here as well for future references :

    Flat Lighting asset is not being actively developed as it's feature complete. That being said, bug fixes and features request that are relevant to the asset are still being developed and released. The asset as it is already has a lot of features (I can argue that probably has the most features from all the competitors) and I don't want to put too many half baked features on it. I prefer for it to do fewer things but really do them well.
     
    PolyCurseGames and firstuser like this.
  12. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    49
    @PolyCurseGames Bogdan has been AMAZING with both uber-responsive support and adding new features. It's not his fault it's been stable for so long now! :) (use it in production on multiple games)

    Seriously don't hesitate to buy it.
     
    Last edited: Feb 11, 2020
    BogdanGochev and PolyCurseGames like this.
  13. PolyCurseGames

    PolyCurseGames

    Joined:
    Jan 25, 2018
    Posts:
    48
    firstuser likes this.
  14. PolyCurseGames

    PolyCurseGames

    Joined:
    Jan 25, 2018
    Posts:
    48
    So, is there a way to increase the limit of 25 lights per scene?
     
  15. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    The limit is hardcoded for performance reasons. I can look into making it dynamically configured, but in the mean time if you tell me what type of light source you want to increase and to what number I can send you a patch.
     
  16. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    Hi! I am auto-generating meshes as shown in this video:

    I have a problem though, the colors are "smoothed out" instead of staying flat! :eek:
    In the first picture, the ball in the middles has the exact same material applied and is approximately as low poly as the terrain.
    For some reason, the terrain IS able to work with Flatlighting/Animated/Water, but this shader does not support world space :(
    The second picture shows the terrain with the water shader applied.

    Any ideas?

    Capture.PNG Capture.PNG
     
  17. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    Sorry about the giant pictures, I should have used snippets :oops:
     
  18. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    49
    @oliv2079 are you sure that you assigned normals correctly?
     
  19. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    No, I don't know! I'll try to look into that, thank you <3
    I just make the triangles and then just go Recalculatenormals(); and then thought that would work out, do you have an idea of how to fix the normals if those are the problem?
     
  20. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    I also have to build models in Probuilder. I can't for example use unity's own sphere
    Capture.PNG
    Then the smoothing happens again

    It's just weird how it works with the water, but not with the normal flattenedlight shader
     
  21. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    Here's the same with the water shader
    Capture.PNG
     
  22. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    49
    Honestly, without looking into it too deeply, this is very very likely a normals related issue on your mesh. The fact that it looks different with a water shader isn't surprising as shaders can do their own normals related logic.

    I think the water shader does it's own normal calculation because it is animating vertices, so that's why it loses the "smoothing" baked into the mesh.

    An easy way to test if your problem is normals related is for example on your current non-smooth probuilder sphere use a smoothing group that contains all the faces. That will make it look "smooth"

    And then take the unity sphere and probuilderize it, and remove all smoothing groups, you will now see it without any "smooth" blending.

    I can't comment on the recalc normals method as in the context of a procedurally generated mesh it can get a bit tricky.

    In any case good news is I don't think it's FL Lighting related at all (you would have this problem with nearly any shader) you just need to read up on normals and smoothing and how all that works more!
     
    BogdanGochev likes this.
  23. oliv2079

    oliv2079

    Joined:
    Jun 13, 2020
    Posts:
    6
    Dude(ette), thank you so much!
    I had the same problem with other shaders and I was sure that I was doing something wrong.
    I seriously need to look more into normals, they seem pretty important when working with shaders xD

    Again, thank you so much for the detailed response, you are awesome <3
     
    firstuser likes this.
  24. BogdanGochev

    BogdanGochev

    Joined:
    Sep 17, 2015
    Posts:
    63
    @firstuser very good explanation, I couldn't explain it better. Also you are very correct about the water shader, it does indeed calculate the normals in the shader.

    @oliv2079 as for the mesh creation and normals calculation, the FL asset is bundled with a utility class to create planes (intended for easier water effect creation). The file is called "FL/Scripts/Editor/CreatePlane.cs" you can check it for "inspiration" as it does create a flat mesh with correctly calculated normals for this asset.
     
    firstuser likes this.
unityunity