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

Help with Glass rendering

Discussion in 'High Definition Render Pipeline' started by Acer85, Mar 14, 2022.

  1. Acer85

    Acer85

    Joined:
    Mar 10, 2019
    Posts:
    30
    How can I setup the glass material to render the back of the glass? The material is made of one texture (glass and rope in the same). Should I make a seperate material for the rope and for the inside of the glass? or is there a setting I missed?

    Had been really good to have like a short video in the documentation that explained this. Feels like this is a common question but I cant find the correct answer.
     

    Attached Files:

  2. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
    I would separate out the glass geometry, disable cast shadows on it and enable doublesided on the material...
     
    Acer85 likes this.
  3. alixmic

    alixmic

    Unity Technologies

    Joined:
    Apr 14, 2020
    Posts:
    3
    Hello, so yes first I advise that you use a different shader for the ropes and for the glass, and use an opaque material for your ropes, this way, the ropes will be rendered before the transparent pass and you will have no problems to see them from the inside of your jar. For the glass, good idea to remove cast shadows if your glass will be very transparent.
    for the materials you can do something like this :
    upload_2022-3-17_19-3-59.png

    With your different texture as input if you have them. For texturing, making the border at the oppening of your jar a bit more opaque will help making that more visible. If you have sorting issue you can use "transparent depth prepass", but you will loose what's behind the first surface the camera will see.

    upload_2022-3-17_19-15-24.png


    What I like to do, and this is more of a workaround than anything, is to stack the same model twice, and having one that does refraction, and one that doesn't, this makes the inner details more visible. I'm on the artist side, this is me bending the rules a bit to achieve a better visual result. This will makes your model heavier on performance.


    upload_2022-3-17_19-18-14.png
     
    Yanus3D, olavrv, Acer85 and 2 others like this.