forked from LukasBanana/LLGL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.450core.vert
More file actions
37 lines (31 loc) · 865 Bytes
/
Example.450core.vert
File metadata and controls
37 lines (31 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// GLSL Vertex Shader "VScene"
// Generated by XShaderCompiler
// 19/08/2019 20:23:04
#version 450 core
layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 0) out vec4 xsv_NDC0;
layout(location = 1) out vec4 xsv_WORLDPOS0;
layout(location = 2) out vec4 xsv_MODELPOS0;
layout(location = 3) out vec4 xsv_NORMAL0;
layout(std140, row_major, binding = 1) uniform Settings
{
mat4 wMatrix;
mat4 wMatrixInv;
mat4 vpMatrix;
mat4 vpMatrixInv;
vec3 lightDir;
float shininess;
vec3 viewPos;
float threshold;
vec3 albedo;
float reflectance;
};
void main()
{
xsv_MODELPOS0 = vec4(position, 1);
xsv_WORLDPOS0 = (xsv_MODELPOS0 * wMatrix);
gl_Position = (xsv_WORLDPOS0 * vpMatrix);
xsv_NDC0 = gl_Position / gl_Position.w;
xsv_NORMAL0 = (vec4(normal, 0) * wMatrix);
}