Search Unity

Modify z-buffer in perpixel shader

Discussion in 'Shaders' started by NeonTanto, Sep 27, 2014.

  1. NeonTanto

    NeonTanto

    Joined:
    Jun 19, 2013
    Posts:
    156

    Hi all. I watch this video, and very impressed. This is awesome idea for parallax shaders, but i don't understand, how this works (how send custom depth info into depth buffer). Any ideas?
     
    Last edited: Sep 27, 2014
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's just a shader that writes depth at it's simplest. Pretty much what resident evil used to do. If you have static backgrounds that need to be interacted with, it can be useful.

    You however need to save the depth information somehow from your 3D modelling package or from a high resolution scene.
     
  4. NeonTanto

    NeonTanto

    Joined:
    Jun 19, 2013
    Posts:
    156
    Yes. I understand this. What i want to do:
    1) Calc all visual data in shader.
    2) Calc the depth offset based on textures.
    3) Send new depth into z-buffer.
    But I don't know how to implement the last point... and how it works on different pc operation systems.
     
    Last edited: Sep 27, 2014
  5. aanimaaya

    aanimaaya

    Joined:
    Feb 11, 2021
    Posts:
    2
    Hi, sorry , i know this is a super old thread, but did you find a good solution for this ?
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Please don't necro literally decade old threads. Make a new post that links back to this one to ask your question.
     
    aanimaaya likes this.