Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Hemisphere model with flipped normals, shader is too dark

Discussion in 'Shaders' started by oen432, Jan 9, 2019.

  1. oen432

    oen432

    Joined:
    Apr 24, 2015
    Posts:
    40
    Hi,

    I wanted to create magic barrier that is based on hemisphere and is hollow inside but barrier is still visible from the inside. So I made sphere in blender, cut in half, duplicated and then flipped normals. It works, barrier is visible from outside, effect is pretty cool (I like it), from inside you can see that shader is working but comparing to outside, it's barely visible. What is the issue?

    Images of Shader Graph - https://imgur.com/a/Z51UtLm
    Effect on video -
     
  2. Spike_Felion

    Spike_Felion

    Joined:
    Sep 12, 2016
    Posts:
    9
    Hello, If this doesn`t work I can make it and try to fix it.

    Do you have Two sided enabled under the master nodes settings
    upload_2019-1-9_10-48-52.png
     
    oen432 likes this.
  3. oen432

    oen432

    Joined:
    Apr 24, 2015
    Posts:
    40
    I had not set that, but when it's enabled then transparency is not working on inside.
     
  4. Spike_Felion

    Spike_Felion

    Joined:
    Sep 12, 2016
    Posts:
    9
    So after playing around with it, it is solid due to the fresnel effect into the alpha. I am not sure how we would fix this shader wise but what you can do is make a duplicate of the forcefield model and flip/invert the nomals. You then place this object as a child that is almost the same size, just very slightly smaller(there was z fighting issues when it was the same size)
    upload_2019-1-9_12-49-27.png

    (I used a cube in the mockup thats why it looks alittle weird. blender models are also twice as big as unity thats why I did .49 scale instead of .99)

    Inside of the shader turn of the two sided setting you turned on earlier and everything should be working assuming you unpacked the models uvs sometime in ur modeling software
     
  5. oen432

    oen432

    Joined:
    Apr 24, 2015
    Posts:
    40
    Same effect, it's not as visible as from outside.
    And just noticed that shader effect is different on the inside. While outside is being rendered from top of the sphere and that line is going around it, inside it's just on the left half of the sphere and not even starting from top.

    Another interesting thing discovered:
    Flipped normals, so what we see here is INSIDE of the sphere.


    This is without flipping, so it's OUTSIDE.
    It's like one half is rendering differently than the other. On the right side, white line is more visible.
     
    Last edited: Jan 9, 2019
  6. Spike_Felion

    Spike_Felion

    Joined:
    Sep 12, 2016
    Posts:
    9
    probably has something to due with the frensel effect but I dont have any more ideas as to why its more on one side then the other. Not sure if the fresnel effect maybe takes in to account the directional light.
     
    oen432 likes this.
  7. oen432

    oen432

    Joined:
    Apr 24, 2015
    Posts:
    40
    Oh wow, it does. It's based on light! But why? Or how can I achieve same effect without being affected by light?
    It's not only Fresnel Effect. Even that line is based on Directional Light rotation.
    Assigning Barrier object to layer and then removing that layer from Culling Mask on Directional Light doesn't change anything.
     
    Last edited: Jan 9, 2019
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    If you don't want lighting to affect your mesh, don't use the PBR Master node. Use the Unlit Master node.
     
    oen432 likes this.
  9. oen432

    oen432

    Joined:
    Apr 24, 2015
    Posts:
    40
    It worked! Had to do some changes but it works! Thanks!
     
  10. Spike_Felion

    Spike_Felion

    Joined:
    Sep 12, 2016
    Posts:
    9
    yay my idea i didnt test that it was because of the directional light was right and glad you got it working
     
    oen432 likes this.