reduced shader bind code dupe & adjust skate uprighter strenght
[carveJwlIkooP6JGAAIwe30JlM.git] / depth_compare.h
diff --git a/depth_compare.h b/depth_compare.h
new file mode 100644 (file)
index 0000000..8b64586
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef DEPTH_COMPARE_H
+#define DEPTH_COMPARE_H
+
+#include "vg/vg_m.h"
+#include "render.h"
+
+static void depth_compare_bind( 
+      void (*uTexSceneDepth)(int),
+      void (*uInverseRatioDepth)(v3f),
+      void (*uInverseRatioMain)(v3f),
+      camera *cam ){
+   uTexSceneDepth( 5 );
+   render_fb_bind_texture( gpipeline.fb_main, 2, 5 );
+   v3f inverse;
+   render_fb_inverse_ratio( gpipeline.fb_main, inverse );
+   inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
+
+   uInverseRatioDepth( inverse );
+   render_fb_inverse_ratio( NULL, inverse );
+   inverse[2] = cam->farz-cam->nearz;
+   uInverseRatioMain( inverse );
+}
+
+#endif /* DEPTH_COMPARE_H */