Created
July 8, 2021 00:40
-
-
Save prideout/8fd1da05cb8eb0aca61565cf6da286fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 310 es | |
// glslc -std=310es -fshader-stage=vertex piecewise.glsl | |
// spirv-opt -Os a.spv -o b.spv | |
// spirv-cross b.spv | |
layout(binding = 0) uniform FrameUniforms { | |
mat4 clipFromWorldMatrix; | |
} frameUniforms; | |
layout(location = 0) in vec4 mesh_position; | |
void main() { | |
mat4 mat = frameUniforms.clipFromWorldMatrix; | |
mat4 rot; | |
rot[0][0] = mat[0][0]; | |
rot[0][1] = mat[0][1]; | |
rot[0][2] = mat[0][2]; | |
rot[0][3] = mat[0][3]; | |
rot[1][0] = mat[1][0]; | |
rot[1][1] = mat[1][1]; | |
rot[1][2] = mat[1][2]; | |
rot[1][3] = mat[1][3]; | |
rot[2][0] = mat[2][0]; | |
rot[2][1] = mat[2][1]; | |
rot[2][2] = mat[2][2]; | |
rot[2][3] = mat[2][3]; | |
rot[3][0] = mat[3][0]; | |
rot[3][1] = mat[3][1]; | |
rot[3][2] = mat[3][2]; | |
rot[3][3] = mat[3][3]; | |
gl_Position = rot * mesh_position; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment