SceneDepth.hx 444 B

1234567891011121314151617181920212223242526
  1. package hrt.shgraph.nodes;
  2. using hxsl.Ast;
  3. @name("Scene Depth")
  4. @description("Read depth behind current pixel")
  5. @group("Property")
  6. class SceneDepth extends ShaderNodeHxsl {
  7. static var SRC = {
  8. @sgoutput var output : Float;
  9. @global var depthMap : Channel;
  10. @global var camera : {
  11. var zNear : Float;
  12. var zFar : Float;
  13. };
  14. var screenUV : Vec2;
  15. function fragment() {
  16. output = depthMap.get(screenUV);
  17. }
  18. };
  19. }