Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Unity 2DRenderer Heat Distortion shown in the Unity GDC Showcase 2021 not working

Discussion in '2D' started by Mokofr, Apr 3, 2021.

  1. Mokofr

    Mokofr

    Joined:
    Jul 23, 2013
    Posts:
    6
    Hey everybody!

    Has anybody else here tried out the Dragon Crashers Demo from the Asset Store? I wanted to check out the heat distortion they showcased with the smoke and lava around 24:12 in the video.

    For me there is nothing there and as far as I can see the shader on the smoke is also just making the texture wiggle but I can't find any camera distortion whatsoever. (On the screenshot you can see the skull and coins appearing very clear without any effect behind the fog)

    Could you guys get it to work? Would love to have this visual component in my game.
     

    Attached Files:

  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    42
    Hi @Drews13, the heat wave was just an example of what's possible in 2D in URP 11 and the Dragon Crashers project doesn't include that effect. If you want to try that feature yourself, you'll need to install Unity 2021.1f1 or higher and URP 11.0.

    Inside your project, when you create a new render pipeline asset with a 2D renderer, you'll be able to see the Camera Sorting Layer Texture section on your Renderer 2D Data asset in the Inspector:
    upload_2021-4-8_14-46-53.png
    This is where you can choose which layers to render, and whether or not apply downsampling.

    Now, you should be able to access that texture from Shader Graph:
    1. Inside the Shader Graph create a new Texture 2D property
    2. Set the Reference string to _CameraSortingLayerTexture
    3. Uncheck the Exposed checkbox
    upload_2021-4-8_14-45-1.png

    We don't have any samples of demos using that feature yet, but plan to create one in the future.
    I hope this helps! :)
     
    TheodorGal1977 likes this.
  3. Mokofr

    Mokofr

    Joined:
    Jul 23, 2013
    Posts:
    6
    Hey @MarekUnity thanks for your answer I think that should answer everything I wanted to know, I'm gonna try that out soon! :)

    And I am very much looking forward to your upcoming samples!
     
    MarekUnity likes this.
  4. Mokofr

    Mokofr

    Joined:
    Jul 23, 2013
    Posts:
    6
    Hey @MarekUnity !
    I set this up like you explained, now I am just struggling to get an actual Result :D

    upload_2021-5-23_21-27-39.png

    I put this _CameraSortingLaxerTexture on top of everything else, is this correct?


    Where do I put the actual effects now? I am trying to create a simple black and white effect that only makes specific areas of my game black and white.

    Do I have to create the effect in here?
    ->
    upload_2021-5-23_21-30-10.png

    Or somewhere else?

    Thank you in advance!
     
  5. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    136
    MarekUnity and Lo-renzo like this.
  6. Mokofr

    Mokofr

    Joined:
    Jul 23, 2013
    Posts:
    6
    Hey Rustum,

    thanks a lot, gonna check it out tonight! :)
     
  7. Mokofr

    Mokofr

    Joined:
    Jul 23, 2013
    Posts:
    6
    Thanks again, your samples work and look super cool! :)

    Now I have a very funny bug when I'm trying to establish this effect in my project:
    upload_2021-5-24_22-35-55.png

    For some reason the square sprite with the Heat Haze Material doesn't apply the effect to my gameworld but rather takes a snapshot from my tilepalette on the right or something and distorts it haha :D Very crazy. So far I couldn't find out I why this is happening - do you maybe know this bug and already know how to fix it? I want a fullscreen effect so much :)
     
  8. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,176
    I have already been mentioning this on the other threads, but camersortingtexture seems to be broken at the moment.

    For me, it outputs the normal buffer rendering result to that...

    @rustum , could you please confirm that the camerasortingtexture is indeed working?
     
unityunity