Преглед на файлове

Merge pull request #37 from godlikepanos/new_program

New shader program format based on pure GLSL and not XML
Panagiotis Christopoulos Charitos преди 7 години
родител
ревизия
79dc52a820
променени са 100 файла, в които са добавени 759 реда и са изтрити 1357 реда
  1. 1 1
      .gitignore
  2. 5 3
      CMakeLists.txt
  3. 1 1
      samples/simple_scene/assets/room-material.ankimtl
  4. 1 1
      samples/sponza/assets/Material__57_001-material.ankimtl
  5. 1 1
      samples/sponza/assets/arch-material.ankimtl
  6. 1 1
      samples/sponza/assets/bricks-material.ankimtl
  7. 1 1
      samples/sponza/assets/ceiling-material.ankimtl
  8. 1 1
      samples/sponza/assets/chain-material.ankimtl
  9. 1 1
      samples/sponza/assets/column_a-material.ankimtl
  10. 1 1
      samples/sponza/assets/column_b-material.ankimtl
  11. 1 1
      samples/sponza/assets/column_c-material.ankimtl
  12. 1 1
      samples/sponza/assets/details-material.ankimtl
  13. 1 1
      samples/sponza/assets/fabric_a-material.ankimtl
  14. 1 1
      samples/sponza/assets/fabric_c-material.ankimtl
  15. 1 1
      samples/sponza/assets/fabric_d-material.ankimtl
  16. 1 1
      samples/sponza/assets/fabric_e-material.ankimtl
  17. 1 1
      samples/sponza/assets/fabric_f-material.ankimtl
  18. 1 1
      samples/sponza/assets/fire.ankimtl
  19. 1 1
      samples/sponza/assets/flagpole-material.ankimtl
  20. 1 1
      samples/sponza/assets/floor-material.ankimtl
  21. 1 1
      samples/sponza/assets/leaf-material.ankimtl
  22. 1 1
      samples/sponza/assets/lion-material.ankimtl
  23. 1 1
      samples/sponza/assets/lion_stand-material.ankimtl
  24. 1 1
      samples/sponza/assets/roof-material.ankimtl
  25. 1 1
      samples/sponza/assets/smoke.ankimtl
  26. 1 1
      samples/sponza/assets/vase-material.ankimtl
  27. 1 1
      samples/sponza/assets/vase_hanging-material.ankimtl
  28. 1 1
      samples/sponza/assets/vase_round_001-material.ankimtl
  29. 1 1
      samples/sponza/assets/writings-material.ankimtl
  30. 9 18
      shaders/ApplyIrradianceToReflection.glslp
  31. 0 31
      shaders/Blit.ankiprog
  32. 22 0
      shaders/Blit.glslp
  33. 11 22
      shaders/Bloom.glslp
  34. 11 22
      shaders/BloomUpscale.glslp
  35. 1 4
      shaders/ClusterLightCommon.glsl
  36. 1 4
      shaders/Common.glsl
  37. 9 19
      shaders/Dbg.glslp
  38. 0 39
      shaders/DepthAwareBlur.ankiprog
  39. 1 4
      shaders/DepthAwareBlur.glsl
  40. 26 0
      shaders/DepthAwareBlur.glslp
  41. 0 34
      shaders/DepthAwareBlurCompute.ankiprog
  42. 23 0
      shaders/DepthAwareBlurCompute.glslp
  43. 13 23
      shaders/DepthDownscale.glslp
  44. 0 21
      shaders/DownscaleBlur.ankiprog
  45. 1 4
      shaders/DownscaleBlur.glsl
  46. 12 0
      shaders/DownscaleBlur.glslp
  47. 0 19
      shaders/DownscaleBlurCompute.ankiprog
  48. 10 0
      shaders/DownscaleBlurCompute.glslp
  49. 11 23
      shaders/ExponentialShadowmappingResolve.glslp
  50. 18 30
      shaders/FinalComposite.glslp
  51. 1 4
      shaders/ForwardShadingCommonFrag.glsl
  52. 1 4
      shaders/ForwardShadingCommonVert.glsl
  53. 0 51
      shaders/ForwardShadingFog.ankiprog
  54. 37 0
      shaders/ForwardShadingFog.glslp
  55. 0 94
      shaders/ForwardShadingParticles.ankiprog
  56. 64 0
      shaders/ForwardShadingParticles.glslp
  57. 13 24
      shaders/ForwardShadingUpscale.glslp
  58. 13 24
      shaders/ForwardShadingVolumetricUpscale.glslp
  59. 1 4
      shaders/Functions.glsl
  60. 1 4
      shaders/GBufferCommonFrag.glsl
  61. 1 4
      shaders/GBufferCommonVert.glsl
  62. 0 203
      shaders/GBufferGeneric.ankiprog
  63. 104 0
      shaders/GBufferGeneric.glslp
  64. 15 30
      shaders/GBufferPost.glslp
  65. 0 40
      shaders/GaussianBlur.ankiprog
  66. 7 8
      shaders/GaussianBlur.glsl
  67. 20 0
      shaders/GaussianBlur.glslp
  68. 1 4
      shaders/GaussianBlurCommon.glsl
  69. 0 35
      shaders/GaussianBlurCompute.ankiprog
  70. 18 0
      shaders/GaussianBlurCompute.glslp
  71. 14 25
      shaders/Irradiance.glslp
  72. 10 21
      shaders/LensFlareSprite.glslp
  73. 10 19
      shaders/LensFlareUpdateIndirectInfo.glslp
  74. 1 4
      shaders/LightFunctions.glsl
  75. 23 39
      shaders/LightShading.glslp
  76. 14 27
      shaders/LumaAwareBlur.glslp
  77. 1 4
      shaders/Pack.glsl
  78. 24 36
      shaders/Reflections.glslp
  79. 12 26
      shaders/SceneDebug.glslp
  80. 14 28
      shaders/ScreenSpaceLensFlare.glslp
  81. 0 37
      shaders/Ssao.ankiprog
  82. 12 4
      shaders/Ssao.glsl
  83. 12 0
      shaders/Ssao.glslp
  84. 0 30
      shaders/SsaoCompute.ankiprog
  85. 8 0
      shaders/SsaoCompute.glslp
  86. 26 38
      shaders/TemporalAAResolve.glslp
  87. 1 3
      shaders/Tonemapping.glsl
  88. 9 18
      shaders/TonemappingAverageLuminance.glslp
  89. 1 4
      shaders/TonemappingResources.glsl
  90. 16 25
      shaders/TraditionalDeferredShading.glslp
  91. 11 21
      shaders/Ui.glslp
  92. 21 42
      shaders/VolumetricFog.glslp
  93. 1 4
      shaders/glsl_cpp_common/ClusteredShading.h
  94. 1 4
      shaders/glsl_cpp_common/Clusterer.h
  95. 1 4
      shaders/glsl_cpp_common/Common.h
  96. 1 4
      shaders/glsl_cpp_common/LensFlareSprite.h
  97. 1 4
      shaders/glsl_cpp_common/TraditionalDeferredShading.h
  98. 3 3
      src/anki/renderer/Bloom.cpp
  99. 1 1
      src/anki/renderer/DebugDrawer.cpp
  100. 1 1
      src/anki/renderer/DepthDownscale.cpp

+ 1 - 1
.gitignore

@@ -10,6 +10,6 @@
 !*.xml
 !*.md
 !*.txt
-!*.ankiprog
+!*.glslp
 !CMakeLists.txt
 build*/*

+ 5 - 3
CMakeLists.txt

@@ -270,6 +270,9 @@ message("++ Configuring glslang")
 add_subdirectory(thirdparty/glslang)
 message("++ End configuring glslang")
 
+# tinyexpr
+add_subdirectory(thirdparty/tinyexpr)
+
 foreach(TMP ${ANKI_EXTERN_SUB_DIRS})
 	add_subdirectory(thirdparty/${TMP})
 endforeach()
@@ -360,6 +363,7 @@ include_directories("src"
 	"thirdparty/khronos"
 	"${CMAKE_CURRENT_BINARY_DIR}"
 	"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glslang"
+	"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/tinyexpr"
 	"thirdparty"
 	${CMAKE_CURRENT_SOURCE_DIR})
 
@@ -422,9 +426,7 @@ if(SDL)
 	set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} SDL2-static)
 endif()
 
-set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} ankispirvcross)
-
-set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} glslang SPIRV OGLCompiler OSDependent)
+set(THIRD_PARTY_LIBS ${THIRD_PARTY_LIBS} ankispirvcross glslang SPIRV OGLCompiler OSDependent ankitinyexpr)
 
 # Add anki sub libraries
 set(ANKI_SUB_DIRS core script renderer scene ui event input physics resource misc gr collision math util)

+ 1 - 1
samples/simple_scene/assets/room-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="0"/>

+ 1 - 1
samples/sponza/assets/Material__57_001-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/arch-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/bricks-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/ceiling-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/chain-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/column_a-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/column_b-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/column_c-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/details-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fabric_a-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fabric_c-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fabric_d-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fabric_e-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fabric_f-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/fire.ankimtl

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<material shaderProgram="shaders/ForwardShadingParticles.ankiprog" forwardShading="1" shadow="0">
+<material shaderProgram="shaders/ForwardShadingParticles.glslp" forwardShading="1" shadow="0">
 	<mutators>
 		<mutator name="ANIMATED_TEXTURE" value="0"/>
 		<mutator name="LIGHT" value="0"/>

+ 1 - 1
samples/sponza/assets/flagpole-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/floor-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/leaf-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/lion-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/lion_stand-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/roof-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/smoke.ankimtl

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<material shaderProgram="shaders/ForwardShadingParticles.ankiprog" forwardShading="1" shadow="0">
+<material shaderProgram="shaders/ForwardShadingParticles.glslp" forwardShading="1" shadow="0">
 	<mutators>
 		<mutator name="ANIMATED_TEXTURE" value="0"/>
 		<mutator name="LIGHT" value="1"/>

+ 1 - 1
samples/sponza/assets/vase-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/vase_hanging-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/vase_round_001-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 1 - 1
samples/sponza/assets/writings-material.ankimtl

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ExporterMaterial.cpp -->
-<material shaderProgram="shaders/GBufferGeneric.ankiprog">
+<material shaderProgram="shaders/GBufferGeneric.glslp">
 	
 	<mutators>
 		<mutator name="DIFFUSE_TEX" value="1"/>

+ 9 - 18
shaders/ApplyIrradianceToReflection.ankiprog → shaders/ApplyIrradianceToReflection.glslp

@@ -1,19 +1,13 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
 #include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Pack.glsl>
 
 layout(location = 0) in Vec2 in_uv;
@@ -48,7 +42,4 @@ void main()
 	// Write it
 	out_color = indirect;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 0 - 31
shaders/Blit.ankiprog

@@ -1,31 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<source><![CDATA[
-#include <shaders/Common.glsl>
-
-layout(ANKI_TEX_BINDING(0, 0)) uniform sampler2D u_tex;
-
-layout(location = 0) in Vec2 in_uv;
-layout(location = 0) out Vec3 out_col;
-
-void main()
-{
-	out_col = textureLod(u_tex, in_uv, 0.0).rgb;
-}
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 22 - 0
shaders/Blit.glslp

@@ -0,0 +1,22 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/Common.glsl>
+
+layout(ANKI_TEX_BINDING(0, 0)) uniform sampler2D u_tex;
+
+layout(location = 0) in Vec2 in_uv;
+layout(location = 0) out Vec3 out_col;
+
+void main()
+{
+	out_col = textureLod(u_tex, in_uv, 0.0).rgb;
+}
+#pragma anki end

+ 11 - 22
shaders/Bloom.ankiprog → shaders/Bloom.glslp

@@ -1,23 +1,15 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const Vec2 TEX_SIZE
 
-		<shader type="frag">
-			<inputs>
-				<input name="TEX_SIZE" type="Vec2" const="1"/>
-			</inputs>
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 #include <shaders/Tonemapping.glsl>
 
@@ -53,7 +45,4 @@ void main()
 
 	out_color = Vec4(color, 0.25);
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 11 - 22
shaders/BloomUpscale.ankiprog → shaders/BloomUpscale.glslp

@@ -1,23 +1,15 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const Vec2 TEX_SIZE
 
-		<shader type="frag">
-			<inputs>
-				<input name="TEX_SIZE" type="Vec2" const="1"/>
-			</inputs>
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 layout(ANKI_TEX_BINDING(0, 0)) uniform mediump sampler2D u_tex;
@@ -38,7 +30,4 @@ void main()
 
 	out_color /= 5.0;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 1 - 4
shaders/ClusterLightCommon.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_CLUSTER_LIGHT_COMMON_GLSL
-#define ANKI_SHADERS_CLUSTER_LIGHT_COMMON_GLSL
+#pragma once
 
 #include <shaders/LightFunctions.glsl>
 #include <shaders/glsl_cpp_common/ClusteredShading.h>
@@ -112,5 +111,3 @@ layout(std430, ANKI_SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING + 1)) readonly buffer
 {
 	U32 u_lightIndices[];
 };
-
-#endif

+ 1 - 4
shaders/Common.glsl

@@ -5,8 +5,7 @@
 
 // This file contains common code for all shaders. It's optional but it's recomended to include it
 
-#ifndef ANKI_SHADERS_COMMON_GLSL
-#define ANKI_SHADERS_COMMON_GLSL
+#pragma once
 
 // WORKAROUNDS
 #if defined(ANKI_VENDOR_NVIDIA)
@@ -73,5 +72,3 @@ const U32 UBO_MAX_SIZE = 16384u;
 #endif
 
 #define CALC_BITANGENT_IN_VERT 1
-
-#endif

+ 9 - 19
shaders/Dbg.ankiprog → shaders/Dbg.glslp

@@ -1,13 +1,9 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) in Vec4 in_position;
@@ -25,11 +21,9 @@ void main()
 	out_color = in_color;
 	gl_Position = in_position;
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 layout(location = 0) in Vec4 in_color;
@@ -39,8 +33,4 @@ void main()
 {
 	out_color = in_color;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-
+#pragma anki end

+ 0 - 39
shaders/DepthAwareBlur.ankiprog

@@ -1,39 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="ORIENTATION" values="0 1 2"/> <!-- 0: VERTICAL, 1: HORIZONTAL, 2: BOX -->
-		<mutator name="SAMPLE_COUNT" values="3 5 7 9 11 13 15"/>
-		<mutator name="COLOR_COMPONENTS" values="4 3 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="TEXTURE_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#if ORIENTATION == 0
-#	define VERTICAL 1
-#elif ORIENTATION == 1
-#	define HORIZONTAL 1
-#else
-#	define BOX 1
-#endif
-
-#include <shaders/DepthAwareBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 1 - 4
shaders/DepthAwareBlur.glsl

@@ -10,8 +10,7 @@
 // TEXTURE_SIZE
 // SAMPLE_COUNT (must be odd number)
 
-#ifndef ANKI_SHADERS_DEPTH_AWARE_BLUR_GLSL
-#define ANKI_SHADERS_DEPTH_AWARE_BLUR_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -138,5 +137,3 @@ void main()
 	out_color = color;
 #endif
 }
-
-#endif

+ 26 - 0
shaders/DepthAwareBlur.glslp

@@ -0,0 +1,26 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator ORIENTATION 0 1 2 // 0: VERTICAL, 1: HORIZONTAL, 2: BOX
+#pragma anki mutator SAMPLE_COUNT 3 5 7 9 11 13 15
+#pragma anki mutator COLOR_COMPONENTS 4 3 1
+
+#pragma anki input const UVec2 TEXTURE_SIZE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
+#if ORIENTATION == 0
+#	define VERTICAL 1
+#elif ORIENTATION == 1
+#	define HORIZONTAL 1
+#else
+#	define BOX 1
+#endif
+
+#include <shaders/DepthAwareBlur.glsl>
+#pragma anki end

+ 0 - 34
shaders/DepthAwareBlurCompute.ankiprog

@@ -1,34 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="ORIENTATION" values="0 1 2"/> <!-- 0: VERTICAL, 1: HORIZONTAL, 2: BOX -->
-		<mutator name="SAMPLE_COUNT" values="3 5 7 9 11 13 15"/>
-		<mutator name="COLOR_COMPONENTS" values="4 3 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="TEXTURE_SIZE" type="UVec2" const="1"/>
-				<input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#if ORIENTATION == 0
-#	define VERTICAL 1
-#elif ORIENTATION == 1
-#	define HORIZONTAL 1
-#else
-#	define BOX 1
-#endif
-
-#include <shaders/DepthAwareBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 23 - 0
shaders/DepthAwareBlurCompute.glslp

@@ -0,0 +1,23 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator ORIENTATION 0 1 2 // 0: VERTICAL, 1: HORIZONTAL, 2: BOX -->
+#pragma anki mutator SAMPLE_COUNT 3 5 7 9 11 13 15
+#pragma anki mutator COLOR_COMPONENTS 4 3 1
+
+#pragma anki input const UVec2 TEXTURE_SIZE
+#pragma anki input const UVec2 WORKGROUP_SIZE
+
+#pragma anki start comp
+#if ORIENTATION == 0
+#	define VERTICAL 1
+#elif ORIENTATION == 1
+#	define HORIZONTAL 1
+#else
+#	define BOX 1
+#endif
+
+#include <shaders/DepthAwareBlur.glsl>
+#pragma anki end

+ 13 - 23
shaders/DepthDownscale.ankiprog → shaders/DepthDownscale.glslp

@@ -1,25 +1,17 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="TYPE" values="0 1"/> <!-- 0: write to depth&color, 1: write to depth -->
-		<mutator name="SAMPLE_RESOLVE_TYPE" values="0 1 2"/> <!-- 0: average, 1: min, 2: max -->
-		<mutator name="COPY_TO_CLIENT" values="0 1"/>
-	</mutators>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+#pragma anki mutator TYPE 0 1 // 0: write to depth&color, 1: write to depth
+#pragma anki mutator SAMPLE_RESOLVE_TYPE 0 1 2 // 0: average, 1: min, 2: max
+#pragma anki mutator COPY_TO_CLIENT 0 1
+
+#pragma anki start vert
 #include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 #define AVG 0
@@ -69,7 +61,5 @@ void main()
 	u_clientBuf[U32(gl_FragCoord.y) * u_regs.textureSize.x + U32(gl_FragCoord.x)] = out_color;
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+
+#pragma anki end

+ 0 - 21
shaders/DownscaleBlur.ankiprog

@@ -1,21 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<source><![CDATA[
-#include <shaders/DownscaleBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 1 - 4
shaders/DownscaleBlur.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_DOWNSCALE_BLUR_GLSL
-#define ANKI_SHADERS_DOWNSCALE_BLUR_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -51,5 +50,3 @@ void main()
 	imageStore(out_img, IVec2(gl_GlobalInvocationID.xy), Vec4(out_color, 0.0));
 #endif
 }
-
-#endif

+ 12 - 0
shaders/DownscaleBlur.glslp

@@ -0,0 +1,12 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/DownscaleBlur.glsl>
+#pragma anki end

+ 0 - 19
shaders/DownscaleBlurCompute.ankiprog

@@ -1,19 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/DownscaleBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 10 - 0
shaders/DownscaleBlurCompute.glslp

@@ -0,0 +1,10 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const UVec2 WORKGROUP_SIZE
+
+#pragma anki start comp
+#include <shaders/DownscaleBlur.glsl>
+#pragma anki end

+ 11 - 23
shaders/ExponentialShadowmappingResolve.ankiprog → shaders/ExponentialShadowmappingResolve.glslp

@@ -1,13 +1,11 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const UVec2 INPUT_TEXTURE_SIZE
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 out gl_PerVertex
@@ -31,15 +29,9 @@ void main()
 	out_uv = fma(out_uv, u_uvScaleAndTranslation.zw, u_uvScaleAndTranslation.xy);
 	gl_Position = Vec4(pos, 0.0, 1.0);
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<inputs>
-				<input name="INPUT_TEXTURE_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/GaussianBlurCommon.glsl>
 #include <shaders/Functions.glsl>
 
@@ -78,8 +70,4 @@ void main()
 	out_color += sampleLinearDepth(in_uv + Vec2(uvOffset.x, -uvOffset.y)) * BOX_WEIGHTS[2u];
 	out_color += sampleLinearDepth(in_uv + Vec2(-uvOffset.x, -uvOffset.y)) * BOX_WEIGHTS[2u];
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-
+#pragma anki end

+ 18 - 30
shaders/FinalComposite.ankiprog → shaders/FinalComposite.glslp

@@ -1,31 +1,21 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="BLUE_NOISE" values="0 1"/>
-		<mutator name="SHARPEN_ENABLED" values="0 1"/>
-		<mutator name="BLOOM_ENABLED" values="0 1"/>
-		<mutator name="DBG_ENABLED" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator BLUE_NOISE 0 1
+#pragma anki mutator SHARPEN_ENABLED 0 1
+#pragma anki mutator BLOOM_ENABLED 0 1
+#pragma anki mutator DBG_ENABLED 0 1
 
-		<shader type="frag">
-			<inputs>
-				<input name="LUT_SIZE" type="U32" const="1"/>
-				<input name="FB_SIZE" type="UVec2" const="1"/>
-			</inputs>
+#pragma anki input const U32 LUT_SIZE
+#pragma anki input const UVec2 FB_SIZE
 
-			<source><![CDATA[
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
 #include <shaders/Common.glsl>
 #include <shaders/Tonemapping.glsl>
 #include <shaders/Functions.glsl>
@@ -96,7 +86,5 @@ void main()
 	out_color += textureLod(u_dbgRt, uv, 0.0).rgb;
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+
+#pragma anki end

+ 1 - 4
shaders/ForwardShadingCommonFrag.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_FORWARD_SHADING_COMMON_FRAG_GLSL
-#define ANKI_SHADERS_FORWARD_SHADING_COMMON_FRAG_GLSL
+#pragma once
 
 // Common code for all fragment shaders of BS
 #include <shaders/Common.glsl>
@@ -134,5 +133,3 @@ void fog(Vec3 color, F32 fogAlphaScale, F32 fogDistanceOfMaxThikness, F32 zVSpac
 
 	writeGBuffer(Vec4(color, zFeatherFactor * fogAlphaScale));
 }
-
-#endif

+ 1 - 4
shaders/ForwardShadingCommonVert.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_FORWARD_SHADING_COMMON_VERT_GLSL
-#define ANKI_SHADERS_FORWARD_SHADING_COMMON_VERT_GLSL
+#pragma once
 
 // Common code for all vertex shaders of FS
 #include <shaders/Common.glsl>
@@ -27,5 +26,3 @@ out gl_PerVertex
 {
 	Vec4 gl_Position;
 };
-
-#endif

+ 0 - 51
shaders/ForwardShadingFog.ankiprog

@@ -1,51 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<descriptorSet index="1"/>
-
-	<shaders>
-		<shader type="vert">
-			<inputs>
-				<input name="mvp" type="Mat4"/>
-				<input name="modelView" type="Mat4"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/ForwardShadingCommonVert.glsl>
-
-layout(location = 0) out F32 out_zVSpace;
-
-void main() 
-{
-	gl_Position = mvp * Vec4(in_position, 1.0);
-	out_zVSpace = (modelView * Vec4(in_position, 1.0)).z;
-}
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="fogColor" type="Vec3" const="1"/>
-				<input name="fogAlphaScale" type="F32" const="1"/>
-				<input name="fogDistanceOfMaxThikness" type="F32" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/ForwardShadingCommonFrag.glsl>
-
-layout(location = 0) in F32 in_zVSpace;
-
-void main() 
-{
-	fog(fogColor, fogAlphaScale, fogDistanceOfMaxThikness, in_zVSpace);
-}
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-
-

+ 37 - 0
shaders/ForwardShadingFog.glslp

@@ -0,0 +1,37 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki descriptor_set 1
+
+#pragma anki input Mat4 mvp
+#pragma anki input Mat4 modelView
+
+#pragma anki input const Vec3 fogColor
+#pragma anki input const F32 fogAlphaScale
+#pragma anki input const F32 fogDistanceOfMaxThikness
+
+#pragma anki start vert
+#include <shaders/ForwardShadingCommonVert.glsl>
+
+layout(location = 0) out F32 out_zVSpace;
+
+void main()
+{
+	gl_Position = mvp * Vec4(in_position, 1.0);
+	out_zVSpace = (modelView * Vec4(in_position, 1.0)).z;
+}
+
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/ForwardShadingCommonFrag.glsl>
+
+layout(location = 0) in F32 in_zVSpace;
+
+void main()
+{
+	fog(fogColor, fogAlphaScale, fogDistanceOfMaxThikness, in_zVSpace);
+}
+#pragma anki end

+ 0 - 94
shaders/ForwardShadingParticles.ankiprog

@@ -1,94 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<descriptorSet index="1"/>
-
-	<mutators>
-		<mutator name="ANIMATED_TEXTURE" values="0 1"/>
-		<mutator name="LIGHT" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<inputs>
-				<input name="mvp" type="Mat4"/>
-				<input name="cameraRotMat" type="Mat3"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/ForwardShadingCommonVert.glsl>
-
-layout(location = SCALE_LOCATION) in F32 in_scale;
-layout(location = ALPHA_LOCATION) in F32 in_alpha;
-
-layout(location = 0) flat out F32 out_alpha;
-layout(location = 1) out Vec2 out_uv;
-layout(location = 2) out Vec3 out_worldPos;
-
-void main() 
-{
-	out_uv = Vec2(gl_VertexID & 1, gl_VertexID >> 1);
-
-	out_worldPos = cameraRotMat * Vec3((out_uv - 0.5) * in_scale, 0.0) + in_position;
-	gl_Position = mvp * Vec4(out_worldPos, 1.0);
-
-	out_alpha = in_alpha;
-}
-			]]>
-			</source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="diffuseMap" type="sampler2D">
-					<mutators>
-						<mutator name="ANIMATED_TEXTURE" values="0"/>
-					</mutators>
-				</input>
-				<input name="diffuseMapArr" type="sampler2DArray">
-					<mutators>
-						<mutator name="ANIMATED_TEXTURE" values="1"/>
-					</mutators>
-				</input>
-				<input name="animationPeriod" type="F32" const="1">
-					<mutators>
-						<mutator name="ANIMATED_TEXTURE" values="1"/>
-					</mutators>
-				</input>
-				<input name="colorScale" type="Vec4" const="1"/>
-				<input name="colorBias" type="Vec4" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/ForwardShadingCommonFrag.glsl>
-
-layout(location = 0) flat in F32 in_alpha;
-layout(location = 1) in Vec2 in_uv;
-layout(location = 2) in Vec3 in_worldPos;
-
-void main() 
-{
-#if ANIMATED_TEXTURE == 1
-	Vec4 texCol = readAnimatedTextureRgba(diffuseMapArr, animationPeriod, in_uv, anki_u_time);
-#else
-	Vec4 texCol = texture(diffuseMap, in_uv);
-#endif
-
-#if LIGHT
-	texCol.rgb = computeLightColor(texCol.rgb, in_worldPos);
-#endif
-	
-	Vec4 colScale = colorScale;
-	colScale.a *= in_alpha;
-	particleAlpha(texCol, colScale, colorBias);
-}
-			]]>
-			</source>
-		</shader>
-	</shaders>
-</shaderProgram>
-

+ 64 - 0
shaders/ForwardShadingParticles.glslp

@@ -0,0 +1,64 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki descriptor_set 1
+
+#pragma anki mutator ANIMATED_TEXTURE 0 1
+#pragma anki mutator LIGHT 0 1
+
+#pragma anki input Mat4 mvp
+#pragma anki input Mat3 cameraRotMat
+
+#pragma anki input sampler2D diffuseMap "ANIMATED_TEXTURE == 0"
+#pragma anki input sampler2DArray diffuseMapArr "ANIMATED_TEXTURE == 1"
+#pragma anki input const F32 animationPeriod "ANIMATED_TEXTURE == 1"
+#pragma anki input const Vec4 colorScale
+#pragma anki input const Vec4 colorBias
+
+#pragma anki start vert
+#include <shaders/ForwardShadingCommonVert.glsl>
+
+layout(location = SCALE_LOCATION) in F32 in_scale;
+layout(location = ALPHA_LOCATION) in F32 in_alpha;
+
+layout(location = 0) flat out F32 out_alpha;
+layout(location = 1) out Vec2 out_uv;
+layout(location = 2) out Vec3 out_worldPos;
+
+void main()
+{
+	out_uv = Vec2(gl_VertexID & 1, gl_VertexID >> 1);
+
+	out_worldPos = cameraRotMat * Vec3((out_uv - 0.5) * in_scale, 0.0) + in_position;
+	gl_Position = mvp * Vec4(out_worldPos, 1.0);
+
+	out_alpha = in_alpha;
+}
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/ForwardShadingCommonFrag.glsl>
+
+layout(location = 0) flat in F32 in_alpha;
+layout(location = 1) in Vec2 in_uv;
+layout(location = 2) in Vec3 in_worldPos;
+
+void main()
+{
+#if ANIMATED_TEXTURE == 1
+	Vec4 texCol = readAnimatedTextureRgba(diffuseMapArr, animationPeriod, in_uv, anki_u_time);
+#else
+	Vec4 texCol = texture(diffuseMap, in_uv);
+#endif
+
+#if LIGHT
+	texCol.rgb = computeLightColor(texCol.rgb, in_worldPos);
+#endif
+
+	Vec4 colScale = colorScale;
+	colScale.a *= in_alpha;
+	particleAlpha(texCol, colScale, colorBias);
+}
+#pragma anki end

+ 13 - 24
shaders/ForwardShadingUpscale.ankiprog → shaders/ForwardShadingUpscale.glslp

@@ -1,25 +1,17 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const Vec2 SRC_SIZE
+#pragma anki input const Vec2 FB_SIZE
+#pragma anki input const U32 NOISE_TEX_SIZE
 
-		<shader type="frag">
-			<inputs>
-				<input name="SRC_SIZE" type="Vec2" const="1"/>
-				<input name="FB_SIZE" type="Vec2" const="1"/>
-				<input name="NOISE_TEX_SIZE" type="U32" const="1"/>
-			</inputs>
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 #include <shaders/Functions.glsl>
 
@@ -60,7 +52,4 @@ void main()
 	out_color.rgb += blueNoise / 32.0;
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 13 - 24
shaders/ForwardShadingVolumetricUpscale.ankiprog → shaders/ForwardShadingVolumetricUpscale.glslp

@@ -1,25 +1,17 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const Vec2 SRC_SIZE
+#pragma anki input const Vec2 FB_SIZE
+#pragma anki input const U32 NOISE_TEX_SIZE
 
-		<shader type="frag">
-			<inputs>
-				<input name="SRC_SIZE" type="Vec2" const="1"/>
-				<input name="FB_SIZE" type="Vec2" const="1"/>
-				<input name="NOISE_TEX_SIZE" type="U32" const="1"/>
-			</inputs>
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Functions.glsl>
 
 #define BLUE_NOISE 0
@@ -53,7 +45,4 @@ void main()
 
 	out_color = Vec4(col, 0.0);
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 1 - 4
shaders/Functions.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_FUNCTIONS_GLSL
-#define ANKI_SHADERS_FUNCTIONS_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -377,5 +376,3 @@ F32 rayAabbIntersectionInside(Vec3 rayOrigin, Vec3 rayDir, Vec3 aabbMin, Vec3 aa
 	F32 distToIntersect = min(min(largestParams.x, largestParams.y), largestParams.z);
 	return distToIntersect;
 }
-
-#endif

+ 1 - 4
shaders/GBufferCommonFrag.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GBUFFER_COMMON_FRAG_GLSL
-#define ANKI_SHADERS_GBUFFER_COMMON_FRAG_GLSL
+#pragma once
 
 #include <shaders/Pack.glsl>
 #include <shaders/Common.glsl>
@@ -156,5 +155,3 @@ void writeRts(in Vec3 diffColor, // from 0 to 1
 	writeGBuffer(g, out_msRt0, out_msRt1, out_msRt2);
 }
 #endif // PASS == PASS_GB_FS
-
-#endif

+ 1 - 4
shaders/GBufferCommonVert.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GBUFFER_COMMON_VERT_GLSL
-#define ANKI_SHADERS_GBUFFER_COMMON_VERT_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -132,5 +131,3 @@ void skinning()
 #	endif
 }
 #endif
-
-#endif

+ 0 - 203
shaders/GBufferGeneric.ankiprog

@@ -1,203 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="INSTANCE_COUNT" values="1 2 4 8 16 32 64" instanced="1"/>
-		<mutator name="LOD" values="0 1 2"/>
-		<mutator name="PASS" values="0 1 2"/>
-		<mutator name="DIFFUSE_TEX" values="0 1"/>
-		<mutator name="SPECULAR_TEX" values="0 1"/>
-		<mutator name="ROUGHNESS_TEX" values="0 1"/>
-		<mutator name="METAL_TEX" values="0 1"/>
-		<mutator name="NORMAL_TEX" values="0 1"/>
-		<mutator name="PARALLAX" values="0 1"/>
-		<mutator name="EMISSIVE_TEX" values="0 1"/>
-		<mutator name="BONES" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<inputs>
-				<input name="mvp" type="Mat4" instanced="1"/>
-				<input name="rotationMat" type="Mat3" instanced="1">
-					<mutators>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="modelViewMat" type="Mat4" instanced="1">
-					<mutators>
-						<mutator name="PASS" values="0"/>
-						<mutator name="PARALLAX" values="1"/>
-					</mutators>
-				</input>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/GBufferCommonVert.glsl>
-
-void main() 
-{
-#if BONES
-	skinning();
-#endif
-
-#if PASS == PASS_GB_FS
-	positionUvNormalTangent(mvp, rotationMat);
-	
-#	if PARALLAX
-	parallax(modelViewMat);
-#	endif
-#else
-	gl_Position = mvp * Vec4(g_position, 1.0);
-#endif
-}
-			]]>
-			</source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<!-- Consts -->
-				<input name="diffColor" type="Vec3" const="1">
-					<mutators>
-						<mutator name="DIFFUSE_TEX" values="0"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="specColor" type="Vec3" const="1">
-					<mutators>
-						<mutator name="SPECULAR_TEX" values="0"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="roughness" type="F32" const="1">
-					<mutators>
-						<mutator name="ROUGHNESS_TEX" values="0"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="metallic" type="F32" const="1">
-					<mutators>
-						<mutator name="METAL_TEX" values="0"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="emission" type="Vec3" const="1">
-					<mutators>
-						<mutator name="EMISSIVE_TEX" values="0"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="heightMapScale" type="F32" const="1">
-					<mutators>
-						<mutator name="PARALLAX" values="1"/>
-						<mutator name="PASS" values="0"/>
-						<mutator name="LOD" values="0"/>
-					</mutators>
-				</input>
-				<input name="subsurface" type="F32" const="1">
-					<mutators>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-
-				<!-- Textures -->
-				<input name="diffTex" type="sampler2D">
-					<mutators>
-						<mutator name="DIFFUSE_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="specTex" type="sampler2D">
-					<mutators>
-						<mutator name="SPECULAR_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="roughnessTex" type="sampler2D">
-					<mutators>
-						<mutator name="ROUGHNESS_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="metalTex" type="sampler2D">
-					<mutators>
-						<mutator name="METAL_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-				<input name="normalTex" type="sampler2D">
-					<mutators>
-						<mutator name="NORMAL_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-						<mutator name="LOD" values="0 1"/>
-					</mutators>
-				</input>
-				<input name="heightTex" type="sampler2D">
-					<mutators>
-						<mutator name="PARALLAX" values="1"/>
-						<mutator name="PASS" values="0"/>
-						<mutator name="LOD" values="0"/>
-					</mutators>
-				</input>
-				<input name="emissiveTex" type="sampler2D">
-					<mutators>
-						<mutator name="EMISSIVE_TEX" values="1"/>
-						<mutator name="PASS" values="0"/>
-					</mutators>
-				</input>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/GBufferCommonFrag.glsl>
-
-void main()
-{
-#if PASS == PASS_GB_FS
-#	if heightTex_DEFINED
-		Vec2 uv =  computeTextureCoordParallax(heightTex, in_uv, heightMapScale);
-#	else
-		Vec2 uv = in_uv;
-#	endif
-
-#	if diffTex_DEFINED
-		Vec3 diffColor = texture(diffTex, uv).rgb;
-#	endif
-
-#	if specTex_DEFINED
-		Vec3 specColor = texture(specTex, uv).rgb;
-#	endif
-
-#	if roughnessTex_DEFINED
-		F32 roughness = texture(roughnessTex, uv).r;
-#	endif
-
-#	if metalTex_DEFINED
-		F32 metallic = texture(metalTex, uv).r;
-#	endif
-
-#	if normalTex_DEFINED
-		Vec3 normal = readNormalFromTexture(normalTex, uv);
-#	else
-		Vec3 normal = normalize(in_normal);
-#	endif
-
-#	if emissiveTex_DEFINED
-		Vec3 emission = texture(emissiveTex, uv).rgb;
-#	endif
-
-	writeRts(diffColor, normal, specColor, roughness, subsurface, emission, metallic);
-#elif PASS == PASS_EZ
-	out_msRt0 = Vec4(0.0);
-	out_msRt1 = Vec4(0.0);
-	out_msRt2 = Vec4(0.0);
-#endif
-}
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 104 - 0
shaders/GBufferGeneric.glslp

@@ -0,0 +1,104 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator instanced INSTANCE_COUNT 1 2 4 8 16 32 64
+#pragma anki mutator LOD 0 1 2
+#pragma anki mutator PASS 0 1 2
+#pragma anki mutator DIFFUSE_TEX 0 1
+#pragma anki mutator SPECULAR_TEX 0 1
+#pragma anki mutator ROUGHNESS_TEX 0 1
+#pragma anki mutator METAL_TEX 0 1
+#pragma anki mutator NORMAL_TEX 0 1
+#pragma anki mutator PARALLAX 0 1
+#pragma anki mutator EMISSIVE_TEX 0 1
+#pragma anki mutator BONES 0 1
+
+#pragma anki input instanced Mat4 mvp
+#pragma anki input instanced Mat3 rotationMat "PASS == 0"
+#pragma anki input instanced Mat4 modelViewMat "PASS == 0 && PARALLAX == 1"
+
+#pragma anki input const Vec3 diffColor "DIFFUSE_TEX == 0 && PASS == 0"
+#pragma anki input const Vec3 specColor "SPECULAR_TEX == 0 && PASS == 0"
+#pragma anki input const F32 roughness "ROUGHNESS_TEX == 0 && PASS == 0"
+#pragma anki input const F32 metallic "METAL_TEX == 0 && PASS == 0"
+#pragma anki input const Vec3 emission "EMISSIVE_TEX == 0 && PASS == 0"
+#pragma anki input const F32 heightMapScale "PARALLAX == 1 && PASS == 0 && LOD == 0"
+#pragma anki input const F32 subsurface "PASS == 0"
+#pragma anki input sampler2D diffTex "DIFFUSE_TEX == 1 && PASS == 0"
+#pragma anki input sampler2D specTex "SPECULAR_TEX == 1 && PASS == 0"
+#pragma anki input sampler2D roughnessTex "ROUGHNESS_TEX == 1 && PASS == 0"
+#pragma anki input sampler2D metalTex "METAL_TEX == 1 && PASS == 0"
+#pragma anki input sampler2D normalTex "NORMAL_TEX == 1 && PASS == 0 && LOD < 2"
+#pragma anki input sampler2D heightTex "PARALLAX == 1 && PASS == 0 && LOD == 0"
+#pragma anki input sampler2D emissiveTex "EMISSIVE_TEX == 1 && PASS == 0"
+
+#pragma anki start vert
+#include <shaders/GBufferCommonVert.glsl>
+
+void main()
+{
+#if BONES
+	skinning();
+#endif
+
+#if PASS == PASS_GB_FS
+	positionUvNormalTangent(mvp, rotationMat);
+
+#	if PARALLAX
+	parallax(modelViewMat);
+#	endif
+#else
+	gl_Position = mvp * Vec4(g_position, 1.0);
+#endif
+}
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/GBufferCommonFrag.glsl>
+
+void main()
+{
+#if PASS == PASS_GB_FS
+#	if heightTex_DEFINED
+	Vec2 uv = computeTextureCoordParallax(heightTex, in_uv, heightMapScale);
+#	else
+	Vec2 uv = in_uv;
+#	endif
+
+#	if diffTex_DEFINED
+	Vec3 diffColor = texture(diffTex, uv).rgb;
+#	endif
+
+#	if specTex_DEFINED
+	Vec3 specColor = texture(specTex, uv).rgb;
+#	endif
+
+#	if roughnessTex_DEFINED
+	F32 roughness = texture(roughnessTex, uv).r;
+#	endif
+
+#	if metalTex_DEFINED
+	F32 metallic = texture(metalTex, uv).r;
+#	endif
+
+#	if normalTex_DEFINED
+	Vec3 normal = readNormalFromTexture(normalTex, uv);
+#	else
+	Vec3 normal = normalize(in_normal);
+#	endif
+
+#	if emissiveTex_DEFINED
+	Vec3 emission = texture(emissiveTex, uv).rgb;
+#	endif
+
+	writeRts(diffColor, normal, specColor, roughness, subsurface, emission, metallic);
+#elif PASS == PASS_EZ
+	out_msRt0 = Vec4(0.0);
+	out_msRt1 = Vec4(0.0);
+	out_msRt2 = Vec4(0.0);
+#endif
+}
+
+#pragma anki end

+ 15 - 30
shaders/GBufferPost.ankiprog → shaders/GBufferPost.glslp

@@ -1,19 +1,13 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<inputs>
-		<input name="CLUSTER_COUNT_X" type="U32" const="1"/>
-		<input name="CLUSTER_COUNT_Y" type="U32" const="1"/>
-		<input name="CLUSTER_COUNT_Z" type="U32" const="1"/>
-	</inputs>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const U32 CLUSTER_COUNT_X
+#pragma anki input const U32 CLUSTER_COUNT_Y
+#pragma anki input const U32 CLUSTER_COUNT_Z
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) out Vec2 out_uv;
@@ -32,11 +26,9 @@ void main()
 
 	out_clusterIJ = Vec2(CLUSTER_COUNT_X, CLUSTER_COUNT_Y) * out_uv;
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Pack.glsl>
 #include <shaders/glsl_cpp_common/Clusterer.h>
 #include <shaders/Functions.glsl>
@@ -84,7 +76,7 @@ void main()
 	U32 idxOffset;
 	{
 		U32 k = computeClusterK(u_clustererMagic, worldPos);
-		U32 clusterIdx = 
+		U32 clusterIdx =
 			k * (CLUSTER_COUNT_X * CLUSTER_COUNT_Y) + U32(in_clusterIJ.y) * CLUSTER_COUNT_X + U32(in_clusterIJ.x);
 
 		idxOffset = u_clusters[clusterIdx];
@@ -113,7 +105,7 @@ void main()
 
 		// Clamp the tex coords. Expect a border in the texture atlas
 		texCoords2 = saturate(texCoords2);
-	
+
 		// Read diffuse
 		Vec2 diffUv = mad(texCoords2, decal.m_diffUv.zw, decal.m_diffUv.xy);
 		Vec4 decalDiff = texture(u_diffDecalTex, diffUv);
@@ -136,11 +128,4 @@ void main()
 	out_color0 = outDiffuse;
 	out_color1 = outSpecular;
 }
-			]]></source>
-		</shader>
-	</shaders>
-
-</shaderProgram>
-
-
-
+#pragma anki end

+ 0 - 40
shaders/GaussianBlur.ankiprog

@@ -1,40 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="ORIENTATION" values="0 1 2"/> <!-- 0: VERTICAL, 1: HORIZONTAL, 2: BOX -->
-		<mutator name="KERNEL_SIZE" values="3 5 7 9 11 13 15"/>
-		<mutator name="COLOR_COMPONENTS" values="4 3 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="TEXTURE_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#if ORIENTATION == 0
-#	define VERTICAL 1
-#elif ORIENTATION == 1
-#	define HORIZONTAL 1
-#else
-#	define BOX 1
-#endif
-
-#include <shaders/GaussianBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-

+ 7 - 8
shaders/GaussianBlur.glsl

@@ -4,14 +4,15 @@
 // http://www.anki3d.org/LICENSE
 
 // Defines it needs:
-// HORIZONTAL | VERTICAL | BOX
-// COLOR_COMPONENTS
 // WORKGROUP_SIZE (only for compute)
-// TEXTURE_SIZE
-// KERNEL_SIZE (must be odd number)
 
-#ifndef ANKI_SHADERS_GAUSSIAN_BLUR_GLSL
-#define ANKI_SHADERS_GAUSSIAN_BLUR_GLSL
+#pragma once
+
+#pragma anki mutator ORIENTATION 0 1 2 // 0: VERTICAL, 1: HORIZONTAL, 2: BOX
+#pragma anki mutator KERNEL_SIZE 3 5 7 9 11 13 15
+#pragma anki mutator COLOR_COMPONENTS 4 3 1
+
+#pragma anki input const UVec2 TEXTURE_SIZE
 
 #include <shaders/GaussianBlurCommon.glsl>
 
@@ -115,5 +116,3 @@ void main()
 	out_color = color;
 #endif
 }
-
-#endif

+ 20 - 0
shaders/GaussianBlur.glslp

@@ -0,0 +1,20 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki frag
+#if ORIENTATION == 0
+#	define VERTICAL 1
+#elif ORIENTATION == 1
+#	define HORIZONTAL 1
+#else
+#	define BOX 1
+#endif
+
+#include <shaders/GaussianBlur.glsl>
+#pragma anki end

+ 1 - 4
shaders/GaussianBlurCommon.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GAUSSIAN_BLUR_COMMON_GLSL
-#define ANKI_SHADERS_GAUSSIAN_BLUR_COMMON_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -36,5 +35,3 @@ const F32 WEIGHTS[STEP_COUNT + 1u] = {0.198596, 0.175713, 0.121703, 0.065984, 0.
 // It's BOX_WEIGHTS[0] for the a texels. BOX_WEIGHTS[1] for the b texels. BOX_WEIGHTS[2] for the c texels.
 // Note: BOX_WEIGHTS[0] + BOX_WEIGHTS[1] * 4 + BOX_WEIGHTS[2] * 4 == 1.0
 const Vec3 BOX_WEIGHTS = Vec3(0.25, 0.125, 0.0625);
-
-#endif

+ 0 - 35
shaders/GaussianBlurCompute.ankiprog

@@ -1,35 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="ORIENTATION" values="0 1 2"/> <!-- 0: VERTICAL, 1: HORIZONTAL, 2: BOX -->
-		<mutator name="KERNEL_SIZE" values="3 5 7 9 11 13 15"/>
-		<mutator name="COLOR_COMPONENTS" values="4 3 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="TEXTURE_SIZE" type="UVec2" const="1"/>
-                <input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#if ORIENTATION == 0
-#	define VERTICAL 1
-#elif ORIENTATION == 1
-#	define HORIZONTAL 1
-#else
-#	define BOX 1
-#endif
-
-#include <shaders/GaussianBlur.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-

+ 18 - 0
shaders/GaussianBlurCompute.glslp

@@ -0,0 +1,18 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const UVec2 WORKGROUP_SIZE
+
+#pragma anki start comp
+#if ORIENTATION == 0
+#	define VERTICAL 1
+#elif ORIENTATION == 1
+#	define HORIZONTAL 1
+#else
+#	define BOX 1
+#endif
+
+#include <shaders/GaussianBlur.glsl>
+#pragma anki end

+ 14 - 25
shaders/Irradiance.ankiprog → shaders/Irradiance.glslp

@@ -1,26 +1,18 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="ENV_TEX_TILE_SIZE" type="U32" const="1"/>
-				<input name="ENV_TEX_MIP" type="F32" const="1"/>
-			</inputs>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-			<source><![CDATA[
 // Compute the irradiance given an environment map
 
+#pragma anki input const U32 ENV_TEX_TILE_SIZE
+#pragma anki input const F32 ENV_TEX_MIP
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
 #include <shaders/Functions.glsl>
 
 layout(location = 0) in Vec2 in_uv;
@@ -53,7 +45,7 @@ void main()
 
 				Vec3 r = getCubemapDirection(ndc, f);
 				F32 lambert = dot(r, ri);
-				
+
 				if(lambert > 0.0)
 				{
 					Vec3 col = textureLod(u_envTex, Vec4(r, texArrIdx), ENV_TEX_MIP).rgb;
@@ -65,7 +57,4 @@ void main()
 
 	out_color = outCol / PI;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 10 - 21
shaders/LensFlareSprite.ankiprog → shaders/LensFlareSprite.glslp

@@ -1,17 +1,11 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<inputs>
-				<input name="MAX_SPRITES" type="U32" const="1"/>
-			</inputs>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-			<source><![CDATA[
+#pragma anki input const U32 MAX_SPRITES
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 #include <shaders/glsl_cpp_common/LensFlareSprite.h>
 
@@ -43,11 +37,9 @@ void main()
 
 	out_color = sprite.m_color;
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 layout(ANKI_TEX_BINDING(0, 0)) uniform sampler2DArray u_tex;
@@ -62,7 +54,4 @@ void main()
 	Vec4 col = texture(u_tex, in_uv);
 	out_color = col * in_color;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 10 - 19
shaders/LensFlareUpdateIndirectInfo.ankiprog → shaders/LensFlareUpdateIndirectInfo.glslp

@@ -1,17 +1,11 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<inputs>
-		<input name="IN_DEPTH_MAP_SIZE" type="Vec2" const="1"/>
-	</inputs>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-	<shaders>
-		<shader type="comp">
-			<source><![CDATA[
+#pragma anki input const Vec2 IN_DEPTH_MAP_SIZE
+
+#pragma anki start comp
 #include <shaders/Common.glsl>
 
 const U32 WORKGROUP_SIZE = 8;
@@ -49,10 +43,10 @@ void main()
 	}
 	memoryBarrierShared();
 	barrier();
-	
+
 	// Project the flare
 	U32 flareIdx = gl_WorkGroupID.x;
-	Vec4 posClip =  u_mvp * u_flarePositions[flareIdx];
+	Vec4 posClip = u_mvp * u_flarePositions[flareIdx];
 	Vec3 posNdc = posClip.xyz / posClip.w;
 	F32 depth = posNdc.z;
 
@@ -79,7 +73,4 @@ void main()
 		u_indirectInfo[flareIdx].baseInstance = 0u;
 	}
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 1 - 4
shaders/LightFunctions.glsl

@@ -5,8 +5,7 @@
 
 // Contains functions for light calculations
 
-#ifndef ANKI_SHADERS_LIGHT_FUNCTIONS_GLSL
-#define ANKI_SHADERS_LIGHT_FUNCTIONS_GLSL
+#pragma once
 
 #include <shaders/Functions.glsl>
 #include <shaders/Pack.glsl>
@@ -223,5 +222,3 @@ F32 computeProbeBlendWeight(Vec3 fragPos, // Doesn't need to be inside the AABB
 	// Use saturate because minDist might be negative.
 	return saturate(minDist / fadeDistance);
 }
-
-#endif

+ 23 - 39
shaders/LightShading.ankiprog → shaders/LightShading.glslp

@@ -1,21 +1,15 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<inputs>
-		<input name="CLUSTER_COUNT_X" type="U32" const="1"/>
-		<input name="CLUSTER_COUNT_Y" type="U32" const="1"/>
-		<input name="CLUSTER_COUNT_Z" type="U32" const="1"/>
-		<input name="CLUSTER_COUNT" type="U32" const="1"/>
-		<input name="IR_MIPMAP_COUNT" type="U32" const="1"/>
-	</inputs>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const U32 CLUSTER_COUNT_X
+#pragma anki input const U32 CLUSTER_COUNT_Y
+#pragma anki input const U32 CLUSTER_COUNT_Z
+#pragma anki input const U32 CLUSTER_COUNT
+#pragma anki input const U32 IR_MIPMAP_COUNT
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) out Vec2 out_uv;
@@ -34,11 +28,9 @@ void main()
 
 	out_clusterIJ = Vec2(CLUSTER_COUNT_X, CLUSTER_COUNT_Y) * out_uv;
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Pack.glsl>
 #include <shaders/glsl_cpp_common/Clusterer.h>
 #include <shaders/Functions.glsl>
@@ -86,7 +78,7 @@ void main()
 	U32 idxOffset;
 	{
 		U32 k = computeClusterK(u_clustererMagic, worldPos);
-		U32 clusterIdx = 
+		U32 clusterIdx =
 			k * (CLUSTER_COUNT_X * CLUSTER_COUNT_Y) + U32(in_clusterIJ.y) * CLUSTER_COUNT_X + U32(in_clusterIJ.x);
 
 		idxOffset = u_clusters[clusterIdx];
@@ -119,11 +111,8 @@ void main()
 
 		ANKI_BRANCH if(light.m_diffuseColorTileSize.w >= 0.0)
 		{
-			F32 shadow = computeShadowFactorOmni(frag2Light, 
-				light.m_radiusPad1.x, 
-				light.m_atlasTiles, 
-				light.m_diffuseColorTileSize.w,
-				u_shadowTex);
+			F32 shadow = computeShadowFactorOmni(
+				frag2Light, light.m_radiusPad1.x, light.m_atlasTiles, light.m_diffuseColorTileSize.w, u_shadowTex);
 			lambert *= shadow;
 		}
 
@@ -139,18 +128,18 @@ void main()
 
 		LIGHTING_COMMON_BRDF();
 
-		F32 spot = computeSpotFactor(
-			l, light.m_outerCosInnerCos.x, light.m_outerCosInnerCos.y, light.m_lightDirRadius.xyz);
+		F32 spot =
+			computeSpotFactor(l, light.m_outerCosInnerCos.x, light.m_outerCosInnerCos.y, light.m_lightDirRadius.xyz);
 
 		F32 shadowmapLayerIdx = light.m_diffuseColorShadowmapId.w;
 		ANKI_BRANCH if(shadowmapLayerIdx >= 0.0)
 		{
-			F32 shadow = computeShadowFactorSpot(
-				light.m_texProjectionMat, worldPos, light.m_lightDirRadius.w, u_shadowTex);
+			F32 shadow =
+				computeShadowFactorSpot(light.m_texProjectionMat, worldPos, light.m_lightDirRadius.w, u_shadowTex);
 			lambert *= shadow;
 		}
 
-		out_color += 
+		out_color +=
 			(diffC + specC) * light.m_diffuseColorShadowmapId.rgb * (att * spot * max(gbuffer.m_subsurface, lambert));
 	}
 
@@ -178,9 +167,4 @@ void main()
 	}
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-
-</shaderProgram>
-
+#pragma anki end

+ 14 - 27
shaders/LumaAwareBlur.ankiprog → shaders/LumaAwareBlur.glslp

@@ -1,29 +1,19 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="HORIZONTAL" values="0 1"/>
-		<mutator name="KERNEL_SIZE" values="3 5 7 9 11 13 15"/>
-		<mutator name="COLOR_COMPONENTS" values="4 3 1"/>
-	</mutators>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+#pragma anki mutator HORIZONTAL 0 1
+#pragma anki mutator KERNEL_SIZE 3 5 7 9 11 13 15
+#pragma anki mutator COLOR_COMPONENTS 4 3 1
+
+#pragma anki input const UVec2 TEXTURE_SIZE
 
-		<shader type="frag">
-			<inputs>
-				<input name="TEXTURE_SIZE" type="UVec2" const="1"/>
-			</inputs>
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/GaussianBlurCommon.glsl>
 #include <shaders/Tonemapping.glsl>
 
@@ -87,7 +77,4 @@ void main()
 
 	out_color = out_color / weight;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 1 - 4
shaders/Pack.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_PACK_GLSL
-#define ANKI_SHADERS_PACK_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -184,5 +183,3 @@ void readGBuffer(sampler2D rt0, sampler2D rt1, sampler2D rt2, Vec2 uv, F32 lod,
 	// Compute diffuse
 	g.m_diffuse = g.m_diffuse - g.m_diffuse * g.m_metallic;
 }
-
-#endif

+ 24 - 36
shaders/Reflections.ankiprog → shaders/Reflections.glslp

@@ -1,36 +1,27 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="VARIANT" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="FB_SIZE" type="UVec2" const="1"/>
-				<input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-				<input name="MAX_STEPS" type="U32" const="1"/>
-				<input name="LIGHT_BUFFER_MIP_COUNT" type="U32" const="1"/>
-				<input name="HIZ_MIP_COUNT" type="U32" const="1"/>
-				<input name="CLUSTER_COUNT_X" type="U32" const="1"/>
-				<input name="CLUSTER_COUNT_Y" type="U32" const="1"/>
-				<input name="CLUSTER_COUNT_Z" type="U32" const="1"/>
-				<input name="IR_MIPMAP_COUNT" type="U32" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
 // if VARIANT==0 then the checkerboard pattern is (render on 'v'):
 // -----
 // |v| |
 // | |v|
 // -----
 
+#pragma anki mutator VARIANT 0 1
+
+#pragma anki input const UVec2 FB_SIZE
+#pragma anki input const UVec2 WORKGROUP_SIZE
+#pragma anki input const U32 MAX_STEPS
+#pragma anki input const U32 LIGHT_BUFFER_MIP_COUNT
+#pragma anki input const U32 HIZ_MIP_COUNT
+#pragma anki input const U32 CLUSTER_COUNT_X
+#pragma anki input const U32 CLUSTER_COUNT_Y
+#pragma anki input const U32 CLUSTER_COUNT_Z
+#pragma anki input const U32 IR_MIPMAP_COUNT
 
+#pragma anki start comp
 #include <shaders/Functions.glsl>
 #include <shaders/Pack.glsl>
 #include <shaders/glsl_cpp_common/Clusterer.h>
@@ -117,7 +108,7 @@ Vec4 doSslr(Vec3 r, Vec3 n, Vec3 viewPos, Vec2 uv, F32 depth, F32 roughness)
 	U32 j = gl_GlobalInvocationID.y & 1u;
 	const U32 STEPS_ARR[4] = U32[](6u, 25u, 13u, 18u);
 	U32 step = STEPS_ARR[l * 2u + j];
-	
+
 	// Iterate
 	Bool found = false;
 	Vec3 raySample;
@@ -150,7 +141,7 @@ Vec4 doSslr(Vec3 r, Vec3 n, Vec3 viewPos, Vec2 uv, F32 depth, F32 roughness)
 		}
 	}
 
-	//return Vec4(heatmap(F32(iterations) / F32(MAX_STEPS)), 1.0);
+	// return Vec4(heatmap(F32(iterations) / F32(MAX_STEPS)), 1.0);
 
 	if(found)
 	{
@@ -189,12 +180,12 @@ void readReflectionsAndIrradianceFromProbes(
 		// Compute blend weight
 		F32 blendWeight = computeProbeBlendWeight(worldPos, aabbMin, aabbMax, 0.2);
 		totalBlendWeight += blendWeight;
-		
+
 		// Sample reflections
 		Vec3 cubeUv = intersectProbe(worldPos, reflDir, aabbMin, aabbMax, probeOrigin);
 		Vec3 c = textureLod(u_reflectionsTex, Vec4(cubeUv, cubemapIndex), reflLod).rgb;
 		specIndirect += c * blendWeight;
-		
+
 		// Sample irradiance
 		cubeUv = intersectProbe(worldPos, normal, aabbMin, aabbMax, probeOrigin);
 		c = textureLod(u_irradianceTex, Vec4(cubeUv, cubemapIndex), 0.0).rgb;
@@ -276,7 +267,7 @@ void main()
 		// Skip decals
 		U32 count = u_lightIndices[idxOffset++];
 		idxOffset += count;
-		
+
 		// Skip point lights
 		count = u_lightIndices[idxOffset++];
 		idxOffset += count;
@@ -314,7 +305,7 @@ void main()
 	Bool pickRightNeighbour = (fixedInvocationId.y & 1) == 0;
 #endif
 	I32 xOffset = (pickRightNeighbour) ? 1 : -1;
-	
+
 	readPixel.x = I32(gl_LocalInvocationID.x) + xOffset;
 	readPixel.x = clamp(readPixel.x, 0, I32(WORKGROUP_SIZE.x - 1));
 
@@ -326,7 +317,4 @@ void main()
 	imageStore(out_reflAndIndirect, fixedInvocationId, Vec4(outColor, 0.0));
 	imageStore(out_reflAndIndirect, storePixel, Vec4(missingColor, 0.0));
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 12 - 26
shaders/SceneDebug.ankiprog → shaders/SceneDebug.glslp

@@ -1,22 +1,14 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="COLOR_TEXTURE" values="0 1"/>
-		<mutator name="DITHERED_DEPTH_TEST" values="0 1"/> 
-	</mutators>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-	<inputs>
-		<input name="INSTANCE_COUNT" type="U32" const="1"/>
-	</inputs>
+#pragma anki mutator COLOR_TEXTURE 0 1
+#pragma anki mutator DITHERED_DEPTH_TEST 0 1
 
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+#pragma anki input const U32 INSTANCE_COUNT
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) in Vec3 in_position;
@@ -43,11 +35,9 @@ void main()
 #endif
 	gl_Position = u_mvp[gl_InstanceID] * Vec4(in_position, 1.0);
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 #if COLOR_TEXTURE == 1
@@ -89,8 +79,4 @@ void main()
 	out_color = u_color;
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-
+#pragma anki end

+ 14 - 28
shaders/ScreenSpaceLensFlare.ankiprog → shaders/ScreenSpaceLensFlare.glslp

@@ -1,29 +1,18 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-
-<!--
-Screen space lens flare. Used the technique from here
-http://john-chapman-graphics.blogspot.no/2013/02/pseudo-lens-flare.html
--->
-
-<shaderProgram>
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+// Screen space lens flare. Used the technique from here
+// http://john-chapman-graphics.blogspot.no/2013/02/pseudo-lens-flare.html
 
-		<shader type="frag">
-			<inputs>
-				<input name="INPUT_TEX_SIZE" type="UVec2" const="1"/>
-			</inputs>
+#pragma anki input const UVec2 INPUT_TEX_SIZE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
 
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 #define MAX_GHOSTS 4
@@ -96,7 +85,4 @@ void main()
 	// Write
 	out_color = result;
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 0 - 37
shaders/Ssao.ankiprog

@@ -1,37 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="USE_NORMAL" values="0 1"/>
-		<mutator name="SOFT_BLUR" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
-
-		<shader type="frag">
-			<inputs>
-				<input name="NOISE_MAP_SIZE" type="U32" const="1"/>
-				<input name="FB_SIZE" type="UVec2" const="1"/>
-				<input name="RADIUS" type="F32" const="1"/>
-				<input name="BIAS" type="F32" const="1"/>
-				<input name="STRENGTH" type="F32" const="1"/>
-				<input name="SAMPLE_COUNT" type="U32" const="1"/>
-				<input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/Ssao.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
-

+ 12 - 4
shaders/Ssao.glsl

@@ -5,8 +5,18 @@
 
 // Contains the complete code for a SSAO pass. It requires some variables to be defined before this file is included.
 
-#ifndef ANKI_SHADERS_SSAO_GLSL
-#define ANKI_SHADERS_SSAO_GLSL
+#pragma anki mutator USE_NORMAL 0 1
+#pragma anki mutator SOFT_BLUR 0 1
+
+#pragma anki input const U32 NOISE_MAP_SIZE
+#pragma anki input const UVec2 FB_SIZE
+#pragma anki input const F32 RADIUS
+#pragma anki input const F32 BIAS
+#pragma anki input const F32 STRENGTH
+#pragma anki input const U32 SAMPLE_COUNT
+#pragma anki input const UVec2 WORKGROUP_SIZE
+
+#pragma once
 
 #include <shaders/Common.glsl>
 #include <shaders/Pack.glsl>
@@ -236,5 +246,3 @@ void main(void)
 	out_color = ssao;
 #endif
 }
-
-#endif

+ 12 - 0
shaders/Ssao.glslp

@@ -0,0 +1,12 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
+#include <shaders/Ssao.glsl>
+#pragma anki end

+ 0 - 30
shaders/SsaoCompute.ankiprog

@@ -1,30 +0,0 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="USE_NORMAL" values="0 1"/>
-		<mutator name="SOFT_BLUR" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="NOISE_MAP_SIZE" type="U32" const="1"/>
-				<input name="FB_SIZE" type="UVec2" const="1"/>
-				<input name="RADIUS" type="F32" const="1"/>
-				<input name="BIAS" type="F32" const="1"/>
-				<input name="STRENGTH" type="F32" const="1"/>
-				<input name="SAMPLE_COUNT" type="U32" const="1"/>
-				<input name="WORKGROUP_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
-#include <shaders/Ssao.glsl>
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>

+ 8 - 0
shaders/SsaoCompute.glslp

@@ -0,0 +1,8 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki start comp
+#include <shaders/Ssao.glsl>
+#pragma anki end

+ 26 - 38
shaders/TemporalAAResolve.ankiprog → shaders/TemporalAAResolve.glslp

@@ -1,31 +1,21 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="SHARPEN" values="0 1 2"/> <!-- 0: disabled, 1: vertical, 2: horizontal -->
-		<mutator name="VARIANCE_CLIPPING" values="0 1"/>
-		<mutator name="TONEMAP_FIX" values="0 1"/>
-		<mutator name="YCBCR" values="0 1"/>
-	</mutators>
-
-	<inputs>
-		<input name="VARIANCE_CLIPPING_GAMMA" type="F32" const="1"/>
-		<input name="BLEND_FACTOR" type="F32" const="1"/>
-	</inputs>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator SHARPEN 0 1 2 // 0: disabled, 1: vertical, 2: horizontal
+#pragma anki mutator VARIANCE_CLIPPING 0 1
+#pragma anki mutator TONEMAP_FIX 0 1
+#pragma anki mutator YCBCR 0 1
+
+#pragma anki input const F32 VARIANCE_CLIPPING_GAMMA
+#pragma anki input const F32 BLEND_FACTOR
+
+#pragma anki start vert
 #include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Functions.glsl>
 #include <shaders/Pack.glsl>
 #include <shaders/Tonemapping.glsl>
@@ -44,17 +34,17 @@ layout(ANKI_UBO_BINDING(0, 0), std140, row_major) uniform u0_
 };
 
 #if TONEMAP_FIX
-#define TONEMAPPING_SET 0
-#define TONEMAPPING_BINDING 1
-#include <shaders/TonemappingResources.glsl>
+#	define TONEMAPPING_SET 0
+#	define TONEMAPPING_BINDING 1
+#	include <shaders/TonemappingResources.glsl>
 #endif
 
 #if YCBCR
-#define sample(s, uv) rgbToYCbCr(textureLod(s, uv, 0.0).rgb)
-#define sampleOffset(s, uv, x, y) rgbToYCbCr(textureLodOffset(s, uv, 0.0, IVec2(x, y)).rgb)
+#	define sample(s, uv) rgbToYCbCr(textureLod(s, uv, 0.0).rgb)
+#	define sampleOffset(s, uv, x, y) rgbToYCbCr(textureLodOffset(s, uv, 0.0, IVec2(x, y)).rgb)
 #else
-#define sample(s, uv) textureLod(s, uv, 0.0).rgb
-#define sampleOffset(s, uv, x, y) textureLodOffset(s, uv, 0.0, IVec2(x, y)).rgb
+#	define sample(s, uv) textureLod(s, uv, 0.0).rgb
+#	define sampleOffset(s, uv, x, y) textureLodOffset(s, uv, 0.0, IVec2(x, y)).rgb
 #endif
 
 Vec3 sharpen()
@@ -116,7 +106,7 @@ void main()
 #elif TONEMAP_FIX
 	F32 lum0 = computeLuminance(tonemap(crntCol, u_exposureThreshold0));
 	F32 lum1 = computeLuminance(tonemap(historyCol, u_exposureThreshold0));
-	//F32 maxLum = computeLuminance(tonemap(boxMax, u_exposureThreshold0));
+	// F32 maxLum = computeLuminance(tonemap(boxMax, u_exposureThreshold0));
 	F32 maxLum = 1.0;
 #else
 	F32 lum0 = computeLuminance(crntCol);
@@ -136,7 +126,5 @@ void main()
 	out_color = mix(historyCol, crntCol, feedback);
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+
+#pragma anki end

+ 1 - 3
shaders/Tonemapping.glsl

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_TONEMAP_GLSL
-#define ANKI_SHADERS_TONEMAP_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -67,4 +66,3 @@ Vec3 tonemap(Vec3 color, F32 avgLum, F32 threshold)
 	F32 exposure = computeExposure(avgLum, threshold);
 	return tonemap(color, exposure);
 }
-#endif

+ 9 - 18
shaders/TonemappingAverageLuminance.ankiprog → shaders/TonemappingAverageLuminance.glslp

@@ -1,17 +1,11 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<shaders>
-		<shader type="comp">
-			<inputs>
-				<input name="INPUT_TEX_SIZE" type="UVec2" const="1"/>
-			</inputs>
-
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki input const UVec2 INPUT_TEX_SIZE
+
+#pragma anki start comp
 #define LOG_AVG 0
 
 #include <shaders/Common.glsl>
@@ -97,7 +91,4 @@ void main()
 		u_exposureThreshold0 = computeExposure(u_averageLuminance, 0.0);
 	}
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+#pragma anki end

+ 1 - 4
shaders/TonemappingResources.glsl

@@ -5,8 +5,7 @@
 
 // Tonemapping resources
 
-#ifndef ANKI_SHADERS_TONEMAPPING_RESOURCES_GLSL
-#define ANKI_SHADERS_TONEMAPPING_RESOURCES_GLSL
+#pragma once
 
 #include <shaders/Common.glsl>
 
@@ -33,5 +32,3 @@ layout(std140, ANKI_UBO_BINDING(TONEMAPPING_SET, TONEMAPPING_BINDING)) uniform t
 
 #define u_averageLuminance u_averageLuminanceExposurePad2.x
 #define u_exposureThreshold0 u_averageLuminanceExposurePad2.y
-
-#endif

+ 16 - 25
shaders/TraditionalDeferredShading.ankiprog → shaders/TraditionalDeferredShading.glslp

@@ -1,20 +1,14 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-
-<!-- Classic deferred lighting shader -->
-
-<shaderProgram>
-	<mutators>
-		<mutator name="LIGHT_TYPE" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+// Classic deferred lighting shader
+
+#pragma anki mutator LIGHT_TYPE 0 1
+
+// VERT
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) in Vec3 in_position;
@@ -33,11 +27,10 @@ void main()
 {
 	gl_Position = u_mvp * Vec4(in_position, 1.0);
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+// FRAG
+#pragma anki start frag
 #include <shaders/Pack.glsl>
 #include <shaders/LightFunctions.glsl>
 #include <shaders/glsl_cpp_common/TraditionalDeferredShading.h>
@@ -118,7 +111,5 @@ void main()
 	out_color = (diffC + specC) * u_ldiff * (att * spot * max(lambert, gbuffer.m_subsurface));
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+
+#pragma anki end

+ 11 - 21
shaders/Ui.ankiprog → shaders/Ui.glslp

@@ -1,17 +1,11 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="TEXTURE_TYPE" values="0 1"/> <!-- 0: no tex, 1: rgba tex -->
-	</mutators>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
 
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
+#pragma anki mutator TEXTURE_TYPE 0 1 // 0: no tex, 1: rgba tex
+
+#pragma anki start vert
 #include <shaders/Common.glsl>
 
 layout(location = 0) in Vec2 in_pos;
@@ -45,11 +39,9 @@ void main()
 	Vec2 pos = u_transform.xy * in_pos + u_transform.zw;
 	gl_Position = Vec4(pos, 0.0, 1.0);
 }
-			]]></source>
-		</shader>
+#pragma anki end
 
-		<shader type="frag">
-			<source><![CDATA[
+#pragma anki start frag
 #include <shaders/Common.glsl>
 
 #if TEXTURE_TYPE > 0
@@ -71,7 +63,5 @@ void main()
 	out_col = in_col * texture(u_tex, in_uv);
 #endif
 }
-			]]></source>
-		</shader>
-	</shaders>
-</shaderProgram>
+
+#pragma anki end

+ 21 - 42
shaders/VolumetricFog.ankiprog → shaders/VolumetricFog.glslp

@@ -1,29 +1,19 @@
-<!-- 
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
-All rights reserved.
-Code licensed under the BSD License.
-http://www.anki3d.org/LICENSE
--->
-<shaderProgram>
-	<mutators>
-		<mutator name="ENABLE_SHADOWS" values="0 1"/>
-	</mutators>
-
-	<shaders>
-		<shader type="vert">
-			<source><![CDATA[
-#include <shaders/QuadVert.glsl>
-			]]></source>
-		</shader>
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma anki mutator ENABLE_SHADOWS 0 1
 
-		<shader type="frag">
-			<inputs>
-				<input name="FB_SIZE" type="UVec2" const="1"/>
-				<input name="CLUSTER_COUNT" type="UVec3" const="1"/>
-				<input name="NOISE_MAP_SIZE" type="U32" const="1"/>
-			</inputs>
+#pragma anki input const UVec2 FB_SIZE
+#pragma anki input const UVec3 CLUSTER_COUNT
+#pragma anki input const U32 NOISE_MAP_SIZE
 
-			<source><![CDATA[
+#pragma anki start vert
+#include <shaders/QuadVert.glsl>
+#pragma anki end
+
+#pragma anki start frag
 #include <shaders/Common.glsl>
 #include <shaders/Functions.glsl>
 #include <shaders/glsl_cpp_common/Clusterer.h>
@@ -75,11 +65,8 @@ Vec3 computeLightColor(Vec3 fragPos, U32 plightCount, U32 plightIdx, U32 slightC
 #if ENABLE_SHADOWS
 		if(light.m_diffuseColorTileSize.w >= 0.0)
 		{
-			factor *= computeShadowFactorOmni(frag2Light, 
-				light.m_radiusPad1.x, 
-				light.m_atlasTiles,
-				light.m_diffuseColorTileSize.w,
-				u_shadowTex);
+			factor *= computeShadowFactorOmni(
+				frag2Light, light.m_radiusPad1.x, light.m_atlasTiles, light.m_diffuseColorTileSize.w, u_shadowTex);
 		}
 #endif
 
@@ -95,15 +82,14 @@ Vec3 computeLightColor(Vec3 fragPos, U32 plightCount, U32 plightIdx, U32 slightC
 
 		Vec3 l = normalize(frag2Light);
 
-		factor *= computeSpotFactor(
-			l, light.m_outerCosInnerCos.x, light.m_outerCosInnerCos.y, light.m_lightDirRadius.xyz);
+		factor *=
+			computeSpotFactor(l, light.m_outerCosInnerCos.x, light.m_outerCosInnerCos.y, light.m_lightDirRadius.xyz);
 
 #if ENABLE_SHADOWS
 		F32 shadowmapLayerIdx = light.m_diffuseColorShadowmapId.w;
 		if(shadowmapLayerIdx >= 0.0)
 		{
-			factor *= computeShadowFactorSpot(
-				light.m_texProjectionMat, fragPos, light.m_lightDirRadius.w, u_shadowTex);
+			factor *= computeShadowFactorSpot(light.m_texProjectionMat, fragPos, light.m_lightDirRadius.w, u_shadowTex);
 		}
 #endif
 
@@ -206,18 +192,11 @@ void main()
 	// Read history
 	F32 historyFeedback;
 	Vec3 history = readHistory(ndc, historyFeedback);
-	
+
 	// Fix ghosting
 	history = max(history, newCol);
 
 	// Blend
 	out_color = mix(history, newCol, historyFeedback);
 }
-			]]></source>
-		</shader>
-	</shaders>
-
-</shaderProgram>
-
-
-
+#pragma anki end

+ 1 - 4
shaders/glsl_cpp_common/ClusteredShading.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GLSL_CPP_COMMON_CLUSTERED_SHADING_H
-#define ANKI_SHADERS_GLSL_CPP_COMMON_CLUSTERED_SHADING_H
+#pragma once
 
 #include <shaders/glsl_cpp_common/Clusterer.h>
 
@@ -69,5 +68,3 @@ struct Decal
 const U32 SIZEOF_DECAL = 3 * SIZEOF_VEC4 + SIZEOF_MAT4;
 
 ANKI_END_NAMESPACE
-
-#endif

+ 1 - 4
shaders/glsl_cpp_common/Clusterer.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GLSL_CPP_COMMON_CLUSTERER_H
-#define ANKI_SHADERS_GLSL_CPP_COMMON_CLUSTERER_H
+#pragma once
 
 #include <shaders/glsl_cpp_common/Common.h>
 
@@ -46,5 +45,3 @@ ANKI_SHADER_FUNC_INLINE F32 computeClusterFar(ClustererMagicValues magic, U32 k)
 }
 
 ANKI_END_NAMESPACE
-
-#endif

+ 1 - 4
shaders/glsl_cpp_common/Common.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GLSL_CPP_COMMON_COMMON_H
-#define ANKI_SHADERS_GLSL_CPP_COMMON_COMMON_H
+#pragma once
 
 //
 // Macros & functions
@@ -54,5 +53,3 @@ const U32 SIZEOF_VEC4 = 4u * 4u;
 const U32 SIZEOF_MAT4 = 4u * SIZEOF_VEC4;
 
 ANKI_END_NAMESPACE
-
-#endif

+ 1 - 4
shaders/glsl_cpp_common/LensFlareSprite.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GLSL_CPP_COMMON_LENS_FLARE_SPRITE_H
-#define ANKI_SHADERS_GLSL_CPP_COMMON_LENS_FLARE_SPRITE_H
+#pragma once
 
 #include <shaders/glsl_cpp_common/Common.h>
 
@@ -19,5 +18,3 @@ struct LensFlareSprite
 };
 
 ANKI_END_NAMESPACE
-
-#endif

+ 1 - 4
shaders/glsl_cpp_common/TraditionalDeferredShading.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SHADERS_GLSL_CPP_COMMON_TRADITIONAL_DEFERRED_SHADING_H
-#define ANKI_SHADERS_GLSL_CPP_COMMON_TRADITIONAL_DEFERRED_SHADING_H
+#pragma once
 
 #include <shaders/glsl_cpp_common/Common.h>
 
@@ -46,5 +45,3 @@ const UVec2 GBUFFER_RT2_BINDING = UVec2(0, 2);
 const UVec2 GBUFFER_DEPTH_BINDING = UVec2(0, 3);
 
 ANKI_END_NAMESPACE
-
-#endif

+ 3 - 3
src/anki/renderer/Bloom.cpp

@@ -41,7 +41,7 @@ Error Bloom::initExposure(const ConfigSet& config)
 	m_exposure.m_fbDescr.bake();
 
 	// init shaders
-	ANKI_CHECK(getResourceManager().loadResource("shaders/Bloom.ankiprog", m_exposure.m_prog));
+	ANKI_CHECK(getResourceManager().loadResource("shaders/Bloom.glslp", m_exposure.m_prog));
 
 	ShaderProgramResourceConstantValueInitList<1> consts(m_exposure.m_prog);
 	consts.add(
@@ -70,7 +70,7 @@ Error Bloom::initUpscale(const ConfigSet& config)
 	m_upscale.m_fbDescr.bake();
 
 	// init shaders
-	ANKI_CHECK(getResourceManager().loadResource("shaders/BloomUpscale.ankiprog", m_upscale.m_prog));
+	ANKI_CHECK(getResourceManager().loadResource("shaders/BloomUpscale.glslp", m_upscale.m_prog));
 
 	ShaderProgramResourceConstantValueInitList<1> consts(m_upscale.m_prog);
 	consts.add("TEX_SIZE", Vec2(m_upscale.m_width, m_upscale.m_height));
@@ -85,7 +85,7 @@ Error Bloom::initUpscale(const ConfigSet& config)
 Error Bloom::initSslf(const ConfigSet& cfg)
 {
 	ANKI_CHECK(getResourceManager().loadResource("engine_data/LensDirt.ankitex", m_sslf.m_lensDirtTex));
-	ANKI_CHECK(getResourceManager().loadResource("shaders/ScreenSpaceLensFlare.ankiprog", m_sslf.m_prog));
+	ANKI_CHECK(getResourceManager().loadResource("shaders/ScreenSpaceLensFlare.glslp", m_sslf.m_prog));
 
 	ShaderProgramResourceConstantValueInitList<1> consts(m_sslf.m_prog);
 	consts.add("INPUT_TEX_SIZE", UVec2(m_exposure.m_width, m_exposure.m_height));

+ 1 - 1
src/anki/renderer/DebugDrawer.cpp

@@ -23,7 +23,7 @@ Error DebugDrawer::init(Renderer* r)
 	m_r = r;
 
 	// Create the prog and shaders
-	ANKI_CHECK(r->getResourceManager().loadResource("shaders/SceneDebug.ankiprog", m_prog));
+	ANKI_CHECK(r->getResourceManager().loadResource("shaders/SceneDebug.glslp", m_prog));
 	ShaderProgramResourceConstantValueInitList<1> consts(m_prog);
 	consts.add("INSTANCE_COUNT", 1u);
 	ShaderProgramResourceMutationInitList<2> mutations(m_prog);

+ 1 - 1
src/anki/renderer/DepthDownscale.cpp

@@ -59,7 +59,7 @@ Error DepthDownscale::initInternal(const ConfigSet&)
 	}
 
 	// Progs
-	ANKI_CHECK(getResourceManager().loadResource("shaders/DepthDownscale.ankiprog", m_prog));
+	ANKI_CHECK(getResourceManager().loadResource("shaders/DepthDownscale.glslp", m_prog));
 
 	ShaderProgramResourceMutationInitList<3> mutations(m_prog);
 	mutations.add("COPY_TO_CLIENT", 0).add("TYPE", 0).add("SAMPLE_RESOLVE_TYPE", 2);

Някои файлове не бяха показани, защото твърде много файлове са промени