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.
12 lines
228 B
GLSL
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;
|
|
}
|