Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Backside of transparent plane looks strange

Discussion in 'General Graphics' started by Flopsidopsi, Jun 13, 2023.

  1. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    I painted some leaves in Gimp and created a tree in Blender. When I import the tree, apply the material for the leaves and set it to transparent and front and back the front side looks good but the backside looks strange and greyish as you can see in the picture below.
    I tried to use the tree creator instead and the leaves looked good but I wasnt able to set the origin of the leaves so it looked strange again...

    It would be nice if someone could explain me the issue with the transparancy or tell me how to set the origin of tree creator leaves.

    thanks in advance and sorry for bad english.

    Flopsidopsi
     

    Attached Files:

  2. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    763
    It just looks like specular shading to me. Remove the specular effect to see if that meets your expectations.
     
  3. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    there are a few tricks commonly used to make leaf cards look better:

    1. use subsurface scattering - evens out shading so you won't have a harsh difference on the "shadow" side of card. simulates light passing through and scattering within the volume of the object, with a specified color
    2. fade card when at a close angle aligned with camera look direction - helps hide cards when at angle which makes them obvious
    3. use a sphere primitive shape and transfer its normals to the leaf cards - this softens shading overall for a "fluffy" look

    the first two techniques you can learn from Ben Clowards youtube channel covering shaders. If he doesn't show these techniques in unity I am sure someone else does. Very common techniques.

    3 has tons of tutorials out there - it's a 5 second process, very easy to do, but you need to know how to transfer normals in whatever DCC you use. If you happen to use Maya that is done with "Transfer Attributes" tool.
     
    c0d3_m0nk3y and Flopsidopsi like this.
  4. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    The workflow mode is set to metallic if that's what you mean.
    I'm using the standard lit shader in urp.
     
  5. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    Thanks for the reply.
    I'm gonna check out the YouTube channel you mentioned but I don't quite get what you mean at point 3. Would be nice if you could explain it further or recommend me a tutorial which explains this further.
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,309
    This is a bug / oversight the default URP Lit shader has when set to show both sides. Both sides are treated as if it's facing the same direction, meaning it only responds to lighting from one side of the face (the one visible when set to "Render Face > Front"). This is especially a problem for specular lighting as there is math that assumes the camera can't see faces that point away from it. You can disable specular lighting under the advanced options, but that won't fix the fact some leaves are too bright and some are too dark.

    The only fix for this is to not use the Lit shader. Unity's HDRP Lit shader has options to handle this properly, and hopefully the URP team will implement some of those in the future, though they are entirely separate teams that don't communicate much.
     
    Flopsidopsi likes this.
  7. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    @Flopsidopsi

    here's a video showing how to adjust normals by transferring normals from a sphere to the cards

    maya:


    blender + unity:


    it's been a few years since I did this in unity but should be possible to get a pretty nice look. I was working in 5.6 at the time though, before new render pipelines, so not sure if anything has changed there.
     
    Flopsidopsi likes this.
  8. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    Thank you
     
  9. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    Thanks for the reply.

    Is there a good alternative for the lit Shader? Unlit works but I originally planned to add a day/night cycle later so I need some other shader...
     
  10. Flopsidopsi

    Flopsidopsi

    Joined:
    Jun 13, 2023
    Posts:
    6
    So I found out that if you turn the smoothness down it looks normal... So for anyone with the same problem this could be a fix.
     
    Srum likes this.
  11. Srum

    Srum

    Joined:
    Jul 14, 2023
    Posts:
    1
    Fixed it for me, ty
     
  12. Arithmetica

    Arithmetica

    Joined:
    Feb 11, 2019
    Posts:
    38
    I made a solution in ShaderGraph based on bgolus' comment.
    It just reverses the normals when the backside is displayed. flipnormal.jpg sceneview.jpg