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

Question Spherical distortion effect in 2D

Discussion in 'Shader Graph' started by ph4ntomz, Nov 26, 2019.

  1. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Hi guys,

    I'm trying to create a spherical distortion effect for 2D textures. I've tried to play around with the spherize node, but it's basically doing the opposite of what I want.

    I want to take a texture with a pattern and make it look 3D by distorting it. How could I achieve this?

    Cheers!
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    You probably want a stereographic projection.
    upload_2019-11-26_14-39-18.png
     
    ryanslikesocool and ph4ntomz like this.
  3. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    That looks awesome, I'm going to try this out! I wish I was able to understand what you did, but I'm afraid that will take a lot more learning from me before that's going to happen!

    One question I have: The calculation you do at the bottom part, is it easier/cheaper to compute than using an Ellipsis-Node? I always used the procedural generated shapes as masks.
     
    Last edited: Nov 27, 2019
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    Not really, no. It’s probably identical to the Ellipses node.
     
    ph4ntomz likes this.