diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2019-04-24 04:17:16 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2019-04-24 04:17:16 +0200 |
| commit | 2d2e2ff4038db052d0186645f5afe4ec9daf2505 (patch) | |
| tree | d8491d9921381ec5d4149fdc014b72e375199dab /samples/Pbr/shaders/pbrtest.vert | |
| parent | 25fc1c7019142137dc67e4fad0c3088d845ab0a8 (diff) | |
use boolean for tex0 and tex1 availability tests
Diffstat (limited to 'samples/Pbr/shaders/pbrtest.vert')
| -rw-r--r-- | samples/Pbr/shaders/pbrtest.vert | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/samples/Pbr/shaders/pbrtest.vert b/samples/Pbr/shaders/pbrtest.vert deleted file mode 100644 index 25907bb..0000000 --- a/samples/Pbr/shaders/pbrtest.vert +++ /dev/null @@ -1,49 +0,0 @@ -#version 450 - -#extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_420pack : enable - -layout (location = 0) in vec3 inPos; -layout (location = 1) in vec3 inNormal; -layout (location = 2) in vec2 inUV; - -layout (binding = 0) uniform UBO -{ - mat4 projectionMatrix; - mat4 viewMatrix; - mat4 modelMatrix; - vec4 lightPos; - float gamma; - float exposure; -} ubo; - -layout (location = 0) out vec2 outUV; -layout (location = 1) out vec3 outN; -layout (location = 2) out vec3 outV;//ViewDir -layout (location = 3) out vec3 outWorldPos; - -out gl_PerVertex -{ - vec4 gl_Position; -}; - -layout(push_constant) uniform PushConsts { - mat4 model; -} pc; - -void main() -{ - outUV = inUV; - - mat4 mod = ubo.modelMatrix * pc.model; - vec4 pos = mod * vec4(inPos.xyz, 1.0); - - outN = normalize(transpose(inverse(mat3(mod))) * inNormal); - //outN = normalize(mat3(mod)* inNormal); - - mat4 viewInv = inverse(ubo.viewMatrix); - //outV = -(ubo.viewMatrix * pos).xyz; - outV = normalize(vec3(viewInv * vec4(0.0, 0.0, 0.0, 1.0) - pos)); - outWorldPos = pos.xyz; - gl_Position = ubo.projectionMatrix * ubo.viewMatrix * pos; -} |