playMaker

Author Topic: Depth buffer render to texture  (Read 224 times)

uk_resistant

  • Playmaker Newbie
  • *
  • Posts: 10
Depth buffer render to texture
« on: June 26, 2022, 01:52:31 PM »
Hello,

I am trying to render the depth buffer to a texture so I can use it for various post-process effects in Amplify shader.

My research suggests the functionality exists with Unity via script so I'm hoping it's easy to port to playmaker.


is this possible?


Thanks

Jamie D


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6957
    • jinxtergames
Re: Depth buffer render to texture
« Reply #1 on: June 26, 2022, 09:10:30 PM »
Hi.
Do you have some reference

uk_resistant

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Depth buffer render to texture
« Reply #2 on: June 27, 2022, 06:38:15 AM »
I can try although it's more of an educated guess at this point.


So..... This is how the texture would eventually look



(Basically a texture which shows depth on the z-axis)

Below are (what I think ) relevant Unity manual pages

https://docs.unity3d.com/ScriptReference/RenderTexture-depthBuffer.html

https://docs.unity3d.com/ScriptReference/Graphics.SetRenderTarget.html

https://docs.unity3d.com/ScriptReference/RenderBuffer.html

https://docs.unity3d.com/ScriptReference/RenderTexture-depth.html


This article is probably relevnat too

https://www.ronja-tutorials.com/post/017-postprocessing-depth/


I hope this helps?
Let me know if you need any more information and I'll do my best


Thanks!