I am struggling to extract pixel values from either a Depth Texture or, preferably, an Edge Detection Post Effect material (like found in the Depth Materials template, Edge Detection Example, edge_detection material).
I can get the RGBA value from a regular texture, like a Device Camera Texture like:
// @input Asset.Texture deviceCameraTexture
var procTex = ProceduralTextureProvider.createFromTexture(script.deviceCameraTexture)
var data = new Uint8Array(4)
var x = 100
var y = 100
procTex.control.getPixels(x, y, 1, 1, data)
print(data + ", " + data + ", " + data + ", " + data)
Ideally, I would like to know: at a screen coordinate, is it an edge or not? I cannot find which object holds post effect pixel values.
I would also like to know how to get an RGBA or depth value from a Depth Texture. If I use the getPixels approach above with a Depth Texture, all pixel results are [255, 0, 0, 255]. Any ideas?