0
Виконано

Accessing the depth Texture from shader forge

William Besnard 7 років тому оновлено Freya Holmér (Developer) 7 років тому 5

Hi!


Is it currently possible to access the depth texture created by unity (by activating depth texture writting on the camera) in shader forge? I would like to render the depth of the scene as a post effect, but when trying to use a texture named _CameraDepthTexture I do not get anything out. 



Відповідь

+1
Відповідь
Виконано

This has now been added to 1.38. The Scene Depth node now has a UV input, and there's now a pixel size node to aid in proper offsetting for all aspect ratios :)

Under review

Hey! There's no support for accessing the texture itself at the moment.

To get the depth at the current fragment being rendered, you can use the Scene Depth node, though this won't allow you to sample it at different UVs. I can look into adding this

This would be awesome :) Right now scene depth cannot work for post process, so I can't really get the depth of a pixel :/

It's looking pretty good on my end - this will likely make it into the next update

+1
Відповідь
Виконано

This has now been added to 1.38. The Scene Depth node now has a UV input, and there's now a pixel size node to aid in proper offsetting for all aspect ratios :)