+2
Completed

Scene Depth and Dest Depth

zoltan erdokovy 11 years ago updated by Freya Holmér (Developer) 11 years ago 13
Would it be possible to have the functionality of those two UDK nodes?

Answer

Answer
Completed
Depth Bias and Scene Depth are now both implemented in Alpha 0.20!


A UV-sampleable version might come later, if people want it!
Answer
Completed
Depth Bias and Scene Depth are now both implemented in Alpha 0.20!


A UV-sampleable version might come later, if people want it!
Hmm Depth Bias works weirdly: 0.3 and indeed any positive number makes it pitch black. Around -2 I start to see some grays if the camera is close enough (stock cube, unlit shader, Depth Bias is on emission):Scene Depth produces a (15, 15, 15) dark gray until I move the camera really far away when it suddenly becomes full white.
I'm on Unity free so I couldn't test this on deferred rendering path.
1. Is your camera rendering a depth texture?
2. Have you made sure the shader isn't writing to the depth buffer?
I have a custom component on the main camera which has
camera.depthTextureMode = DepthTextureMode.Depth;
in both Start() and OnEnable(). (Also tried the DepthNormal setting.)
Blending&Depth, Alpha blended, "AutoSort" unchecked, "Write to Depth buffer" unchecked.
You need to look through the in-game camera as well, the editor camera won't use those settings
o_O Nothing changes even when I set "DepthTextureMode.None".

Have you pressed play, and is looking through the in-game camera?
Yes, I am looking through the ingame camera. The only difference between the editor and ingame cameras seems to be that in editor view the background is covered up by the test box.
I'm beginning to suspect this is a Unity Pro only thing
You are probably right, I found a shader using depth to highlight intersections, doesn't look as expected.
Are you able to test the trial version of Unity Pro?
Not anymore. However a friend on pro tried your example and it works fine.
This is a pro feature since it uses depth textures u.u