Files
filament/shaders/src/post_process_getters.vs
Philip Rideout 8548afa231 Fix full-screen triangle winding and tex coords.
If you tried removing `culling: none` from any post-process materials,
everything would be fine in GL but Vulkan would be black because
our full-screen triangle was back-facing.

Continue reading only if you thrive in absurd situations.

- Metal and OpenGL define clip space as Y-up whereas Vulkan is Y-down.
- Metal and Vulkan define tex coords as Y-down whereas OpenGL is Y-up.
2019-09-16 09:04:14 -07:00

12 lines
228 B
GLSL

/** @public-api */
vec4 getPosition() {
vec4 pos = position;
// In Vulkan, clip space is Y-down. In OpenGL and Metal, clip space is Y-up.
#if defined(TARGET_VULKAN_ENVIRONMENT)
pos.y = -pos.y;
#endif
return pos;
}