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
  4. Dismiss Notice

How to make a sphere with low transparency in the middle and higher transparency toward the edge?

Discussion in 'General Discussion' started by Henborte, Oct 1, 2020.

  1. Henborte

    Henborte

    Joined:
    Sep 12, 2020
    Posts:
    4
    upload_2020-10-1_23-23-59.png
    like this
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,325
    With shaders. Assign something like dot product between surface normal and vecotr towards camera to alpha channel.
     
  3. Henborte

    Henborte

    Joined:
    Sep 12, 2020
    Posts:
    4
    Obviously it can be successful, thank you.
     
  4. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    You could also fake it. A billboard should be indistinguishable from a real model.
     
    Ryiah and adamgolden like this.
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    The keywords that might help is Fresnel or ndotv also known as don't aka like neg said a dot product between view and normal

    Also the billboard can be done with texture but if you need 3d intersection and infinite resolution, bypass the texture and compute a ray intersection with a specs, extract normal and relative position, compare with depth buffer, use the screen aligned composant of the normal to extract Fresnel values without the dot.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,582
  7. Henborte

    Henborte

    Joined:
    Sep 12, 2020
    Posts:
    4
    Do you mean to make a picture rotate with the camera?
     
  8. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,497
    Yes - always faces the camera. Usually done by shader.
     
  9. Henborte

    Henborte

    Joined:
    Sep 12, 2020
    Posts:
    4
    I used the pow function to modify the gradient curve and got an approximate effect.
    What you said is so thorough and I learned a lot,
    thank you
     
    angrypenguin likes this.