Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: uk_resistant on June 26, 2022, 01:52:31 PM

Title: Depth buffer render to texture
Post by: uk_resistant 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

Title: Re: Depth buffer render to texture
Post by: djaydino on June 26, 2022, 09:10:30 PM
Hi.
Do you have some reference
Title: Re: Depth buffer render to texture
Post by: uk_resistant 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

(https://cdn.shortpixel.ai/client/q_glossy,ret_img,w_800,h_351/https://sketchupmadrid.com/wp-content/uploads/2018/10/z-depth-photoshop.jpg)

(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/RenderTexture-depthBuffer.html)

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

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

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


This article is probably relevnat too

https://www.ronja-tutorials.com/post/017-postprocessing-depth/ (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!