Hongtae Kim hace 8 años
padre
commit
47004d721d
Se han modificado 61 ficheros con 327 adiciones y 87 borrados
  1. 20
    0
      Data/shaders/conditionalrender/model.frag
  2. BIN
      Data/shaders/conditionalrender/model.frag.spv
  3. 44
    0
      Data/shaders/conditionalrender/model.vert
  4. BIN
      Data/shaders/conditionalrender/model.vert.spv
  5. BIN
      Data/shaders/deferredshadows/debug.frag.spv
  6. 0
    5
      Data/shaders/deferredshadows/debug.vert
  7. BIN
      Data/shaders/deferredshadows/debug.vert.spv
  8. BIN
      Data/shaders/deferredshadows/deferred.frag.spv
  9. 0
    5
      Data/shaders/deferredshadows/deferred.vert
  10. BIN
      Data/shaders/deferredshadows/deferred.vert.spv
  11. BIN
      Data/shaders/deferredshadows/mrt.frag.spv
  12. 0
    5
      Data/shaders/deferredshadows/mrt.vert
  13. BIN
      Data/shaders/deferredshadows/mrt.vert.spv
  14. 0
    5
      Data/shaders/deferredshadows/shadow.geom
  15. BIN
      Data/shaders/deferredshadows/shadow.geom.spv
  16. 0
    5
      Data/shaders/deferredshadows/shadow.vert
  17. BIN
      Data/shaders/deferredshadows/shadow.vert.spv
  18. BIN
      Data/shaders/geometryshader/base.frag.spv
  19. 0
    8
      Data/shaders/geometryshader/base.vert
  20. BIN
      Data/shaders/geometryshader/base.vert.spv
  21. BIN
      Data/shaders/geometryshader/mesh.frag.spv
  22. 0
    5
      Data/shaders/geometryshader/mesh.vert
  23. BIN
      Data/shaders/geometryshader/mesh.vert.spv
  24. BIN
      Data/shaders/geometryshader/normaldebug.geom.spv
  25. 116
    0
      Data/shaders/inlineuniformblocks/pbr.frag
  26. BIN
      Data/shaders/inlineuniformblocks/pbr.frag.spv
  27. 32
    0
      Data/shaders/inlineuniformblocks/pbr.vert
  28. BIN
      Data/shaders/inlineuniformblocks/pbr.vert.spv
  29. 33
    0
      Data/shaders/inputattachments/attachmentread.frag
  30. BIN
      Data/shaders/inputattachments/attachmentread.frag.spv
  31. 10
    0
      Data/shaders/inputattachments/attachmentread.vert
  32. BIN
      Data/shaders/inputattachments/attachmentread.vert.spv
  33. 23
    0
      Data/shaders/inputattachments/attachmentwrite.frag
  34. BIN
      Data/shaders/inputattachments/attachmentwrite.frag.spv
  35. 29
    0
      Data/shaders/inputattachments/attachmentwrite.vert
  36. BIN
      Data/shaders/inputattachments/attachmentwrite.vert.spv
  37. 3
    3
      Data/shaders/particlefire/normalmap.frag
  38. BIN
      Data/shaders/particlefire/normalmap.frag.spv
  39. 10
    12
      Data/shaders/particlefire/normalmap.vert
  40. BIN
      Data/shaders/particlefire/normalmap.vert.spv
  41. 1
    2
      Data/shaders/particlefire/particle.frag
  42. 1
    2
      Data/shaders/particlefire/particle.vert
  43. BIN
      Data/shaders/pipelinestatistics/scene.frag.spv
  44. BIN
      Data/shaders/pipelinestatistics/scene.tesc.spv
  45. BIN
      Data/shaders/pipelinestatistics/scene.tese.spv
  46. 4
    9
      Data/shaders/pipelinestatistics/scene.vert
  47. BIN
      Data/shaders/pipelinestatistics/scene.vert.spv
  48. BIN
      Data/shaders/terraintessellation/skysphere.frag.spv
  49. 0
    5
      Data/shaders/terraintessellation/skysphere.vert
  50. BIN
      Data/shaders/terraintessellation/skysphere.vert.spv
  51. BIN
      Data/shaders/terraintessellation/terrain.frag.spv
  52. BIN
      Data/shaders/terraintessellation/terrain.tesc.spv
  53. BIN
      Data/shaders/terraintessellation/terrain.tese.spv
  54. 0
    5
      Data/shaders/terraintessellation/terrain.vert
  55. BIN
      Data/shaders/terraintessellation/terrain.vert.spv
  56. 0
    5
      Data/shaders/tessellation/base.vert
  57. BIN
      Data/shaders/viewportarray/multiview.geom.spv
  58. BIN
      Data/shaders/viewportarray/scene.frag.spv
  59. 0
    5
      Data/shaders/viewportarray/scene.vert
  60. BIN
      Data/shaders/viewportarray/scene.vert.spv
  61. 1
    1
      TestApp1/TestApp1.cpp

+ 20
- 0
Data/shaders/conditionalrender/model.frag Ver fichero

@@ -0,0 +1,20 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inNormal;
4
+layout (location = 1) in vec3 inColor;
5
+layout (location = 2) in vec3 inViewVec;
6
+layout (location = 3) in vec3 inLightVec;
7
+
8
+layout (location = 0) out vec4 outFragColor;
9
+
10
+void main() 
11
+{
12
+	vec3 N = normalize(inNormal);
13
+	vec3 L = normalize(inLightVec);
14
+	vec3 V = normalize(inViewVec);
15
+	vec3 R = reflect(-L, N);
16
+	vec3 ambient = vec3(0.1);
17
+	vec3 diffuse = max(dot(N, L), 0.0) * vec3(1.0);
18
+	vec3 specular = pow(max(dot(R, V), 0.0), 16.0) * vec3(0.75);
19
+	outFragColor = vec4((ambient + diffuse) * inColor.rgb + specular, 1.0);		
20
+}

BIN
Data/shaders/conditionalrender/model.frag.spv Ver fichero


+ 44
- 0
Data/shaders/conditionalrender/model.vert Ver fichero

@@ -0,0 +1,44 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inPos;
4
+layout (location = 1) in vec3 inNormal;
5
+layout (location = 2) in vec3 inColor;
6
+
7
+layout (set = 0, binding = 0) uniform UBO {
8
+	mat4 projection;
9
+	mat4 view;
10
+	mat4 model;
11
+} ubo;
12
+
13
+layout (set = 1, binding = 0) uniform Node {
14
+	mat4 matrix;
15
+} node;
16
+
17
+layout(push_constant) uniform PushBlock {
18
+	vec4 baseColorFactor;
19
+} material;
20
+
21
+layout (location = 0) out vec3 outNormal;
22
+layout (location = 1) out vec3 outColor;
23
+layout (location = 2) out vec3 outViewVec;
24
+layout (location = 3) out vec3 outLightVec;
25
+
26
+out gl_PerVertex
27
+{
28
+	vec4 gl_Position;
29
+};
30
+
31
+void main() 
32
+{
33
+	outNormal = inNormal;
34
+	outColor = material.baseColorFactor.rgb;
35
+	vec4 pos = vec4(inPos, 1.0);
36
+	gl_Position = ubo.projection * ubo.view * ubo.model * node.matrix * pos;
37
+
38
+	outNormal = mat3(ubo.view * ubo.model * node.matrix) * inNormal;
39
+
40
+	vec4 localpos = ubo.view * ubo.model * node.matrix * pos;
41
+	vec3 lightPos = vec3(10.0f, -10.0f, 10.0f);
42
+	outLightVec = lightPos.xyz - localpos.xyz;
43
+	outViewVec = -localpos.xyz;		
44
+}

BIN
Data/shaders/conditionalrender/model.vert.spv Ver fichero


BIN
Data/shaders/deferredshadows/debug.frag.spv Ver fichero


+ 0
- 5
Data/shaders/deferredshadows/debug.vert Ver fichero

@@ -14,11 +14,6 @@ layout (binding = 0) uniform UBO
14 14
 
15 15
 layout (location = 0) out vec3 outUV;
16 16
 
17
-out gl_PerVertex
18
-{
19
-	vec4 gl_Position;
20
-};
21
-
22 17
 void main() 
23 18
 {
24 19
 	outUV = vec3(inUV.st, gl_InstanceIndex);

BIN
Data/shaders/deferredshadows/debug.vert.spv Ver fichero


BIN
Data/shaders/deferredshadows/deferred.frag.spv Ver fichero


+ 0
- 5
Data/shaders/deferredshadows/deferred.vert Ver fichero

@@ -14,11 +14,6 @@ layout (binding = 0) uniform UBO
14 14
 
15 15
 layout (location = 0) out vec2 outUV;
16 16
 
17
-out gl_PerVertex
18
-{
19
-	vec4 gl_Position;
20
-};
21
-
22 17
 void main() 
23 18
 {
24 19
 	outUV = inUV;

BIN
Data/shaders/deferredshadows/deferred.vert.spv Ver fichero


BIN
Data/shaders/deferredshadows/mrt.frag.spv Ver fichero


+ 0
- 5
Data/shaders/deferredshadows/mrt.vert Ver fichero

@@ -23,11 +23,6 @@ layout (location = 2) out vec3 outColor;
23 23
 layout (location = 3) out vec3 outWorldPos;
24 24
 layout (location = 4) out vec3 outTangent;
25 25
 
26
-out gl_PerVertex
27
-{
28
-	vec4 gl_Position;
29
-};
30
-
31 26
 void main() 
32 27
 {
33 28
 	vec4 tmpPos = inPos + ubo.instancePos[gl_InstanceIndex];

BIN
Data/shaders/deferredshadows/mrt.vert.spv Ver fichero


+ 0
- 5
Data/shaders/deferredshadows/shadow.geom Ver fichero

@@ -16,11 +16,6 @@ layout (binding = 0) uniform UBO
16 16
 
17 17
 layout (location = 0) in int inInstanceIndex[];
18 18
 
19
-out gl_PerVertex
20
-{
21
-	vec4 gl_Position;
22
-};
23
-
24 19
 void main() 
25 20
 {
26 21
 	vec4 instancedPos = ubo.instancePos[inInstanceIndex[0]]; 

BIN
Data/shaders/deferredshadows/shadow.geom.spv Ver fichero


+ 0
- 5
Data/shaders/deferredshadows/shadow.vert Ver fichero

@@ -7,11 +7,6 @@ layout (location = 0) in vec4 inPos;
7 7
 
8 8
 layout (location = 0) out int outInstanceIndex;
9 9
 
10
-out gl_PerVertex 
11
-{
12
-	vec4 gl_Position;   
13
-};
14
-
15 10
 void main()
16 11
 {
17 12
 	outInstanceIndex = gl_InstanceIndex;

BIN
Data/shaders/deferredshadows/shadow.vert.spv Ver fichero


BIN
Data/shaders/geometryshader/base.frag.spv Ver fichero


+ 0
- 8
Data/shaders/geometryshader/base.vert Ver fichero

@@ -1,18 +1,10 @@
1 1
 #version 450
2 2
 
3
-#extension GL_ARB_separate_shader_objects : enable
4
-#extension GL_ARB_shading_language_420pack : enable
5
-
6 3
 layout (location = 0) in vec3 inPos;
7 4
 layout (location = 1) in vec3 inNormal;
8 5
 
9 6
 layout (location = 0) out vec3 outNormal;
10 7
 
11
-out gl_PerVertex
12
-{
13
-	vec4 gl_Position;
14
-};
15
-
16 8
 void main(void)
17 9
 {
18 10
 	outNormal = inNormal;

BIN
Data/shaders/geometryshader/base.vert.spv Ver fichero


BIN
Data/shaders/geometryshader/mesh.frag.spv Ver fichero


+ 0
- 5
Data/shaders/geometryshader/mesh.vert Ver fichero

@@ -18,11 +18,6 @@ layout (location = 1) out vec3 outColor;
18 18
 layout (location = 2) out vec3 outViewVec;
19 19
 layout (location = 3) out vec3 outLightVec;
20 20
 
21
-out gl_PerVertex
22
-{
23
-	vec4 gl_Position;
24
-};
25
-
26 21
 void main() 
27 22
 {
28 23
 	outNormal = inNormal;

BIN
Data/shaders/geometryshader/mesh.vert.spv Ver fichero


BIN
Data/shaders/geometryshader/normaldebug.geom.spv Ver fichero


+ 116
- 0
Data/shaders/inlineuniformblocks/pbr.frag Ver fichero

@@ -0,0 +1,116 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inWorldPos;
4
+layout (location = 1) in vec3 inNormal;
5
+
6
+layout (set = 0, binding = 0) uniform UBO 
7
+{
8
+	mat4 projection;
9
+	mat4 model;
10
+	mat4 view;
11
+	vec3 camPos;
12
+} ubo;
13
+
14
+// Inline uniform block
15
+layout (set = 1, binding = 0) uniform UniformInline {
16
+	float roughness;
17
+	float metallic;
18
+	float r;
19
+	float g;
20
+	float b;
21
+	float ambient;
22
+} material;
23
+
24
+layout (location = 0) out vec4 outColor;
25
+
26
+const float PI = 3.14159265359;
27
+
28
+vec3 materialcolor()
29
+{
30
+	return vec3(material.r, material.g, material.b);
31
+}
32
+
33
+// Normal Distribution function --------------------------------------
34
+float D_GGX(float dotNH, float roughness)
35
+{
36
+	float alpha = roughness * roughness;
37
+	float alpha2 = alpha * alpha;
38
+	float denom = dotNH * dotNH * (alpha2 - 1.0) + 1.0;
39
+	return (alpha2)/(PI * denom*denom); 
40
+}
41
+
42
+// Geometric Shadowing function --------------------------------------
43
+float G_SchlicksmithGGX(float dotNL, float dotNV, float roughness)
44
+{
45
+	float r = (roughness + 1.0);
46
+	float k = (r*r) / 8.0;
47
+	float GL = dotNL / (dotNL * (1.0 - k) + k);
48
+	float GV = dotNV / (dotNV * (1.0 - k) + k);
49
+	return GL * GV;
50
+}
51
+
52
+// Fresnel function ----------------------------------------------------
53
+vec3 F_Schlick(float cosTheta, float metallic)
54
+{
55
+	vec3 F0 = mix(vec3(0.04), materialcolor(), metallic); // * material.specular
56
+	vec3 F = F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0); 
57
+	return F;    
58
+}
59
+
60
+// Specular BRDF composition --------------------------------------------
61
+
62
+vec3 BRDF(vec3 L, vec3 V, vec3 N, float metallic, float roughness)
63
+{
64
+	// Precalculate vectors and dot products	
65
+	vec3 H = normalize (V + L);
66
+	float dotNV = clamp(dot(N, V), 0.0, 1.0);
67
+	float dotNL = clamp(dot(N, L), 0.0, 1.0);
68
+	float dotLH = clamp(dot(L, H), 0.0, 1.0);
69
+	float dotNH = clamp(dot(N, H), 0.0, 1.0);
70
+
71
+	// Light color fixed
72
+	vec3 lightColor = vec3(1.0);
73
+
74
+	vec3 color = vec3(0.0);
75
+
76
+	if (dotNL > 0.0)
77
+	{
78
+		float rroughness = max(0.05, roughness);
79
+		// D = Normal distribution (Distribution of the microfacets)
80
+		float D = D_GGX(dotNH, rroughness); 
81
+		// G = Geometric shadowing term (Microfacets shadowing)
82
+		float G = G_SchlicksmithGGX(dotNL, dotNV, rroughness);
83
+		// F = Fresnel factor (Reflectance depending on angle of incidence)
84
+		vec3 F = F_Schlick(dotNV, metallic);
85
+
86
+		vec3 spec = D * F * G / (4.0 * dotNL * dotNV);
87
+
88
+		color += spec * dotNL * lightColor;
89
+	}
90
+
91
+	return color;
92
+}
93
+
94
+// ----------------------------------------------------------------------------
95
+void main()
96
+{		  
97
+	vec3 N = normalize(inNormal);
98
+	vec3 V = normalize(ubo.camPos - inWorldPos);
99
+
100
+	float roughness = material.roughness;
101
+
102
+	// Specular contribution
103
+	vec3 lightPos = vec3(0.0f, 0.0f, 10.0f);
104
+	vec3 Lo = vec3(0.0);
105
+	vec3 L = normalize(lightPos.xyz - inWorldPos);
106
+	Lo += BRDF(L, V, N, material.metallic, roughness);
107
+
108
+	// Combine with ambient
109
+	vec3 color = materialcolor() * material.ambient;
110
+	color += Lo;
111
+
112
+	// Gamma correct
113
+	color = pow(color, vec3(0.4545));
114
+
115
+	outColor = vec4(color, 1.0);
116
+}

BIN
Data/shaders/inlineuniformblocks/pbr.frag.spv Ver fichero


+ 32
- 0
Data/shaders/inlineuniformblocks/pbr.vert Ver fichero

@@ -0,0 +1,32 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inPos;
4
+layout (location = 1) in vec3 inNormal;
5
+
6
+layout (set = 0, binding = 0) uniform UBO 
7
+{
8
+	mat4 projection;
9
+	mat4 model;
10
+	mat4 view;
11
+	vec3 camPos;
12
+} ubo;
13
+
14
+layout (location = 0) out vec3 outWorldPos;
15
+layout (location = 1) out vec3 outNormal;
16
+
17
+layout(push_constant) uniform PushConsts {
18
+	vec3 objPos;
19
+} pushConsts;
20
+
21
+out gl_PerVertex 
22
+{
23
+	vec4 gl_Position;
24
+};
25
+
26
+void main() 
27
+{
28
+	vec3 locPos = vec3(ubo.model * vec4(inPos, 1.0));
29
+	outWorldPos = locPos + pushConsts.objPos;
30
+	outNormal = mat3(ubo.model) * inNormal;
31
+	gl_Position =  ubo.projection * ubo.view * vec4(outWorldPos, 1.0);
32
+}

BIN
Data/shaders/inlineuniformblocks/pbr.vert.spv Ver fichero


+ 33
- 0
Data/shaders/inputattachments/attachmentread.frag Ver fichero

@@ -0,0 +1,33 @@
1
+#version 450
2
+
3
+layout (input_attachment_index = 0, binding = 0) uniform subpassInput inputColor;
4
+layout (input_attachment_index = 1, binding = 1) uniform subpassInput inputDepth;
5
+
6
+layout (binding = 2) uniform UBO {
7
+	vec2 brightnessContrast;
8
+	vec2 range;
9
+	int attachmentIndex;
10
+} ubo;
11
+
12
+layout (location = 0) out vec4 outColor;
13
+
14
+vec3 brightnessContrast(vec3 color, float brightness, float contrast) {
15
+	return (color - 0.5) * contrast + 0.5 + brightness;
16
+}
17
+
18
+void main() 
19
+{
20
+	// Apply brightness and contrast filer to color input
21
+	if (ubo.attachmentIndex == 0) {
22
+		// Read color from previous color input attachment
23
+		vec3 color = subpassLoad(inputColor).rgb;
24
+		outColor.rgb = brightnessContrast(color, ubo.brightnessContrast[0], ubo.brightnessContrast[1]);
25
+	}
26
+
27
+	// Visualize depth input range
28
+	if (ubo.attachmentIndex == 1) {
29
+		// Read depth from previous depth input attachment
30
+		float depth = subpassLoad(inputDepth).r;
31
+		outColor.rgb = vec3((depth - ubo.range[0]) * 1.0 / (ubo.range[1] - ubo.range[0]));
32
+	}
33
+}

BIN
Data/shaders/inputattachments/attachmentread.frag.spv Ver fichero


+ 10
- 0
Data/shaders/inputattachments/attachmentread.vert Ver fichero

@@ -0,0 +1,10 @@
1
+#version 450
2
+
3
+out gl_PerVertex {
4
+	vec4 gl_Position;
5
+};
6
+
7
+void main() 
8
+{
9
+	gl_Position = vec4(vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2) * 2.0f - 1.0f, 0.0f, 1.0f);
10
+}

BIN
Data/shaders/inputattachments/attachmentread.vert.spv Ver fichero


+ 23
- 0
Data/shaders/inputattachments/attachmentwrite.frag Ver fichero

@@ -0,0 +1,23 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inColor;
4
+layout (location = 1) in vec3 inNormal;
5
+layout (location = 2) in vec3 inViewVec;
6
+layout (location = 3) in vec3 inLightVec;
7
+
8
+layout (location = 0) out vec4 outColor;
9
+
10
+void main() 
11
+{
12
+	// Toon shading color attachment output
13
+	float intensity = dot(normalize(inNormal), normalize(inLightVec));
14
+	float shade = 1.0;
15
+	shade = intensity < 0.5 ? 0.75 : shade;
16
+	shade = intensity < 0.35 ? 0.6 : shade;
17
+	shade = intensity < 0.25 ? 0.5 : shade;
18
+	shade = intensity < 0.1 ? 0.25 : shade;
19
+
20
+	outColor.rgb = inColor * 3.0 * shade;
21
+
22
+	// Depth attachment does not need to be explicitly written
23
+}

BIN
Data/shaders/inputattachments/attachmentwrite.frag.spv Ver fichero


+ 29
- 0
Data/shaders/inputattachments/attachmentwrite.vert Ver fichero

@@ -0,0 +1,29 @@
1
+#version 450
2
+
3
+layout (location = 0) in vec3 inPos;
4
+layout (location = 1) in vec3 inColor;
5
+layout (location = 2) in vec3 inNormal;
6
+
7
+layout (binding = 0) uniform UBO {
8
+	mat4 projection;
9
+	mat4 model;
10
+	mat4 view;
11
+} ubo;
12
+
13
+layout (location = 0) out vec3 outColor;
14
+layout (location = 1) out vec3 outNormal;
15
+layout (location = 2) out vec3 outViewVec;
16
+layout (location = 3) out vec3 outLightVec;
17
+
18
+out gl_PerVertex {
19
+	vec4 gl_Position;
20
+};
21
+
22
+void main() 
23
+{
24
+	gl_Position = ubo.projection * ubo.view * ubo.model * vec4(inPos, 1.0);
25
+	outColor = inColor;
26
+	outNormal = inNormal;
27
+	outLightVec = vec3(0.0f, 5.0f, 15.0f) - inPos;
28
+	outViewVec = -inPos.xyz;		
29
+}

BIN
Data/shaders/inputattachments/attachmentwrite.vert.spv Ver fichero


+ 3
- 3
Data/shaders/particlefire/normalmap.frag Ver fichero

@@ -11,8 +11,8 @@ layout (binding = 2) uniform sampler2D sNormalHeightMap;
11 11
 layout (location = 0) in vec2 inUV;
12 12
 layout (location = 1) in vec3 inLightVec;
13 13
 layout (location = 2) in vec3 inLightVecB;
14
-layout (location = 5) in vec3 inLightDir;
15
-layout (location = 6) in vec3 inViewVec;
14
+layout (location = 3) in vec3 inLightDir;
15
+layout (location = 4) in vec3 inViewVec;
16 16
 
17 17
 layout (location = 0) out vec4 outFragColor;
18 18
 
@@ -41,4 +41,4 @@ void main(void)
41 41
 	float specular = pow(max(dot(view, reflectDir), 0.0), 4.0);
42 42
 	
43 43
 	outFragColor = vec4((rgb * atten + (diffuse * rgb + 0.5 * specular * specularColor.rgb)) * atten, 1.0);   
44
-}
44
+}

BIN
Data/shaders/particlefire/normalmap.frag.spv Ver fichero


+ 10
- 12
Data/shaders/particlefire/normalmap.vert Ver fichero

@@ -15,20 +15,18 @@ layout (binding = 0) uniform UBO
15 15
 	mat4 model;
16 16
 	mat4 normal;
17 17
 	vec4 lightPos;
18
-	vec4 cameraPos;
19 18
 } ubo;
20 19
 
21 20
 out gl_PerVertex
22 21
 {
23 22
 	vec4 gl_Position;
24
-	float gl_PointSize;
25 23
 };
26 24
 
27 25
 layout (location = 0) out vec2 outUV;
28 26
 layout (location = 1) out vec3 outLightVec;
29 27
 layout (location = 2) out vec3 outLightVecB;
30
-layout (location = 5) out vec3 outLightDir;
31
-layout (location = 6) out vec3 outViewVec;
28
+layout (location = 3) out vec3 outLightDir;
29
+layout (location = 4) out vec3 outViewVec;
32 30
 
33 31
 void main(void) 
34 32
 {
@@ -42,18 +40,18 @@ void main(void)
42 40
 	tbnMatrix[1] =  mat3(ubo.normal) * inBiTangent;
43 41
 	tbnMatrix[2] =  mat3(ubo.normal) * inNormal;
44 42
 
45
-	outLightVec.xyz = vec3(ubo.lightPos.xyz - vertexPosition.xyz) * tbnMatrix;
43
+	outLightVec.xyz = vec3(ubo.lightPos.xyz - vertexPosition) * tbnMatrix;
46 44
 
47
-	vec3 lightDist = ubo.lightPos.xyz - inPos.xyz;
48
-	outLightVecB.x = dot(inTangent.xyz, lightDist);
49
-	outLightVecB.y = dot(inBiTangent.xyz, lightDist);
45
+	vec3 lightDist = ubo.lightPos.xyz - inPos;
46
+	outLightVecB.x = dot(inTangent, lightDist);
47
+	outLightVecB.y = dot(inBiTangent, lightDist);
50 48
 	outLightVecB.z = dot(inNormal, lightDist);
51 49
 
52
-	outViewVec.x = dot(inTangent, inPos.xyz);
53
-	outViewVec.y = dot(inBiTangent, inPos.xyz);
54
-	outViewVec.z = dot(inNormal, inPos.xyz);
50
+	outViewVec.x = dot(inTangent, inPos);
51
+	outViewVec.y = dot(inBiTangent, inPos);
52
+	outViewVec.z = dot(inNormal, inPos);
55 53
 
56 54
 	outUV = inUV;
57 55
 	
58 56
 	gl_Position = ubo.projection * ubo.model * vec4(inPos, 1.0);
59
-}
57
+}

BIN
Data/shaders/particlefire/normalmap.vert.spv Ver fichero


+ 1
- 2
Data/shaders/particlefire/particle.frag Ver fichero

@@ -11,7 +11,6 @@ layout (location = 1) in float inAlpha;
11 11
 layout (location = 2) in flat int inType;
12 12
 layout (location = 3) in float inRotation;
13 13
 
14
-
15 14
 layout (location = 0) out vec4 outFragColor;
16 15
 
17 16
 void main () 
@@ -43,4 +42,4 @@ void main ()
43 42
 	}
44 43
 	
45 44
 	outFragColor.rgb = color.rgb * inColor.rgb * alpha;	
46
-}
45
+}

+ 1
- 2
Data/shaders/particlefire/particle.vert Ver fichero

@@ -44,6 +44,5 @@ void main ()
44 44
 	// Scale particle size depending on camera projection
45 45
 	vec4 eyePos = ubo.modelview * vec4(inPos.xyz, 1.0);
46 46
 	vec4 projectedCorner = ubo.projection * vec4(0.5 * spriteSize, 0.5 * spriteSize, eyePos.z, eyePos.w);
47
-	gl_PointSize = ubo.viewportDim.x * projectedCorner.x / projectedCorner.w;
48
-	
47
+	gl_PointSize = ubo.viewportDim.x * projectedCorner.x / projectedCorner.w;	
49 48
 }

BIN
Data/shaders/pipelinestatistics/scene.frag.spv Ver fichero


BIN
Data/shaders/pipelinestatistics/scene.tesc.spv Ver fichero


BIN
Data/shaders/pipelinestatistics/scene.tese.spv Ver fichero


+ 4
- 9
Data/shaders/pipelinestatistics/scene.vert Ver fichero

@@ -20,11 +20,6 @@ layout(push_constant) uniform PushConsts {
20 20
 	vec3 objPos;
21 21
 } pushConsts;
22 22
 
23
-out gl_PerVertex
24
-{
25
-	vec4 gl_Position;
26
-};
27
-
28 23
 void main() 
29 24
 {
30 25
 	outNormal = inNormal;
@@ -34,8 +29,8 @@ void main()
34 29
 	vec3 worldPos = vec3(ubo.modelview * vec4(inPos + pushConsts.objPos, 1.0));
35 30
 	gl_Position =  ubo.projection /* ubo.modelview */ * vec4(worldPos, 1.0);
36 31
 	
37
-    vec4 pos = ubo.modelview * vec4(worldPos, 1.0);
38
-    outNormal = mat3(ubo.modelview) * inNormal;
39
-    outLightVec = ubo.lightPos.xyz - pos.xyz;
40
-    outViewVec = -pos.xyz;
32
+	vec4 pos = ubo.modelview * vec4(worldPos, 1.0);
33
+	outNormal = mat3(ubo.modelview) * inNormal;
34
+	outLightVec = ubo.lightPos.xyz - pos.xyz;
35
+	outViewVec = -pos.xyz;
41 36
 }

BIN
Data/shaders/pipelinestatistics/scene.vert.spv Ver fichero


BIN
Data/shaders/terraintessellation/skysphere.frag.spv Ver fichero


+ 0
- 5
Data/shaders/terraintessellation/skysphere.vert Ver fichero

@@ -11,11 +11,6 @@ layout (set = 0, binding = 0) uniform UBO
11 11
 	mat4 mvp;
12 12
 } ubo;
13 13
 
14
-out gl_PerVertex 
15
-{
16
-	vec4 gl_Position;   
17
-};
18
-
19 14
 void main(void)
20 15
 {
21 16
 	gl_Position = ubo.mvp * vec4(inPos, 1.0);

BIN
Data/shaders/terraintessellation/skysphere.vert.spv Ver fichero


BIN
Data/shaders/terraintessellation/terrain.frag.spv Ver fichero


BIN
Data/shaders/terraintessellation/terrain.tesc.spv Ver fichero


BIN
Data/shaders/terraintessellation/terrain.tese.spv Ver fichero


+ 0
- 5
Data/shaders/terraintessellation/terrain.vert Ver fichero

@@ -10,11 +10,6 @@ layout (location = 2) in vec2 inUV;
10 10
 layout (location = 0) out vec3 outNormal;
11 11
 layout (location = 1) out vec2 outUV;
12 12
 
13
-out gl_PerVertex
14
-{
15
-	vec4 gl_Position;
16
-};
17
-
18 13
 void main(void)
19 14
 {
20 15
 	gl_Position = vec4(inPos.xyz, 1.0);

BIN
Data/shaders/terraintessellation/terrain.vert.spv Ver fichero


+ 0
- 5
Data/shaders/tessellation/base.vert Ver fichero

@@ -10,11 +10,6 @@ layout (location = 2) in vec2 inUV;
10 10
 layout (location = 0) out vec3 outNormal;
11 11
 layout (location = 1) out vec2 outUV;
12 12
 
13
-out gl_PerVertex
14
-{
15
-	vec4 gl_Position;
16
-};
17
-
18 13
 void main(void)
19 14
 {
20 15
 	gl_Position = vec4(inPos.xyz, 1.0);

BIN
Data/shaders/viewportarray/multiview.geom.spv Ver fichero


BIN
Data/shaders/viewportarray/scene.frag.spv Ver fichero


+ 0
- 5
Data/shaders/viewportarray/scene.vert Ver fichero

@@ -7,11 +7,6 @@ layout (location = 2) in vec3 inColor;
7 7
 layout (location = 0) out vec3 outNormal;
8 8
 layout (location = 1) out vec3 outColor;
9 9
 
10
-out gl_PerVertex
11
-{
12
-	vec4 gl_Position;
13
-};
14
-
15 10
 void main() 
16 11
 {
17 12
 	outColor = inColor;

BIN
Data/shaders/viewportarray/scene.vert.spv Ver fichero


+ 1
- 1
TestApp1/TestApp1.cpp Ver fichero

@@ -388,7 +388,7 @@ public:
388 388
 
389 389
         device = DKGraphicsDevice::SharedInstance();
390 390
 
391
-        TestRenderPipelineReflection("shaders/deferredshadows/deferred");
391
+        TestRenderPipelineReflection("shaders/conditionalrender/model");
392 392
         TestComputePipelineReflection("shaders/computeshader/emboss");
393 393
 
394 394
 		Terminate(0);