Browse Source

Formatting the shaders and removing some unused

Panagiotis Christopoulos Charitos 10 years ago
parent
commit
7d7e565f42

+ 0 - 1
shaders/Blit.frag.glsl

@@ -15,4 +15,3 @@ void main()
 {
 	outColor = textureRt(uTex, inTexCoords).rgb;
 }
-

+ 3 - 2
shaders/PpsBloom.frag.glsl → shaders/Bloom.frag.glsl

@@ -46,6 +46,7 @@ void main()
 	out_color += readTexture(MIPMAP - 2);
 
 	out_color /= 3.0;
-	out_color = tonemap(out_color, u_averageLuminancePad3.x,
-		u_thresholdScalePad2.x) * u_thresholdScalePad2.y;
+	out_color =
+		tonemap(out_color, u_averageLuminancePad3.x, u_thresholdScalePad2.x)
+		* u_thresholdScalePad2.y;
 }

+ 13 - 6
shaders/Clusterer.glsl

@@ -12,8 +12,12 @@
 
 //==============================================================================
 // Compute the cluster index using the tile index.
-uint computeClusterIndexUsingTileIdx(float near, float clustererMagic,
-	float zVSpace, uint tileIdx, uint tileCountX, uint tileCountY)
+uint computeClusterIndexUsingTileIdx(float near,
+	float clustererMagic,
+	float zVSpace,
+	uint tileIdx,
+	uint tileCountX,
+	uint tileCountY)
 {
 	float fk = sqrt((zVSpace + near) * clustererMagic);
 	uint k = uint(fk);
@@ -23,15 +27,18 @@ uint computeClusterIndexUsingTileIdx(float near, float clustererMagic,
 
 //==============================================================================
 // Compute the cluster index using the gl_FragCoord.xy.
-uint computeClusterIndexUsingFragCoord(float near, float clustererMagic,
-	float zVSpace, uint tileCountX, uint tileCountY)
+uint computeClusterIndexUsingFragCoord(float near,
+	float clustererMagic,
+	float zVSpace,
+	uint tileCountX,
+	uint tileCountY)
 {
 	// Compute tile idx
 	uvec2 f = uvec2(gl_FragCoord.xy) >> 6;
 	uint tileIdx = f.y * tileCountX + f.x;
 
-	return computeClusterIndexUsingTileIdx(near, clustererMagic, zVSpace,
-		tileIdx, tileCountX, tileCountY);
+	return computeClusterIndexUsingTileIdx(
+		near, clustererMagic, zVSpace, tileIdx, tileCountX, tileCountY);
 }
 
 #endif

+ 35 - 39
shaders/FsCommonFrag.glsl

@@ -29,7 +29,7 @@ layout(location = 0) out vec4 out_color;
 
 //==============================================================================
 #if PASS == COLOR
-#	define texture_DEFINED
+#define texture_DEFINED
 #endif
 
 //==============================================================================
@@ -45,7 +45,7 @@ float getAlpha()
 
 //==============================================================================
 #if PASS == COLOR
-#	define writeGBuffer_DEFINED
+#define writeGBuffer_DEFINED
 void writeGBuffer(in vec4 color)
 {
 	out_color = color;
@@ -54,7 +54,7 @@ void writeGBuffer(in vec4 color)
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleAlpha_DEFINED
+#define particleAlpha_DEFINED
 void particleAlpha(in sampler2D tex, in float alpha)
 {
 	vec4 color = texture(tex, gl_PointCoord);
@@ -65,12 +65,11 @@ void particleAlpha(in sampler2D tex, in float alpha)
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleSoftTextureAlpha_DEFINED
-void particleSoftTextureAlpha(in sampler2D depthMap, in sampler2D tex,
-	in float alpha)
+#define particleSoftTextureAlpha_DEFINED
+void particleSoftTextureAlpha(
+	in sampler2D depthMap, in sampler2D tex, in float alpha)
 {
-	vec2 screenSize = vec2(
-		1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
+	vec2 screenSize = vec2(1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
 		1.0 / u_lightingUniforms.rendererSizeTimePad1.y);
 
 	float depth = texture(depthMap, gl_FragCoord.xy * screenSize).r;
@@ -80,7 +79,7 @@ void particleSoftTextureAlpha(in sampler2D depthMap, in sampler2D tex,
 
 	vec4 color = texture(tex, gl_PointCoord);
 	color.a *= alpha;
-	//color.a *= softalpha;
+	// color.a *= softalpha;
 
 	writeGBuffer(color);
 }
@@ -88,7 +87,7 @@ void particleSoftTextureAlpha(in sampler2D depthMap, in sampler2D tex,
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleTextureAlpha_DEFINED
+#define particleTextureAlpha_DEFINED
 void particleTextureAlpha(in sampler2D tex, in float alpha)
 {
 	vec4 color = texture(tex, gl_PointCoord);
@@ -100,12 +99,11 @@ void particleTextureAlpha(in sampler2D tex, in float alpha)
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleSoftColorAlpha_DEFINED
-void particleSoftColorAlpha(in sampler2D depthMap, in vec3 icolor,
-	in float alpha)
+#define particleSoftColorAlpha_DEFINED
+void particleSoftColorAlpha(
+	in sampler2D depthMap, in vec3 icolor, in float alpha)
 {
-	vec2 screenSize = vec2(
-		1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
+	vec2 screenSize = vec2(1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
 		1.0 / u_lightingUniforms.rendererSizeTimePad1.y);
 
 	float depth = texture(depthMap, gl_FragCoord.xy * screenSize).r;
@@ -125,7 +123,7 @@ void particleSoftColorAlpha(in sampler2D depthMap, in vec3 icolor,
 
 //==============================================================================
 #if PASS == COLOR
-#	define computeLightColor_DEFINED
+#define computeLightColor_DEFINED
 vec3 computeLightColor(vec3 diffCol)
 {
 	vec3 outColor = diffCol * u_lightingUniforms.sceneAmbientColor.rgb;
@@ -137,8 +135,7 @@ vec3 computeLightColor(vec3 diffCol)
 		fragPos.z = u_lightingUniforms.projectionParams.z
 			/ (u_lightingUniforms.projectionParams.w + depth);
 
-		vec2 screenSize = vec2(
-			1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
+		vec2 screenSize = vec2(1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
 			1.0 / u_lightingUniforms.rendererSizeTimePad1.y);
 
 		vec2 ndc = gl_FragCoord.xy * screenSize * 2.0 - 1.0;
@@ -171,8 +168,8 @@ vec3 computeLightColor(vec3 diffCol)
 		uint lightId = u_lightIndices[lightOffset++];
 		PointLight light = u_pointLights[lightId];
 
-		vec3 diffC = computeDiffuseColor(
-			diffCol, light.diffuseColorShadowmapId.rgb);
+		vec3 diffC =
+			computeDiffuseColor(diffCol, light.diffuseColorShadowmapId.rgb);
 
 		vec3 frag2Light = light.posRadius.xyz - fragPos;
 		float att = computeAttenuationFactor(light.posRadius.w, frag2Light);
@@ -184,8 +181,8 @@ vec3 computeLightColor(vec3 diffCol)
 		float shadowmapLayerIdx = light.diffuseColorShadowmapId.w;
 		if(light.diffuseColorShadowmapId.w < 128.0)
 		{
-			shadow = computeShadowFactorOmni(frag2Light,
-				shadowmapLayerIdx, -1.0 / light.posRadius.w);
+			shadow = computeShadowFactorOmni(
+				frag2Light, shadowmapLayerIdx, -1.0 / light.posRadius.w);
 		}
 #endif
 
@@ -198,16 +195,16 @@ vec3 computeLightColor(vec3 diffCol)
 		uint lightId = u_lightIndices[lightOffset++];
 		SpotLight light = u_spotLights[lightId];
 
-		vec3 diffC = computeDiffuseColor(
-			diffCol, light.diffuseColorShadowmapId.rgb);
+		vec3 diffC =
+			computeDiffuseColor(diffCol, light.diffuseColorShadowmapId.rgb);
 
 		vec3 frag2Light = light.posRadius.xyz - fragPos;
 		float att = computeAttenuationFactor(light.posRadius.w, frag2Light);
 
 		vec3 l = normalize(frag2Light);
 
-		float spot = computeSpotFactor(
-			l, light.outerCosInnerCos.x,
+		float spot = computeSpotFactor(l,
+			light.outerCosInnerCos.x,
 			light.outerCosInnerCos.y,
 			light.lightDir.xyz);
 
@@ -218,8 +215,8 @@ vec3 computeLightColor(vec3 diffCol)
 		float shadowmapLayerIdx = light.diffuseColorShadowmapId.w;
 		if(shadowmapLayerIdx < 128.0)
 		{
-			shadow = computeShadowFactorSpot(light.texProjectionMat,
-				fragPos, shadowmapLayerIdx, 1);
+			shadow = computeShadowFactorSpot(
+				light.texProjectionMat, fragPos, shadowmapLayerIdx, 1);
 		}
 #endif
 
@@ -227,13 +224,12 @@ vec3 computeLightColor(vec3 diffCol)
 	}
 
 	return outColor;
-
 }
 #endif
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleTextureAlphaLight_DEFINED
+#define particleTextureAlphaLight_DEFINED
 void particleTextureAlphaLight(in sampler2D tex, in float alpha)
 {
 	vec4 color = texture(tex, gl_PointCoord);
@@ -247,12 +243,12 @@ void particleTextureAlphaLight(in sampler2D tex, in float alpha)
 
 //==============================================================================
 #if PASS == COLOR
-#	define particleAnimatedTextureAlphaLight_DEFINED
-void particleAnimatedTextureAlphaLight(sampler2DArray tex, float alpha,
-	float layerCount, float period)
+#define particleAnimatedTextureAlphaLight_DEFINED
+void particleAnimatedTextureAlphaLight(
+	sampler2DArray tex, float alpha, float layerCount, float period)
 {
-	vec4 color = readAnimatedTextureRgba(tex, layerCount, period, gl_PointCoord,
-		anki_u_time);
+	vec4 color = readAnimatedTextureRgba(
+		tex, layerCount, period, gl_PointCoord, anki_u_time);
 	color.a *= alpha;
 
 	vec3 lightColor = computeLightColor(color.rgb);
@@ -263,12 +259,12 @@ void particleAnimatedTextureAlphaLight(sampler2DArray tex, float alpha,
 
 //==============================================================================
 #if PASS == COLOR
-#	define fog_DEFINED
+#define fog_DEFINED
 void fog(in sampler2D depthMap, in vec3 color, in float fogScale)
 {
-	const vec2 screenSize = vec2(
-		1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
-		1.0 / u_lightingUniforms.rendererSizeTimePad1.y);
+	const vec2 screenSize =
+		vec2(1.0 / u_lightingUniforms.rendererSizeTimePad1.x,
+			1.0 / u_lightingUniforms.rendererSizeTimePad1.y);
 
 	vec2 texCoords = gl_FragCoord.xy * screenSize;
 	float depth = texture(depthMap, texCoords).r;

+ 14 - 12
shaders/GaussianBlurGeneric.glsl

@@ -21,15 +21,15 @@ precision mediump float;
 
 // Preprocessor switches sanity checks
 #if !defined(VPASS) && !defined(HPASS)
-#	error See file
+#error See file
 #endif
 
 #if !(defined(COL_RGBA) || defined(COL_RGB) || defined(COL_R))
-#	error See file
+#error See file
 #endif
 
 #if !defined(IMG_DIMENSION)
-#	error See file
+#error See file
 #endif
 
 uniform mediump sampler2D img; ///< Input FAI
@@ -37,25 +37,25 @@ uniform mediump sampler2D img; ///< Input FAI
 in vec2 vTexCoords;
 
 #if !defined(BLURRING_DIST)
-#	define BLURRING_DIST 0.0
+#define BLURRING_DIST 0.0
 #endif
 
 // Determine color type
 #if defined(COL_RGBA)
-#	define COL_TYPE vec4
+#define COL_TYPE vec4
 #elif defined(COL_RGB)
-#	define COL_TYPE vec3
+#define COL_TYPE vec3
 #elif defined(COL_R)
-#	define COL_TYPE float
+#define COL_TYPE float
 #endif
 
 // Determine tex fetch
 #if defined(COL_RGBA)
-#	define TEX_FETCH rgba
+#define TEX_FETCH rgba
 #elif defined(COL_RGB)
-#	define TEX_FETCH rgb
+#define TEX_FETCH rgb
 #elif defined(COL_R)
-#	define TEX_FETCH r
+#define TEX_FETCH r
 #endif
 
 // Weights
@@ -65,9 +65,11 @@ const float weights[4] = float[](
 	0.3162162162, 0.0702702703);
 
 // Calc the kernel
-#define BLURRING_OFFSET_DIM(val, sign_) ((val + float(BLURRING_DIST)) * float(sign_) / float(IMG_DIMENSION))
+#define BLURRING_OFFSET_DIM(val, sign_)                                        \
+	((val + float(BLURRING_DIST)) * float(sign_) / float(IMG_DIMENSION))
 
-#define BLURRING_OFFSET(valx, valy, sign_) vec2(BLURRING_OFFSET_DIM(valx, sign_), BLURRING_OFFSET_DIM(valy, sign_))
+#define BLURRING_OFFSET(valx, valy, sign_)                                     \
+	vec2(BLURRING_OFFSET_DIM(valx, sign_), BLURRING_OFFSET_DIM(valy, sign_))
 
 #define KERNEL_SIZE 4
 

+ 23 - 18
shaders/ImageReflections.glsl

@@ -22,28 +22,34 @@ struct ReflectionProbe
 	vec4 cubemapIndexPad3;
 };
 
-layout(std140, row_major, SS_BINDING(IMAGE_REFLECTIONS_SET,
-	IMAGE_REFLECTIONS_FIRST_SS_BINDING)) readonly buffer _irs1
+layout(std140,
+	row_major,
+	SS_BINDING(IMAGE_REFLECTIONS_SET,
+		   IMAGE_REFLECTIONS_FIRST_SS_BINDING)) readonly buffer _irs1
 {
 	mat3 u_invViewRotation;
 	vec4 u_nearClusterMagicPad2;
 	ReflectionProbe u_reflectionProbes[];
 };
 
-layout(std430, row_major, SS_BINDING(IMAGE_REFLECTIONS_SET,
-	IMAGE_REFLECTIONS_FIRST_SS_BINDING + 1)) readonly buffer _irs2
+layout(std430,
+	row_major,
+	SS_BINDING(IMAGE_REFLECTIONS_SET,
+		   IMAGE_REFLECTIONS_FIRST_SS_BINDING + 1)) readonly buffer _irs2
 {
 	uint u_reflectionProbeIndices[];
 };
 
-layout(std430, row_major, SS_BINDING(IMAGE_REFLECTIONS_SET,
-	IMAGE_REFLECTIONS_FIRST_SS_BINDING + 2)) readonly buffer _irs3
+layout(std430,
+	row_major,
+	SS_BINDING(IMAGE_REFLECTIONS_SET,
+		   IMAGE_REFLECTIONS_FIRST_SS_BINDING + 2)) readonly buffer _irs3
 {
 	uvec2 u_reflectionClusters[];
 };
 
-layout(TEX_BINDING(IMAGE_REFLECTIONS_SET, IMAGE_REFLECTIONS_TEX_BINDING))
-	uniform samplerCubeArray u_reflectionsTex;
+layout(TEX_BINDING(IMAGE_REFLECTIONS_SET,
+	IMAGE_REFLECTIONS_TEX_BINDING)) uniform samplerCubeArray u_reflectionsTex;
 
 //==============================================================================
 // Compute the cubemap texture lookup vector given the reflection vector (r)
@@ -77,8 +83,8 @@ vec3 computeCubemapVec(in vec3 r, in float R2, in vec3 f)
 }
 
 //==============================================================================
-vec3 readReflection(in uint clusterIndex, in vec3 posVSpace,
-	in vec3 r, in float lod)
+vec3 readReflection(
+	in uint clusterIndex, in vec3 posVSpace, in vec3 r, in float lod)
 {
 	vec3 color = vec3(0.0);
 
@@ -109,7 +115,7 @@ vec3 readReflection(in uint clusterIndex, in vec3 posVSpace,
 		float factor = d / R2;
 		factor = min(factor, 1.0);
 		color = mix(c, color, factor);
-		//Equivelent: color = c * (1.0 - factor) + color * factor;
+		// Equivelent: color = c * (1.0 - factor) + color * factor;
 	}
 
 	return color;
@@ -118,14 +124,13 @@ vec3 readReflection(in uint clusterIndex, in vec3 posVSpace,
 //==============================================================================
 vec3 doImageReflections(in vec3 posVSpace, in vec3 r, in float lod)
 {
-	uint clusterIdx = computeClusterIndexUsingFragCoord(
-		u_nearClusterMagicPad2.x,
-		u_nearClusterMagicPad2.y,
-		posVSpace.z,
-		TILE_COUNT_X,
-		TILE_COUNT_Y);
+	uint clusterIdx =
+		computeClusterIndexUsingFragCoord(u_nearClusterMagicPad2.x,
+			u_nearClusterMagicPad2.y,
+			posVSpace.z,
+			TILE_COUNT_X,
+			TILE_COUNT_Y);
 	return readReflection(clusterIdx, posVSpace, r, lod);
 }
 
 #endif
-

+ 0 - 61
shaders/IsBinLightTemplate.glsl

@@ -1,61 +0,0 @@
-// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-// Template function that is used to bin lights to a tile
-
-#if !defined(TYPE) || !defined(NAME)
-#	error See file
-#endif
-
-#define CONCAT(x, y) x##y
-
-void CONCAT(bin, TYPE)(uint lightIndex)
-{
-	LIGHT_TYPE light = lights. CONCAT(NAME, Lights) [lightIndex];
-
-	uvec2 from = uvec2(0, 0);
-	uvec2 to = uvec2(TILES_X_COUNT, TILES_Y_COUNT);
-
-	while(1)
-	{
-		uvec2 m = (to - from) / uvec2(2); // Middle dist
-
-		// Handle final
-		if(m.x == 0 || m.y == 0)
-		{
-			if(CONCAT(NAME, LightInsidePlane)(
-				light, tilegrid.planesFar[tileY][tileX])
-				&& CONCAT(NAME, LightInsidePlane)(
-				light, tilegrid.planesNear[tileY][tileX]))
-			{
-				// It's inside tile
-				uint pos = 
-					atomicCounterIncrement(CONCAT(NAME, LightsCounter));
-
-				// Bin it
-				tiles.tile[tileY][tileX]. CONCAT(NAME, LightIndices) [pos] = 
-					lightIndex;
-			}
-
-			break;
-		}
-
-		// do the plane checks
-		bool inside[2][2];
-
-		// Top looking plane check
-		if(CONCAT(NAME, LightInsidePlane)(
-			light, tilegrid.planesY[from.y + m.y - 1]))
-		{
-			inside[][]
-		}
-	}
-}
-
-// Undef everything
-#undef LIGHT_TYPE
-#undef PLANE_TEST_FUNC
-#undef COUNTER
-#undef FUNC_NAME

+ 27 - 25
shaders/IsLp.frag.glsl

@@ -46,22 +46,22 @@ vec3 getFragPosVSpace()
 //==============================================================================
 // Common code for lighting
 
-#define LIGHTING_COMMON_BRDF() \
-	vec3 frag2Light = light.posRadius.xyz - fragPos; \
-	vec3 l = normalize(frag2Light); \
-	float nol = max(0.0, dot(normal, l)); \
-	vec3 specC = computeSpecularColorBrdf(viewDir, l, normal, specCol, \
-		light.specularColorTexId.rgb, a2, nol); \
-	vec3 diffC = computeDiffuseColor( \
-		diffCol, light.diffuseColorShadowmapId.rgb); \
-	float att = computeAttenuationFactor(light.posRadius.w, frag2Light); \
+#define LIGHTING_COMMON_BRDF()                                                 \
+	vec3 frag2Light = light.posRadius.xyz - fragPos;                           \
+	vec3 l = normalize(frag2Light);                                            \
+	float nol = max(0.0, dot(normal, l));                                      \
+	vec3 specC = computeSpecularColorBrdf(                                     \
+		viewDir, l, normal, specCol, light.specularColorTexId.rgb, a2, nol);   \
+	vec3 diffC =                                                               \
+		computeDiffuseColor(diffCol, light.diffuseColorShadowmapId.rgb);       \
+	float att = computeAttenuationFactor(light.posRadius.w, frag2Light);       \
 	float lambert = nol;
 
 //==============================================================================
 void debugIncorrectColor(inout vec3 c)
 {
-	if(isnan(c.x) || isnan(c.y) || isnan(c.z)
-		|| isinf(c.x) || isinf(c.y) || isinf(c.z))
+	if(isnan(c.x) || isnan(c.y) || isnan(c.z) || isinf(c.x) || isinf(c.y)
+		|| isinf(c.z))
 	{
 		c = vec3(1.0, 0.0, 1.0);
 	}
@@ -96,8 +96,8 @@ void main()
 	float a2 = pow(max(EPSILON, roughness), 2.0);
 
 	// Ambient and emissive color
-	out_color = diffCol * u_lightingUniforms.sceneAmbientColor.rgb
-		+ diffCol * emission;
+	out_color =
+		diffCol * u_lightingUniforms.sceneAmbientColor.rgb + diffCol * emission;
 
 	// Get counts and offsets
 	uint clusterIdx = computeClusterIndexUsingTileIdx(
@@ -114,8 +114,8 @@ void main()
 	uint spotLightsCount = cluster & 0xFFu;
 
 	// Shadowpass sample count
-	uint shadowSampleCount = computeShadowSampleCount(SHADOW_SAMPLE_COUNT,
-		fragPos.z);
+	uint shadowSampleCount =
+		computeShadowSampleCount(SHADOW_SAMPLE_COUNT, fragPos.z);
 
 	// Point lights
 	for(uint i = 0U; i < pointLightsCount; ++i)
@@ -129,12 +129,12 @@ void main()
 		float shadowmapLayerIdx = light.diffuseColorShadowmapId.w;
 		if(light.diffuseColorShadowmapId.w < 128.0)
 		{
-			shadow = computeShadowFactorOmni(frag2Light,
-				shadowmapLayerIdx, 1.0 / sqrt(light.posRadius.w));
+			shadow = computeShadowFactorOmni(
+				frag2Light, shadowmapLayerIdx, 1.0 / sqrt(light.posRadius.w));
 		}
 
-		out_color += (specC + diffC)
-			* (att * max(subsurface, lambert * shadow));
+		out_color +=
+			(specC + diffC) * (att * max(subsurface, lambert * shadow));
 	}
 
 	// Spot lights
@@ -145,8 +145,8 @@ void main()
 
 		LIGHTING_COMMON_BRDF();
 
-		float spot = computeSpotFactor(
-			l, light.outerCosInnerCos.x,
+		float spot = computeSpotFactor(l,
+			light.outerCosInnerCos.x,
 			light.outerCosInnerCos.y,
 			light.lightDir.xyz);
 
@@ -155,14 +155,16 @@ void main()
 		if(shadowmapLayerIdx < 128.0)
 		{
 			shadow = computeShadowFactorSpot(light.texProjectionMat,
-				fragPos, shadowmapLayerIdx, shadowSampleCount);
+				fragPos,
+				shadowmapLayerIdx,
+				shadowSampleCount);
 		}
 
-		out_color += (diffC + specC)
-			* (att * spot * max(subsurface, lambert * shadow));
+		out_color +=
+			(diffC + specC) * (att * spot * max(subsurface, lambert * shadow));
 	}
 
-	//out_color = diffCol;
+// out_color = diffCol;
 #if 0
 	if(pointLightsCount == 0)
 	{

+ 2 - 6
shaders/IsLp.vert.glsl

@@ -22,8 +22,7 @@ void main()
 {
 	float instIdF = float(gl_InstanceID);
 
-	vec2 ij = vec2(
-		mod(instIdF, float(TILE_COUNT_X)),
+	vec2 ij = vec2(mod(instIdF, float(TILE_COUNT_X)),
 		floor(instIdF / float(TILE_COUNT_X)));
 
 	out_instanceId = int(gl_InstanceID);
@@ -31,8 +30,7 @@ void main()
 	const vec2 SIZES =
 		vec2(1.0 / float(TILE_COUNT_X), 1.0 / float(TILE_COUNT_Y));
 
-	const vec2 UVS[4] = vec2[](
-		vec2(0.0, 0.0) * SIZES,
+	const vec2 UVS[4] = vec2[](vec2(0.0, 0.0) * SIZES,
 		vec2(1.0, 0.0) * SIZES,
 		vec2(0.0, 1.0) * SIZES,
 		vec2(1.0, 1.0) * SIZES);
@@ -43,5 +41,3 @@ void main()
 	gl_Position = vec4(pos, 0.0, 1.0);
 	out_projectionParams = u_lightingUniforms.projectionParams.xy * pos;
 }
-
-

+ 0 - 104
shaders/IsRejectLights.glsl

@@ -1,104 +0,0 @@
-// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-// This compute shader rejects lights
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-
-#include "shaders/IsCommon.glsl"
-
-#define TILE_W (DEPTHMAP_WIDTH / TILES_X_COUNT)
-#define TILE_H (DEPTHMAP_HEIGHT / TILES_Y_COUNT)
-
-#define tileX gl_WorkGroupID.x
-#define tileY gl_WorkGroupID.y
-
-uniform highp sampler2D depthMap;
-
-layout(std140, binding = TILES_BLOCK_BINDING) buffer tilesBlock
-{
-	Tile tiles[TILES_Y_COUNT * TILES_X_COUNT];
-};
-
-layout(std140) uniform pointLightsBlock
-{
-	PointLight pointLights[MAX_POINT_LIGHTS];
-};
-
-// Common uniforms. Make it match the commonBlock in IsLp.glsl
-layout(std140) uniform commonBlock
-{
-	/// Packs:
-	/// - xy: Planes. For the calculation of frag pos in view space
-	uniform vec2 planes;
-
-	uniform vec4 padding1;
-	uniform vec4 padding2;
-};
-
-void main()
-{
-	uint tileIndex = tileY * TILES_X_COUNT + tileX;
-
-	//
-	// First calculate the z of the far plane
-	//
-	vec2 minMaxDepth = vec2(10000.0, -10000.0); // max depth of tile
-
-	const vec2 COORD = vec2(tileX, tileY)
-		* (vec2(1.0) / vec2(float(TILES_X_COUNT), float(TILES_Y_COUNT)));
-
-	vec2 coord = COORD;
-
-	for(int x = 0; x < TILE_W; ++x)
-	{
-		for(int y = 0; y < TILE_H; ++y)
-		{
-			float depth = texture(depthMap, coord).r;
-
-			minMaxDepth[0] = min(depth, minMaxDepth[0]);
-			minMaxDepth[1] = max(depth, minMaxDepth[1]);
-
-			coord.y += 1.0 / float(DEPTHMAP_HEIGHT);
-		}
-
-		coord.x += 1.0 / float(DEPTHMAP_WIDTH);
-	}
-
-	// Convert to view space
-	vec2 z = -planes.y / (planes.x + minMaxDepth);
-
-	//
-	// Reject point lights
-	//
-	uint newPointLightIndices[MAX_POINT_LIGHTS_PER_TILE];
-	uint newPointLightsCount = 0;
-
-	uint pointLightsCount = tiles[tileIndex].lightsCount[0];
-	for(uint i = 0U; i < pointLightsCount; ++i)
-	{
-		uint lightId = tiles[tileIndex].pointLightIndices[i / 4U][i % 4U];
-
-		vec4 posRadius = pointLights[lightId].posRadius;
-		vec3 pos = posRadius.xyz;
-		float radius = -1.0 / posRadius.w;
-
-		// Should reject?
-		if((pos.z + radius) >= z[1] && (pos.z - radius) <= z[0])
-		{
-			// No
-
-			newPointLightIndices[newPointLightsCount++] = lightId;
-		}
-	}
-
-	// Copy back
-	for(uint i = 0U; i < newPointLightsCount; i++)
-	{
-		tiles[tileIndex].pointLightIndices[i / 4U][i % 4U] =
-			newPointLightIndices[i];
-	}
-	tiles[tileIndex].lightsCount[0] = newPointLightsCount;
-}

+ 0 - 142
shaders/IsUpdateTilegrid.glsl

@@ -1,142 +0,0 @@
-// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-// This compute shader sets the planes of the tilegrid
-
-#pragma anki start computeShader
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-
-#define TILES_COUNT (TILES_X_COUNT * TILES_Y_COUNT)
-
-// The total number of planes. See the cpp code for details
-#define PLANES_COUNT (TILES_X_COUNT - 1 + TILES_Y_COUNT - 1  + TILES_COUNT)
-
-#define TILE_W (DEPTHMAP_WIDTH / TILES_X_COUNT)
-#define TILE_H (DEPTHMAP_HEIGHT / TILES_Y_COUNT)
-
-#define tileX gl_WorkGroupID.x
-#define tileY gl_WorkGroupID.y
-
-// Offsets of different plane groups in 
-#define PLANES_X_OFFSET 0
-#define PLANES_Y_OFFSET (PLANES_X_OFFSET + )
-#define PLANES_NEAR_OFFSET (PLANES_Y_OFFSET + TILES_Y_COUNT - 1)
-#define PLANES_FAR_OFFSET (PLANES_NEAR_OFFSET + TILES_COUNT)
-
-uniform highp sampler2D depthMap;
-
-struct Plane
-{
-	vec4 normalOffset;
-};
-
-struct Tilegrid
-{
-	Plane planesX[TILES_X_COUNT - 1];
-	Plane planesY[TILES_Y_COUNT - 1];
-	Plane planesNear[TILES_Y_COUNT][TILES_X_COUNT];
-	Plane planesFar[TILES_Y_COUNT][TILES_X_COUNT];
-};
-
-layout(std140, binding = 0) buffer tilegridBuffer
-{
-	Tilegrid tilegrid;
-};
-
-layout(std140, binding = 1) uniform uniformBuffer
-{
-	vec4 fovXfovYNearFar;
-	bvec4 frustumChanged_;
-}
-
-#define frustumChanged frustumChanged_.x
-
-#define fovX fovXfovYNearFar.x
-#define fovY fovXfovYNearFar.y
-#define near fovXfovYNearFar.z
-#define far fovXfovYNearFar.w
-
-void main()
-{
-	//
-	// First get the min max depth of the tile. This reads from memory so do
-	// it first
-	//
-	vec2 minMaxDepth = vec2(-10000.0, 100000.0);
-
-	uvec2 coord = uvec2(uvec2(tileX, tileY) * uvec2(TILE_W, TILE_H));
-
-	for(int x = 0; x < TILE_W; x++)
-	{
-		for(uint y = 0; y < TILE_H; i++)
-		{
-			float depth = texelFetch(depthMap, coord + uvec2(x, y)).r;
-
-			minMaxDepth.x = min(depth, minMaxDepth.x);
-			minMaxDepth.y = max(depth, minMaxDepth.y);
-		}
-	}
-
-	//
-	// Update top and right looking planes only when the fovs have changed
-	//
-	if(frustumChanged)
-	{
-		float near2 = 2.0 * near;
-		float l = near2 * tan(fovX * 0.5);
-		float l6 = l * (1.0 / float(TILES_X_COUNT));
-		float o = near2 * tan(fovY * 0.5);
-		float o6 = o * (1.0 / float(TILES_Y_COUNT));
-
-		// First the right looking planes in one working thread
-		if(tileY == 0U)
-		{
-			vec3 a, b;
-
-			a = vec3(
-				float(int(tileX + 1) - (int(TILES_X_COUNT) / 2)) * l6, 
-				0.0, 
-				-near);
-
-			b = cross(a, vec3(0.0, 1.0, 0.0));
-			normalize(b);
-
-			planesX[tileX].normalOffset = vec4(b, 0.0)
-		}
-
-		// Then the top looking planes in one working thread
-		if(tileX == 0U)
-		{
-			vec3 a, b;
-
-			a = vec3(
-				0.0, 
-				float(int(tileY + 1) - (int(TILES_Y_COUNT) / 2)) * o6, 
-				-near);
-
-			b = cross(vec3(1.0, 0.0, 0.0), a);
-			normalize(b);
-
-			planesY[tileY].normalOffset = vec4(b, 0.0);
-		}
-	}
-
-	//
-	// Update the far and near planes
-	//
-	{
-		// Calc the Z in view space
-		vec2 minMaxZ = 
-			vec2(far * near) / (minMaxDepth * vec2(near - far) + vec2(near));
-
-		// Set planes
-		planesNear[tileY][tileX].normalOffset = 
-			vec4(0.0, 0.0, -1.0, minMaxZ.x);
-
-		planesFar[tileY][tileX].normalOffset = 
-			vec4(0.0, 0.0, 1.0, minMaxZ.y);
-	}
-}

+ 0 - 98
shaders/IsUpdateTiles.glsl

@@ -1,98 +0,0 @@
-// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-// Compute shader that bins lights to the tiles
-
-// Set number of work items
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-
-#include "shaders/IsCommon.glsl"
-
-//
-// Data
-//
-
-// The tilegrid input buffer
-layout(std140, binding = 0) buffer tilegridBuffer
-{
-	Tilegrid tilegrid;
-};
-
-// The lights input buffers
-layout(std140, binding = 1) buffer lightsBuffer
-{
-	Lights lights;
-};
-
-// The output buffer
-layout(std430, binding = 2) buffer tilesBuffer
-{
-	Tile tiles[TILES_Y_COUNT][TILES_X_COUNT];
-};
-
-// Buffers with atomic counters for each tile
-layout(std430, binding = 1) buffer pointLightsCountBuffer
-{
-	atomic_uint pointLightsCount[TILES_Y_COUNT][TILES_X_COUNT];
-};
-layout(std430, binding = 2) buffer spotLightsCountBuffer
-{
-	atomic_uint spotLightsCount[TILES_Y_COUNT][TILES_X_COUNT];
-};
-layout(std430, binding = 3) buffer spotTexLightsCountBuffer
-{
-	atomic_uint spotTexLightsCount[TILES_Y_COUNT][TILES_X_COUNT];
-};
-
-//
-// Functions
-//
-
-// Return true if spere is in the half space defined by the plane
-bool pointLightInsidePlane(in PointLight light, in Plane plane)
-{
-	// Result of the plane test. Distance of
-	float dist = dot(plane.normalOffset.xyz, light.posRadius.xyz)
-		- plane.normalOffset.w;
-
-	return dist >= 0.0;
-}
-
-// Spot light inside plane
-bool spotLightInsidePlane(in SpotLight light, in Plane plane)
-{
-	if(pointLightInsidePlane(light.lightBase, plane))
-	{
-		return true;
-	}
-
-	for(uint i = 0U; i < 4; i++)
-	{
-		float dist = dot(plane.normalOffset.xyz, light.extendPoints[i].xyz)
-			- plane.normalOffset.w;
-
-		if(dist >= 0.0)
-		{
-			return true;
-		}
-	}
-	return false;
-}
-
-// Spot tex light inside plane
-bool spotTexLightInsidePlane(in SpotTexLight light, in Plane plane)
-{
-	return pointLightInsidePlane(light.spotLightBase, plane);
-}
-
-// main
-void main()
-{
-	// First the point lights
-	for(uint i = 0U; i < lights.count.x; i++)
-	{
-
-	}
-}

+ 2 - 2
shaders/LfOcclusion.frag.glsl

@@ -8,5 +8,5 @@
 #include "shaders/Common.glsl"
 
 void main()
-{}
-
+{
+}

+ 0 - 1
shaders/LfOcclusion.vert.glsl

@@ -25,4 +25,3 @@ void main()
 	gl_Position = u_mvp * vec4(in_position, 1.0);
 	gl_PointSize = 16.0;
 }
-

+ 2 - 5
shaders/LfSpritePass.vert.glsl

@@ -32,10 +32,7 @@ out gl_PerVertex
 void main()
 {
 	const vec2 POSITIONS[4] = vec2[](
-		vec2(-1.0, -1.0),
-		vec2(1.0, -1.0),
-		vec2(-1.0, 1.0),
-		vec2(1.0, 1.0));
+		vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
 
 	vec2 position = POSITIONS[gl_VertexID];
 
@@ -45,7 +42,7 @@ void main()
 	out_uv = vec3((position * 0.5) + 0.5, sprite.depthPad3.x);
 
 	vec4 posScale = sprite.posScale;
-	gl_Position = vec4(position * posScale.zw + posScale.xy , 0.0, 1.0);
+	gl_Position = vec4(position * posScale.zw + posScale.xy, 0.0, 1.0);
 
 	out_color = sprite.color;
 }

+ 25 - 32
shaders/LightFunctions.glsl

@@ -26,8 +26,7 @@ float computeAttenuationFactor(float lightRadius, vec3 frag2Light)
 
 //==============================================================================
 // Performs BRDF specular lighting
-vec3 computeSpecularColorBrdf(
-	vec3 v, // view dir
+vec3 computeSpecularColorBrdf(vec3 v, // view dir
 	vec3 l, // light dir
 	vec3 n, // normal
 	vec3 specCol,
@@ -44,8 +43,8 @@ vec3 computeSpecularColorBrdf(
 	vec3 F = specCol + (1.0 - specCol) * pow((1.0 + EPSILON - loh), 5.0);
 #else
 	// Unreal
-	vec3 F = specCol + (1.0 - specCol)
-		* pow(2.0, (-5.55473 * voh - 6.98316) * voh);
+	vec3 F =
+		specCol + (1.0 - specCol) * pow(2.0, (-5.55473 * voh - 6.98316) * voh);
 #endif
 
 	// D(n,h) aka NDF: GGX Trowbridge-Reitz
@@ -53,8 +52,8 @@ vec3 computeSpecularColorBrdf(
 	float D = noh * noh * (a2 - 1.0) + 1.0;
 	D = a2 / (PI * D * D);
 
-	// G(l,v,h)/(4*dot(n,h)*dot(n,v)) aka Visibility term: Geometric shadowing
-	// divided by BRDF denominator
+// G(l,v,h)/(4*dot(n,h)*dot(n,v)) aka Visibility term: Geometric shadowing
+// divided by BRDF denominator
 #if 0
 	float nov = max(EPSILON, dot(n, v));
 	float V_v = nov + sqrt((nov - nov * a2) * nov + a2);
@@ -79,11 +78,7 @@ vec3 computeDiffuseColor(vec3 diffCol, vec3 lightDiffCol)
 }
 
 //==============================================================================
-float computeSpotFactor(
-	vec3 l,
-	float outerCos,
-	float innerCos,
-	vec3 spotDir)
+float computeSpotFactor(vec3 l, float outerCos, float innerCos, vec3 spotDir)
 {
 	float costheta = -dot(l, spotDir);
 	float spotFactor = smoothstep(outerCos, innerCos, costheta);
@@ -104,31 +99,30 @@ uint computeShadowSampleCount(const uint COUNT, float zVSpace)
 }
 
 //==============================================================================
-float computeShadowFactorSpot(mat4 lightProjectionMat, vec3 fragPos,
-	float layer, uint sampleCount)
+float computeShadowFactorSpot(
+	mat4 lightProjectionMat, vec3 fragPos, float layer, uint sampleCount)
 {
 	vec4 texCoords4 = lightProjectionMat * vec4(fragPos, 1.0);
 	vec3 texCoords3 = texCoords4.xyz / texCoords4.w;
 
 #if POISSON == 1
-	const vec2 poissonDisk[SHADOW_SAMPLE_COUNT] = vec2[](
-		vec2(0.751688, 0.619709) * 2.0 - 1.0,
-		vec2(0.604741, 0.778485) * 2.0 - 1.0,
-		vec2(0.936216, 0.463094) * 2.0 - 1.0,
-		vec2(0.808758, 0.284966) * 2.0 - 1.0,
-		vec2(0.812927, 0.786332) * 2.0 - 1.0,
-		vec2(0.608651, 0.303919) * 2.0 - 1.0,
-		vec2(0.482117, 0.573285) * 2.0 - 1.0,
-		vec2(0.55819, 0.988451) * 2.0 - 1.0,
-		vec2(0.340001, 0.728732) * 2.0 - 1.0,
-		vec2(0.681775, 0.119789) * 2.0 - 1.0,
-		vec2(0.217429, 0.522558) * 2.0 - 1.0,
-		vec2(0.384257, 0.352163) * 2.0 - 1.0,
-		vec2(0.143769, 0.738606) * 2.0 - 1.0,
-		vec2(0.383474, 0.910019) * 2.0 - 1.0,
-		vec2(0.409305, 0.177022) * 2.0 - 1.0,
-		vec2(0.158647, 0.239097) * 2.0 - 1.0);
-
+	const vec2 poissonDisk[SHADOW_SAMPLE_COUNT] =
+		vec2[](vec2(0.751688, 0.619709) * 2.0 - 1.0,
+			vec2(0.604741, 0.778485) * 2.0 - 1.0,
+			vec2(0.936216, 0.463094) * 2.0 - 1.0,
+			vec2(0.808758, 0.284966) * 2.0 - 1.0,
+			vec2(0.812927, 0.786332) * 2.0 - 1.0,
+			vec2(0.608651, 0.303919) * 2.0 - 1.0,
+			vec2(0.482117, 0.573285) * 2.0 - 1.0,
+			vec2(0.55819, 0.988451) * 2.0 - 1.0,
+			vec2(0.340001, 0.728732) * 2.0 - 1.0,
+			vec2(0.681775, 0.119789) * 2.0 - 1.0,
+			vec2(0.217429, 0.522558) * 2.0 - 1.0,
+			vec2(0.384257, 0.352163) * 2.0 - 1.0,
+			vec2(0.143769, 0.738606) * 2.0 - 1.0,
+			vec2(0.383474, 0.910019) * 2.0 - 1.0,
+			vec2(0.409305, 0.177022) * 2.0 - 1.0,
+			vec2(0.158647, 0.239097) * 2.0 - 1.0);
 
 	float shadowFactor = 0.0;
 
@@ -176,4 +170,3 @@ float computeShadowFactorOmni(vec3 frag2Light, float layer, float radius)
 }
 
 #endif
-

+ 10 - 8
shaders/LightResources.glsl

@@ -19,8 +19,9 @@ struct LightingUniforms
 	uvec4 tileCountPad1;
 };
 
-layout(std140, row_major, SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING))
-	readonly buffer _s0
+layout(std140,
+	row_major,
+	SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING)) readonly buffer _s0
 {
 	LightingUniforms u_lightingUniforms;
 };
@@ -51,8 +52,9 @@ struct SpotLight
 	mat4 texProjectionMat;
 };
 
-layout(SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING + 2), std140, row_major)
-	readonly buffer _s2
+layout(SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING + 2),
+	std140,
+	row_major) readonly buffer _s2
 {
 	SpotLight u_spotLights[];
 };
@@ -67,10 +69,10 @@ layout(std430, SS_BINDING(LIGHT_SET, LIGHT_SS_BINDING + 4)) readonly buffer _s4
 	uint u_lightIndices[];
 };
 
-layout(TEX_BINDING(LIGHT_SET, LIGHT_TEX_BINDING))
-	uniform highp sampler2DArrayShadow u_spotMapArr;
-layout(TEX_BINDING(LIGHT_SET, LIGHT_TEX_BINDING + 1))
-	uniform highp samplerCubeArrayShadow u_omniMapArr;
+layout(TEX_BINDING(LIGHT_SET,
+	LIGHT_TEX_BINDING)) uniform highp sampler2DArrayShadow u_spotMapArr;
+layout(TEX_BINDING(LIGHT_SET,
+	LIGHT_TEX_BINDING + 1)) uniform highp samplerCubeArrayShadow u_omniMapArr;
 
 #endif // FRAGMENT_SHADER
 

+ 0 - 1
shaders/LinearDepth.glsl

@@ -14,4 +14,3 @@ float linearizeDepthOptimal(in float depth, in float a, in float b)
 {
 	return 1.0 / (a + depth * b);
 }
-

+ 33 - 33
shaders/MsCommonFrag.glsl

@@ -33,9 +33,9 @@ layout(location = 3) in mediump vec3 in_vertPosViewSpace;
 layout(location = 0) out vec4 out_msRt0;
 layout(location = 1) out vec4 out_msRt1;
 layout(location = 2) out vec4 out_msRt2;
-#	define out_msRt0_DEFINED
-#	define out_msRt1_DEFINED
-#	define out_msRt2_DEFINED
+#define out_msRt0_DEFINED
+#define out_msRt1_DEFINED
+#define out_msRt2_DEFINED
 #endif
 
 //==============================================================================
@@ -44,7 +44,7 @@ layout(location = 2) out vec4 out_msRt2;
 
 // Getter
 #if PASS == COLOR
-#	define getNormal_DEFINED
+#define getNormal_DEFINED
 vec3 getNormal()
 {
 	return normalize(in_normal);
@@ -53,7 +53,7 @@ vec3 getNormal()
 
 // Getter
 #if PASS == COLOR
-#	define getTangent_DEFINED
+#define getTangent_DEFINED
 vec4 getTangent()
 {
 	return in_tangent;
@@ -69,7 +69,7 @@ vec2 getTextureCoord()
 
 // Getter
 #if PASS == COLOR
-#	define getPositionViewSpace_DEFINED
+#define getPositionViewSpace_DEFINED
 vec3 getPositionViewSpace()
 {
 #if TESSELLATION
@@ -82,13 +82,13 @@ vec3 getPositionViewSpace()
 
 // Do normal mapping
 #if PASS == COLOR
-#	define readNormalFromTexture_DEFINED
-vec3 readNormalFromTexture(in vec3 normal, in vec4 tangent,
-	in sampler2D map, in highp vec2 texCoords)
+#define readNormalFromTexture_DEFINED
+vec3 readNormalFromTexture(
+	in vec3 normal, in vec4 tangent, in sampler2D map, in highp vec2 texCoords)
 {
-#	if LOD > 0
+#if LOD > 0
 	return normalize(normal);
-#	else
+#else
 	// First read the texture
 	vec3 nAtTangentspace = normalize((texture(map, texCoords).rgb - 0.5) * 2.0);
 
@@ -99,20 +99,23 @@ vec3 readNormalFromTexture(in vec3 normal, in vec4 tangent,
 	mat3 tbnMat = mat3(t, b, n);
 
 	return tbnMat * nAtTangentspace;
-#	endif
+#endif
 }
 #endif
 
 // Do normal mapping by combining normal maps
 #if PASS == COLOR
-#	define combineNormalFromTextures_DEFINED
-vec3 combineNormalFromTextures(in vec3 normal, in vec4 tangent,
-	in sampler2D map, in sampler2D map2, in highp vec2 texCoords,
+#define combineNormalFromTextures_DEFINED
+vec3 combineNormalFromTextures(in vec3 normal,
+	in vec4 tangent,
+	in sampler2D map,
+	in sampler2D map2,
+	in highp vec2 texCoords,
 	in float texCoords2Scale)
 {
-#	if LOD > 0
+#if LOD > 0
 	return normalize(normal);
-#	else
+#else
 	// First read the textures
 	vec3 nAtTangentspace0 =
 		normalize((texture(map, texCoords).rgb - 0.5) * 2.0);
@@ -128,15 +131,15 @@ vec3 combineNormalFromTextures(in vec3 normal, in vec4 tangent,
 	mat3 tbnMat = mat3(t, b, n);
 
 	return tbnMat * nAtTangentspace;
-#	endif
+#endif
 }
 #endif
 
 // Do environment mapping
 #if PASS == COLOR
-#	define readEnvironmentColor_DEFINED
-vec3 readEnvironmentColor(in vec3 vertPosViewSpace, in vec3 normal,
-	in sampler2D map)
+#define readEnvironmentColor_DEFINED
+vec3 readEnvironmentColor(
+	in vec3 vertPosViewSpace, in vec3 normal, in sampler2D map)
 {
 	// In case of normal mapping I could play with vertex's normal but this
 	// gives better results and its allready computed
@@ -156,9 +159,7 @@ vec3 readEnvironmentColor(in vec3 vertPosViewSpace, in vec3 normal,
 // texture's alpha is less than the tolerance
 #define readTextureRgbAlphaTesting_DEFINED
 vec3 readTextureRgbAlphaTesting(
-	in sampler2D map,
-	in highp vec2 texCoords,
-	in float tolerance)
+	in sampler2D map, in highp vec2 texCoords, in float tolerance)
 {
 #if PASS == COLOR
 	vec4 col = vec4(texture(map, texCoords));
@@ -168,22 +169,22 @@ vec3 readTextureRgbAlphaTesting(
 	}
 	return col.rgb;
 #else // Depth
-#	if LOD > 0
+#if LOD > 0
 	return vec3(0.0);
-#	else
+#else
 	float a = float(texture(map, texCoords).a);
 	if(a < tolerance)
 	{
 		discard;
 	}
 	return vec3(0.0);
-#	endif
+#endif
 #endif
 }
 
 // Just read the RGB color from texture
 #if PASS == COLOR
-#	define readRgbFromTexture_DEFINED
+#define readRgbFromTexture_DEFINED
 vec3 readRgbFromTexture(in sampler2D tex, in highp vec2 texCoords)
 {
 	return vec3(texture(tex, texCoords)).rgb;
@@ -192,7 +193,7 @@ vec3 readRgbFromTexture(in sampler2D tex, in highp vec2 texCoords)
 
 // Just read the RGB color from cube texture
 #if PASS == COLOR
-#	define readRgbFromCubeTexture_DEFINED
+#define readRgbFromCubeTexture_DEFINED
 vec3 readRgbFromCubeTexture(in samplerCube tex, in mediump vec3 texCoord)
 {
 	return texture(tex, texCoord).rgb;
@@ -201,7 +202,7 @@ vec3 readRgbFromCubeTexture(in samplerCube tex, in mediump vec3 texCoord)
 
 // Just read the R color from texture
 #if PASS == COLOR
-#	define readRFromTexture_DEFINED
+#define readRFromTexture_DEFINED
 float readRFromTexture(in sampler2D tex, in highp vec2 texCoords)
 {
 	return vec3(texture(tex, texCoords)).r;
@@ -210,9 +211,8 @@ float readRFromTexture(in sampler2D tex, in highp vec2 texCoords)
 
 // Write the data to FAIs
 #if PASS == COLOR
-#	define writeRts_DEFINED
-void writeRts(
-	in vec3 diffColor, // from 0 to 1
+#define writeRts_DEFINED
+void writeRts(in vec3 diffColor, // from 0 to 1
 	in vec3 normal,
 	in vec3 specularColor,
 	in float roughness,

+ 24 - 31
shaders/MsCommonTessc.glsl

@@ -19,7 +19,8 @@ layout(vertices = 3) out;
 in gl_PerVertex
 {
 	vec4 gl_Position;
-} gl_in[];
+}
+gl_in[];
 
 layout(location = 0) in vec2 inTexCoords[];
 layout(location = 1) in mediump vec3 inNormal[];
@@ -37,7 +38,8 @@ layout(location = 3) flat in uint inInstanceId[];
 out gl_PerVertex
 {
 	vec4 gl_Position;
-} gl_out[];
+}
+gl_out[];
 
 layout(location = 0) out vec2 outTexCoord[];
 layout(location = 1) out vec3 outNormal[];
@@ -108,23 +110,20 @@ void calcPositions()
 	pnPatch.pos210 = pos300 + edgeB003 / 3.0;
 	pnPatch.pos120 = pos300 + edgeB003 * 2.0 / 3.0;
 
-	pnPatch.pos021 = projectToPlane(
-		pnPatch.pos021, pos030, outNormal[0]);
-	pnPatch.pos012 = projectToPlane(
-		pnPatch.pos012, pos003, outNormal[1]);
-	pnPatch.pos102 = projectToPlane(
-		pnPatch.pos102, pos003, outNormal[1]);
-	pnPatch.pos201 = projectToPlane(
-		pnPatch.pos201, pos300, outNormal[2]);
-	pnPatch.pos210 = projectToPlane(
-		pnPatch.pos210, pos300, outNormal[2]);
-	pnPatch.pos120 = projectToPlane(
-		pnPatch.pos120, pos030, outNormal[0]);
+	pnPatch.pos021 = projectToPlane(pnPatch.pos021, pos030, outNormal[0]);
+	pnPatch.pos012 = projectToPlane(pnPatch.pos012, pos003, outNormal[1]);
+	pnPatch.pos102 = projectToPlane(pnPatch.pos102, pos003, outNormal[1]);
+	pnPatch.pos201 = projectToPlane(pnPatch.pos201, pos300, outNormal[2]);
+	pnPatch.pos210 = projectToPlane(pnPatch.pos210, pos300, outNormal[2]);
+	pnPatch.pos120 = projectToPlane(pnPatch.pos120, pos030, outNormal[0]);
 
 	// Handle the center
 	vec3 center = (pos003 + pos030 + pos300) / 3.0;
-	pnPatch.pos111 = (pnPatch.pos021 + pnPatch.pos012 + pnPatch.pos102 +
-		pnPatch.pos201 + pnPatch.pos210 + pnPatch.pos120) / 6.0;
+	pnPatch.pos111 =
+		(pnPatch.pos021 + pnPatch.pos012 + pnPatch.pos102 + pnPatch.pos201
+			+ pnPatch.pos210
+			+ pnPatch.pos120)
+		/ 6.0;
 	pnPatch.pos111 += (pnPatch.pos111 - center) / 2.0;
 }
 
@@ -166,8 +165,7 @@ bool posOutsideClipSpace(in vec2 posNdc)
 // Check if a face in NDC is outside the clip space
 bool isFaceOutsideClipSpace(in vec2 posNdc[3])
 {
-	return any(bvec3(
-		posOutsideClipSpace(posNdc[0]),
+	return any(bvec3(posOutsideClipSpace(posNdc[0]),
 		posOutsideClipSpace(posNdc[1]),
 		posOutsideClipSpace(posNdc[2])));
 }
@@ -177,7 +175,7 @@ bool isFaceVisible(in mat4 mvp)
 {
 	// Calculate clip positions
 	vec2 clip[3];
-	for(int i = 0 ; i < 3 ; i++)
+	for(int i = 0; i < 3; i++)
 	{
 		vec4 v = mvp * IN_POS4(i);
 		clip[i] = v.xy / (v.w * 0.5 + 0.5);
@@ -199,8 +197,9 @@ void setSilhouetteTessLevels(in mat3 normalMat, in float maxTessLevel)
 	gl_TessLevelOuter[0] = calcEdgeTessLevel(nv[1], nv[2], maxTessLevel);
 	gl_TessLevelOuter[1] = calcEdgeTessLevel(nv[2], nv[0], maxTessLevel);
 	gl_TessLevelOuter[2] = calcEdgeTessLevel(nv[0], nv[1], maxTessLevel);
-	gl_TessLevelInner[0] = (gl_TessLevelOuter[0] + gl_TessLevelOuter[1]
-		+ gl_TessLevelOuter[2]) / 3.0;
+	gl_TessLevelInner[0] =
+		(gl_TessLevelOuter[0] + gl_TessLevelOuter[1] + gl_TessLevelOuter[2])
+		/ 3.0;
 }
 
 void setConstantTessLevels(in float maxTessLevel)
@@ -229,9 +228,7 @@ float calcPhongTerm(int ivId, int i, vec3 q)
 // This function is part of the point-normal tessellation method
 #define tessellatePNPositionNormalTangentTexCoord_DEFINED
 void tessellatePNPositionNormalTangentTexCoord(
-	in float maxTessLevel,
-	in mat4 mvp,
-	in mat3 normalMat)
+	in float maxTessLevel, in mat4 mvp, in mat3 normalMat)
 {
 	float tessLevel = 0.0;
 
@@ -243,7 +240,7 @@ void tessellatePNPositionNormalTangentTexCoord(
 	{
 		// The face is front facing
 
-		for(int i = 0 ; i < 3 ; i++)
+		for(int i = 0; i < 3; i++)
 		{
 			outTexCoord[i] = inTexCoords[i];
 			outNormal[i] = inNormal[i];
@@ -268,9 +265,7 @@ void tessellatePNPositionNormalTangentTexCoord(
 
 #define tessellatePhongPositionNormalTangentTexCoord_DEFINED
 void tessellatePhongPositionNormalTangentTexCoord(
-	in float maxTessLevel,
-	in mat4 mvp,
-	in mat3 normalMat)
+	in float maxTessLevel, in mat4 mvp, in mat3 normalMat)
 {
 	if(IID == 0)
 	{
@@ -307,9 +302,7 @@ void tessellatePhongPositionNormalTangentTexCoord(
 
 #define tessellateDispMapPositionNormalTangentTexCoord_DEFINED
 void tessellateDispMapPositionNormalTangentTexCoord(
-	in float maxTessLevel,
-	in mat4 mvp,
-	in mat3 normalMat)
+	in float maxTessLevel, in mat4 mvp, in mat3 normalMat)
 {
 	if(IID == 0)
 	{

+ 15 - 30
shaders/MsCommonTesse.glsl

@@ -38,7 +38,8 @@ struct CommonPatch
 in gl_PerVertex
 {
 	vec4 gl_Position;
-} gl_in[];
+}
+gl_in[];
 
 in patch PNPatch pnPatch;
 in patch PhongPatch phongPatch;
@@ -67,7 +68,8 @@ layout(location = 1) out mediump vec3 outNormal;
 layout(location = 2) out mediump vec4 outTangent;
 #endif
 
-#define INTERPOLATE(x_) (x_[0] * gl_TessCoord.x + x_[1] * gl_TessCoord.y + x_[2] * gl_TessCoord.z)
+#define INTERPOLATE(x_)                                                        \
+	(x_[0] * gl_TessCoord.x + x_[1] * gl_TessCoord.y + x_[2] * gl_TessCoord.z)
 
 // Smooth tessellation
 #define tessellatePNPositionNormalTangentTexCoord_DEFINED
@@ -96,16 +98,10 @@ void tessellatePNPositionNormalTangentTexCoord(in mat4 mvp, in mat3 normalMat)
 	vec3 pos003 = IN_POS3(1);
 	vec3 pos300 = IN_POS3(2);
 
-	vec3 pos = 
-		pos300 * wPow3
-		+ pos030 * uPow3
-		+ pos003 * vPow3
-		+ pnPatch.pos210 * 3.0 * wPow2 * u 
-		+ pnPatch.pos120 * 3.0 * w * uPow2 
-		+ pnPatch.pos201 * 3.0 * wPow2 * v 
-		+ pnPatch.pos021 * 3.0 * uPow2 * v 
-		+ pnPatch.pos102 * 3.0 * w * vPow2 
-		+ pnPatch.pos012 * 3.0 * u * vPow2 
+	vec3 pos = pos300 * wPow3 + pos030 * uPow3 + pos003 * vPow3
+		+ pnPatch.pos210 * 3.0 * wPow2 * u + pnPatch.pos120 * 3.0 * w * uPow2
+		+ pnPatch.pos201 * 3.0 * wPow2 * v + pnPatch.pos021 * 3.0 * uPow2 * v
+		+ pnPatch.pos102 * 3.0 * w * vPow2 + pnPatch.pos012 * 3.0 * u * vPow2
 		+ pnPatch.pos111 * 6.0 * w * u * v;
 
 	gl_Position = mvp * vec4(pos, 1.0);
@@ -129,28 +125,19 @@ void tessellatePhongPositionNormalTangentTexCoord(
 
 	// build terms
 	vec3 termIJ = vec3(
-		phongPatch.terms[0][0],
-		phongPatch.terms[1][0],
-		phongPatch.terms[2][0]);
+		phongPatch.terms[0][0], phongPatch.terms[1][0], phongPatch.terms[2][0]);
 	vec3 termJK = vec3(
-		phongPatch.terms[0][1],
-		phongPatch.terms[1][1],
-		phongPatch.terms[2][1]);
+		phongPatch.terms[0][1], phongPatch.terms[1][1], phongPatch.terms[2][1]);
 	vec3 termIK = vec3(
-		phongPatch.terms[0][2],
-		phongPatch.terms[1][2],
-		phongPatch.terms[2][2]);
+		phongPatch.terms[0][2], phongPatch.terms[1][2], phongPatch.terms[2][2]);
 
 	vec3 tc2 = gl_TessCoord * gl_TessCoord;
 
 	// phong tesselated pos
-	vec3 phongPos = 
-		tc2[0] * inpos[0]
-		 + tc2[1] * inpos[1]
-		 + tc2[2] * inpos[2]
-		 + gl_TessCoord[0] * gl_TessCoord[1] * termIJ
-		 + gl_TessCoord[1] * gl_TessCoord[2] * termJK
-		 + gl_TessCoord[2] * gl_TessCoord[0] * termIK;
+	vec3 phongPos = tc2[0] * inpos[0] + tc2[1] * inpos[1] + tc2[2] * inpos[2]
+		+ gl_TessCoord[0] * gl_TessCoord[1] * termIJ
+		+ gl_TessCoord[1] * gl_TessCoord[2] * termJK
+		+ gl_TessCoord[2] * gl_TessCoord[0] * termIK;
 
 	float tessAlpha = 1.0;
 	vec3 finalPos = (1.0 - tessAlpha) * barPos + tessAlpha * phongPos;
@@ -177,5 +164,3 @@ void tessellateDispMapPositionNormalTangentTexCoord(
 	vec3 pos = INTERPOLATE(inpos) + norm * height;
 	gl_Position = mvp * vec4(pos, 1.0);
 }
-
-

+ 5 - 5
shaders/MsCommonVert.glsl

@@ -49,7 +49,7 @@ layout(location = 4) flat out uint out_instanceId;
 void writePositionAndUv(in mat4 mvp)
 {
 #if PASS == DEPTH && LOD > 0
-	// No tex coords for you
+// No tex coords for you
 #else
 	out_uv = in_uv;
 #endif
@@ -71,17 +71,17 @@ void writeNormalAndTangent(in mat3 normalMat)
 
 	// Passthrough
 	out_normal = in_normal.xyz;
-#	if PASS == COLOR
+#if PASS == COLOR
 	out_tangent = in_tangent;
-#	endif
+#endif
 
 #else
 
-#	if PASS == COLOR
+#if PASS == COLOR
 	out_normal = normalMat * in_normal.xyz;
 	out_tangent.xyz = normalMat * in_tangent.xyz;
 	out_tangent.w = in_tangent.w;
-#	endif
+#endif
 
 #endif
 }

+ 2 - 2
shaders/MsFsCommon.glsl

@@ -33,8 +33,8 @@
 
 // Read from animated texture
 #define readAnimatedTextureRgba_DEFINED
-vec4 readAnimatedTextureRgba(sampler2DArray tex, float layerCount, float period,
-	vec2 uv, float time)
+vec4 readAnimatedTextureRgba(
+	sampler2DArray tex, float layerCount, float period, vec2 uv, float time)
 {
 	float layer = mod(time * layerCount / period, layerCount);
 	return texture(tex, vec3(uv, layer));

+ 9 - 10
shaders/NearDepthUpscale.frag.glsl

@@ -24,15 +24,15 @@ const float DEPTH_THRESHOLD = 1.0 / 1000.0;
 
 const vec2 COLOR_TEX_TEXEL_SIZE = 1.0 / vec2(TEXTURE_WIDTH, TEXTURE_HEIGHT);
 
-const vec2 OFFSETS[8] = vec2[](
-	vec2(-COLOR_TEX_TEXEL_SIZE.x, -COLOR_TEX_TEXEL_SIZE.y),
-	vec2( 0.0,                    -COLOR_TEX_TEXEL_SIZE.y),
-	vec2( COLOR_TEX_TEXEL_SIZE.x, -COLOR_TEX_TEXEL_SIZE.y),
-	vec2( COLOR_TEX_TEXEL_SIZE.x,  0.0),
-	vec2( COLOR_TEX_TEXEL_SIZE.x,  COLOR_TEX_TEXEL_SIZE.y),
-	vec2( 0.0,                     COLOR_TEX_TEXEL_SIZE.y),
-	vec2(-COLOR_TEX_TEXEL_SIZE.x,  COLOR_TEX_TEXEL_SIZE.y),
-	vec2(-COLOR_TEX_TEXEL_SIZE.x,  0.0));
+const vec2 OFFSETS[8] =
+	vec2[](vec2(-COLOR_TEX_TEXEL_SIZE.x, -COLOR_TEX_TEXEL_SIZE.y),
+		vec2(0.0, -COLOR_TEX_TEXEL_SIZE.y),
+		vec2(COLOR_TEX_TEXEL_SIZE.x, -COLOR_TEX_TEXEL_SIZE.y),
+		vec2(COLOR_TEX_TEXEL_SIZE.x, 0.0),
+		vec2(COLOR_TEX_TEXEL_SIZE.x, COLOR_TEX_TEXEL_SIZE.y),
+		vec2(0.0, COLOR_TEX_TEXEL_SIZE.y),
+		vec2(-COLOR_TEX_TEXEL_SIZE.x, COLOR_TEX_TEXEL_SIZE.y),
+		vec2(-COLOR_TEX_TEXEL_SIZE.x, 0.0));
 
 void main()
 {
@@ -82,4 +82,3 @@ void main()
 		out_color = textureLod(u_colorTexNearest, newUv, 0.0).rgb;
 	}
 }
-

+ 2 - 5
shaders/NearDepthUpscale.vert.glsl

@@ -15,10 +15,8 @@ layout(location = 1) out vec2 out_uvHigh;
 
 void main()
 {
-	const vec2 POSITIONS[3] = vec2[](
-		vec2(-1.0, -1.0),
-		vec2(3.0, -1.0),
-		vec2(-1.0, 3.0));
+	const vec2 POSITIONS[3] =
+		vec2[](vec2(-1.0, -1.0), vec2(3.0, -1.0), vec2(-1.0, 3.0));
 
 	vec2 pos = POSITIONS[gl_VertexID];
 	gl_Position = vec4(pos, 0.0, 1.0);
@@ -35,4 +33,3 @@ void main()
 	const vec2 UV_OFFSET_HIGH = TEXEL_SIZE_HIGH / 2.0;
 	out_uvHigh = pos * 0.5 + (0.5 + UV_OFFSET_HIGH);
 }
-

+ 7 - 10
shaders/Pack.glsl

@@ -12,9 +12,9 @@
 /// See the clean code in comments in revision < r467
 vec2 packNormal(in vec3 normal)
 {
-    const float SCALE = 1.7777;
-    float scalar1 = (normal.z + 1.0) * (SCALE * 2.0);
-    return normal.xy / scalar1 + 0.5;
+	const float SCALE = 1.7777;
+	float scalar1 = (normal.z + 1.0) * (SCALE * 2.0);
+	return normal.xy / scalar1 + 0.5;
 }
 
 /// Reverse the packNormal
@@ -54,10 +54,10 @@ vec4 unpackUnorm4x8(in highp uint u)
 // The RGB should be in [0, 1] and the output YCbCr will be in [0, 1] as well.
 vec3 rgbToYCbCr(in vec3 rgb)
 {
-    float y = dot(rgb, vec3(0.299, 0.587, 0.114));
+	float y = dot(rgb, vec3(0.299, 0.587, 0.114));
 	float cb = 0.5 + dot(rgb, vec3(-0.168736, -0.331264, 0.5));
 	float cr = 0.5 + dot(rgb, vec3(0.5, -0.418688, -0.081312));
-    return vec3(y, cb, cr);
+	return vec3(y, cb, cr);
 }
 
 // Convert the output of rgbToYCbCr back to RGB.
@@ -111,10 +111,7 @@ struct GbufferInfo
 };
 
 // Populate the G buffer
-void writeGBuffer(in GbufferInfo g, 
-	out vec4 rt0,
-	out vec4 rt1,
-	out vec4 rt2)
+void writeGBuffer(in GbufferInfo g, out vec4 rt0, out vec4 rt1, out vec4 rt2)
 {
 	rt0 = vec4(g.diffuse, g.subsurface);
 	rt1 = vec4(g.specular, g.emission / MAX_EMISSION);
@@ -132,7 +129,7 @@ void readNormalRoughnessMetallicFromGBuffer(
 }
 
 // Read from G-buffer
-void readNormalFromGBuffer(in sampler2D rt2,  in vec2 uv, out vec3 normal)
+void readNormalFromGBuffer(in sampler2D rt2, in vec2 uv, out vec3 normal)
 {
 	vec2 comp = texture(rt2, uv).rg;
 	normal = unpackNormal(comp);

+ 10 - 12
shaders/Pps.frag.glsl

@@ -40,8 +40,7 @@ layout(location = 0) out vec3 out_color;
 
 const vec2 TEX_OFFSET = vec2(1.0 / float(FBO_WIDTH), 1.0 / float(FBO_HEIGHT));
 
-const vec2 KERNEL[8] = vec2[](
-	vec2(TEX_OFFSET.x, TEX_OFFSET.y),
+const vec2 KERNEL[8] = vec2[](vec2(TEX_OFFSET.x, TEX_OFFSET.y),
 	vec2(0.0, TEX_OFFSET.y),
 	vec2(-TEX_OFFSET.x, TEX_OFFSET.y),
 	vec2(-TEX_OFFSET.x, 0.0),
@@ -101,15 +100,15 @@ vec3 sharpen(in sampler2D tex, in vec2 texCoords)
 //==============================================================================
 vec3 erosion(in sampler2D tex, in vec2 texCoords)
 {
-    vec3 minValue = textureRt(tex, texCoords).rgb;
+	vec3 minValue = textureRt(tex, texCoords).rgb;
 
-    for (int i = 0; i < 8; i++)
-    {
-        vec3 tmpCol = textureRt(tex, texCoords + KERNEL[i]).rgb;
-        minValue = min(tmpCol, minValue);
-    }
+	for(int i = 0; i < 8; i++)
+	{
+		vec3 tmpCol = textureRt(tex, texCoords + KERNEL[i]).rgb;
+		minValue = min(tmpCol, minValue);
+	}
 
-    return minValue;
+	return minValue;
 }
 
 //==============================================================================
@@ -128,8 +127,8 @@ vec3 fog(vec3 colorIn, vec2 uv)
 {
 	float depth = textureLod(u_msDepthRt, uv, 1.0).r;
 
-	float linearDepth = linearizeDepth(depth, u_uniforms.nearFarPad2.x,
-		u_uniforms.nearFarPad2.y);
+	float linearDepth = linearizeDepth(
+		depth, u_uniforms.nearFarPad2.x, u_uniforms.nearFarPad2.y);
 
 	linearDepth = pow(linearDepth, 1.0);
 	float t = linearDepth * u_uniforms.fogColorFogFactor.w;
@@ -177,4 +176,3 @@ void main()
 #endif
 #endif
 }
-

+ 9 - 10
shaders/PpsTmAverageLuminance.comp.glsl

@@ -7,15 +7,14 @@
 #include "shaders/Tonemapping.glsl"
 
 #if IS_RT_MIPMAP == 0
-#	error Wrong mipmap
+#error Wrong mipmap
 #endif
 
 const uint WORKGROUP_SIZE_X = 16u;
 const uint WORKGROUP_SIZE_Y = 16u;
 const uint WORKGROUP_SIZE = WORKGROUP_SIZE_X * WORKGROUP_SIZE_Y;
 
-layout(
-	local_size_x = WORKGROUP_SIZE_X,
+layout(local_size_x = WORKGROUP_SIZE_X,
 	local_size_y = WORKGROUP_SIZE_Y,
 	local_size_z = 1) in;
 
@@ -44,15 +43,17 @@ void main()
 	{
 		for(uint x = 0; x < PIXEL_READ_X; ++x)
 		{
-			vec3 color = texelFetch(
-				u_isRt, ivec2(xStart, yStart) + ivec2(x, y), IS_RT_MIPMAP).rgb;
+			vec3 color =
+				texelFetch(
+					u_isRt, ivec2(xStart, yStart) + ivec2(x, y), IS_RT_MIPMAP)
+					.rgb;
 			float lum = computeLuminance(color);
-			//avgLum += log(lum);
+			// avgLum += log(lum);
 			avgLum += lum / float(MIPMAP_WIDTH * MIPMAP_HEIGHT);
 		}
 	}
 
-	//avgLum *= 1.0 / float(PIXEL_READ_X * PIXEL_READ_Y);
+	// avgLum *= 1.0 / float(PIXEL_READ_X * PIXEL_READ_Y);
 	g_avgLum[gl_LocalInvocationIndex] = avgLum;
 
 	memoryBarrierShared();
@@ -75,7 +76,7 @@ void main()
 	if(gl_LocalInvocationIndex == 0)
 	{
 		float crntLum = g_avgLum[0];
-		//crntLum = exp(crntLum / float(WORKGROUP_SIZE));
+		// crntLum = exp(crntLum / float(WORKGROUP_SIZE));
 		crntLum = max(crntLum, 0.04);
 
 #if 1
@@ -90,5 +91,3 @@ void main()
 #endif
 	}
 }
-
-

+ 2 - 4
shaders/Quad.vert.glsl

@@ -14,10 +14,8 @@ layout(location = 0) out vec2 out_texCoord;
 
 void main()
 {
-	const vec2 POSITIONS[3] = vec2[](
-		vec2(-1.0, -1.0),
-		vec2(3.0, -1.0),
-		vec2(-1.0, 3.0));
+	const vec2 POSITIONS[3] =
+		vec2[](vec2(-1.0, -1.0), vec2(3.0, -1.0), vec2(-1.0, 3.0));
 
 	vec2 pos = POSITIONS[gl_VertexID];
 	out_texCoord = pos * 0.5 + 0.5;

+ 6 - 6
shaders/Refl.frag.glsl

@@ -54,9 +54,9 @@ void main()
 	vec3 eye = normalize(posVSpace);
 	vec3 r = reflect(eye, gbuffer.normal);
 
-	//
-	// SSLR
-	//
+//
+// SSLR
+//
 #if SSLR_ENABLED
 	float sslrContribution;
 
@@ -74,9 +74,9 @@ void main()
 	const float sslrContribution = 0.0;
 #endif
 
-	//
-	// IR
-	//
+//
+// IR
+//
 #if IR_ENABLED
 	float reflLod = float(IR_MIPMAP_COUNT) * gbuffer.roughness;
 	vec3 imgRefl = doImageReflections(posVSpace, r, reflLod);

+ 5 - 7
shaders/PpsSsao.frag.glsl → shaders/Ssao.frag.glsl

@@ -51,12 +51,11 @@ vec3 readNormal(in vec2 uv)
 // Read the noise tex
 vec3 readRandom(in vec2 uv)
 {
-	const vec2 tmp = vec2(
-		float(WIDTH) / float(NOISE_MAP_SIZE),
+	const vec2 tmp = vec2(float(WIDTH) / float(NOISE_MAP_SIZE),
 		float(HEIGHT) / float(NOISE_MAP_SIZE));
 
 	vec3 noise = texture(u_noiseMap, tmp * uv).xyz;
-	//return normalize(noise * 2.0 - 1.0);
+	// return normalize(noise * 2.0 - 1.0);
 	return noise;
 }
 
@@ -64,8 +63,8 @@ vec3 readRandom(in vec2 uv)
 float readZ(in vec2 uv)
 {
 	float depth = texture(u_mMsDepthRt, uv).r;
-	float z = u_uniforms.projectionParams.z
-		/ (u_uniforms.projectionParams.w + depth);
+	float z =
+		u_uniforms.projectionParams.z / (u_uniforms.projectionParams.w + depth);
 	return z;
 }
 
@@ -111,7 +110,7 @@ void main(void)
 		vec4 offset = vec4(sample_, 1.0);
 		offset = u_uniforms.projectionMatrix * offset;
 		offset.xy = offset.xy / (2.0 * offset.w) + 0.5; // persp div &
-		                                                // to NDC -> [0, 1]
+		// to NDC -> [0, 1]
 
 		// get sample depth:
 		float sampleDepth = readZ(offset.xy);
@@ -133,4 +132,3 @@ void main(void)
 
 	out_color = 1.0 - factor;
 }
-

+ 5 - 9
shaders/PpsSslf.frag.glsl → shaders/Sslf.frag.glsl

@@ -23,15 +23,13 @@ layout(binding = 1) uniform sampler2D u_lensDirtTex;
 
 layout(location = 0) out vec3 out_color;
 
-vec3 textureDistorted(
-	in sampler2D tex,
+vec3 textureDistorted(in sampler2D tex,
 	in vec2 texcoord,
 	in vec2 direction, // direction of distortion
 	in vec3 distortion) // per-channel distortion factor
 {
 #if ENABLE_CHROMATIC_DISTORTION
-	return vec3(
-		textureRt(tex, texcoord + direction * distortion.r).r,
+	return vec3(textureRt(tex, texcoord + direction * distortion.r).r,
 		textureRt(tex, texcoord + direction * distortion.g).g,
 		textureRt(tex, texcoord + direction * distortion.b).b);
 #else
@@ -47,8 +45,7 @@ void main()
 
 	const vec2 texelSize = 1.0 / vec2(TEX_DIMENSIONS);
 
-	const vec3 distortion = vec3(
-		-texelSize.x * CHROMATIC_DISTORTION,
+	const vec3 distortion = vec3(-texelSize.x * CHROMATIC_DISTORTION,
 		0.0,
 		texelSize.x * CHROMATIC_DISTORTION);
 
@@ -70,11 +67,10 @@ void main()
 			textureDistorted(u_rt, offset, direction, distortion) * weight;
 	}
 
-	// sample halo
+// sample halo
 #if ENABLE_HALO
 	vec2 haloVec = normalize(ghostVec) * HALO_WIDTH;
-	float weight =
-		length(vec2(0.5) - fract(texcoord + haloVec)) / lenOfHalf;
+	float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / lenOfHalf;
 	weight = pow(1.0 - weight, 20.0);
 	result += textureDistorted(u_rt, texcoord + haloVec, direction, distortion)
 		* (weight * HALO_OPACITY);

+ 1 - 4
shaders/TilerMinMax.comp.glsl

@@ -22,8 +22,7 @@ layout(std430, binding = 0) writeonly buffer _blk
 	vec2 u_depthLimits[];
 };
 
-layout(
-	local_size_x = WORKGROUP_SIZE_X,
+layout(local_size_x = WORKGROUP_SIZE_X,
 	local_size_y = WORKGROUP_SIZE_Y,
 	local_size_z = 1) in;
 
@@ -70,5 +69,3 @@ void main()
 		u_depthLimits[idx] = vec2(g_minDepth, g_maxDepth) / float(U32_MAX);
 	}
 }
-
-

+ 4 - 3
shaders/Tonemapping.glsl

@@ -48,16 +48,17 @@ vec3 tonemapUncharted2(in vec3 color)
 	const float F = 0.30;
 
 	return ((color * (A * color + C * B) + D * E)
-		/ (color * (A * color + B) + D * F)) - E / F;
+			   / (color * (A * color + B) + D * F))
+		- E / F;
 }
 
 vec3 tonemap(in vec3 color, in float avgLum, in float threshold)
 {
 	vec3 c = computeExposedColor(color, avgLum, threshold);
-	//float saturation = clamp(avgLum, 0.0, 1.0);
+	// float saturation = clamp(avgLum, 0.0, 1.0);
 	float saturation = 1.0;
 	return tonemapReinhard(c, saturation);
-	//return tonemapUncharted2(c);
+	// return tonemapUncharted2(c);
 }
 
 #endif

+ 39 - 28
shaders/VariableSamplingBlurGeneric.frag.glsl

@@ -13,19 +13,19 @@
 
 // Preprocessor switches sanity checks
 #if !defined(VPASS) && !defined(HPASS)
-#	error See file
+#error See file
 #endif
 
 #if !(defined(COL_RGBA) || defined(COL_RGB) || defined(COL_R))
-#	error See file
+#error See file
 #endif
 
 #if !defined(IMG_DIMENSION)
-#	error See file
+#error See file
 #endif
 
 #if !defined(SAMPLES)
-#	error See file
+#error See file
 #endif
 
 // Input RT with different binding for less GL API calls
@@ -34,78 +34,89 @@ layout(binding = 0) uniform mediump sampler2D uTex;
 layout(location = 0) in vec2 in_texCoord;
 
 #if !defined(BLURRING_DIST)
-#	define BLURRING_DIST 0.0
+#define BLURRING_DIST 0.0
 #endif
 
 // Determine color type
 #if defined(COL_RGBA)
-#	define COL_TYPE vec4
+#define COL_TYPE vec4
 #elif defined(COL_RGB)
-#	define COL_TYPE vec3
+#define COL_TYPE vec3
 #elif defined(COL_R)
-#	define COL_TYPE float
+#define COL_TYPE float
 #endif
 
 // Determine tex fetch
 #if defined(COL_RGBA)
-#	define TEX_FETCH rgba
+#define TEX_FETCH rgba
 #elif defined(COL_RGB)
-#	define TEX_FETCH rgb
+#define TEX_FETCH rgb
 #elif defined(COL_R)
-#	define TEX_FETCH r
+#define TEX_FETCH r
 #endif
 
 const float OFFSET = 1.0 / (2.0 * IMG_DIMENSION);
 
 // Calc the kernel. Use offsets of 3 to take advantage of bilinear filtering
-#define BLURRING(val, sign_) ((float(val) * (float(BLURRING_DIST) + 1.0) / float(IMG_DIMENSION)) * float(sign_) + OFFSET)
+#define BLURRING(val, sign_)                                                   \
+	((float(val) * (float(BLURRING_DIST) + 1.0) / float(IMG_DIMENSION))        \
+			* float(sign_)                                                     \
+		+ OFFSET)
 
 #if defined(VPASS)
-#	define BLURRING_OFFSET_X(val, sign_) BLURRING(val, sign_)
-#	define BLURRING_OFFSET_Y(val, sign_) 0.0
+#define BLURRING_OFFSET_X(val, sign_) BLURRING(val, sign_)
+#define BLURRING_OFFSET_Y(val, sign_) 0.0
 #else
-#	define BLURRING_OFFSET_X(val, sign_) 0.0
-#	define BLURRING_OFFSET_Y(val, sign_) BLURRING(val, sign_)
+#define BLURRING_OFFSET_X(val, sign_) 0.0
+#define BLURRING_OFFSET_Y(val, sign_) BLURRING(val, sign_)
 #endif
 
-#define BLURRING_OFFSET(v, s) vec2(BLURRING_OFFSET_X(v, s), BLURRING_OFFSET_Y(v, s))
+#define BLURRING_OFFSET(v, s)                                                  \
+	vec2(BLURRING_OFFSET_X(v, s), BLURRING_OFFSET_Y(v, s))
 
-const vec2 KERNEL[SAMPLES - 1] = vec2[](
-	BLURRING_OFFSET(1, -1),
+const vec2 KERNEL[SAMPLES - 1] = vec2[](BLURRING_OFFSET(1, -1),
 	BLURRING_OFFSET(1, 1)
 #if SAMPLES > 3
-	,BLURRING_OFFSET(2, -1),
+		,
+	BLURRING_OFFSET(2, -1),
 	BLURRING_OFFSET(2, 1)
 #endif
 #if SAMPLES > 5
-	,BLURRING_OFFSET(3, -1),
+		,
+	BLURRING_OFFSET(3, -1),
 	BLURRING_OFFSET(3, 1)
 #endif
 #if SAMPLES > 7
-	,BLURRING_OFFSET(4, -1),
+		,
+	BLURRING_OFFSET(4, -1),
 	BLURRING_OFFSET(4, 1)
 #endif
 #if SAMPLES > 9
-	,BLURRING_OFFSET(5, -1),
+		,
+	BLURRING_OFFSET(5, -1),
 	BLURRING_OFFSET(5, 1)
 #endif
 #if SAMPLES > 11
-	,BLURRING_OFFSET(6, -1),
+		,
+	BLURRING_OFFSET(6, -1),
 	BLURRING_OFFSET(6, 1)
 #endif
 #if SAMPLES > 13
-	,BLURRING_OFFSET(7, -1),
+		,
+	BLURRING_OFFSET(7, -1),
 	BLURRING_OFFSET(7, 1)
 #endif
 #if SAMPLES > 15
-	,BLURRING_OFFSET(8, -1),
+		,
+	BLURRING_OFFSET(8, -1),
 	BLURRING_OFFSET(8, 1)
 #endif
 #if SAMPLES > 17
-	,BLURRING_OFFSET(9, -1),
+		,
+	BLURRING_OFFSET(9, -1),
 	BLURRING_OFFSET(9, 1)
 #endif
-	);
+		);
 
 layout(location = 0) out COL_TYPE out_fragColor;
 

+ 0 - 250
shaders/photoshop_filters.glsl

@@ -1,250 +0,0 @@
-// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-/*
-** Photoshop & misc math
-** Blending modes, RGB/HSL/Contrast/Desaturate, levels control
-**
-** Romain Dura | Romz
-** Blog: http://blog.mouaif.org
-** Post: http://blog.mouaif.org/?p=94
-*/
-
-
-/*
-** Desaturation
-*/
-
-vec4 Desaturate(vec3 color, float Desaturation)
-{
-	vec3 grayXfer = vec3(0.3, 0.59, 0.11);
-	vec3 gray = vec3(dot(grayXfer, color));
-	return vec4(mix(color, gray, Desaturation), 1.0);
-}
-
-
-/*
-** Hue, saturation, luminance
-*/
-
-vec3 RGBToHSL(vec3 color)
-{
-	vec3 hsl; // init to 0 to avoid warnings ? (and reverse if + remove first part)
-
-	float fmin = min(min(color.r, color.g), color.b);    //Min. value of RGB
-	float fmax = max(max(color.r, color.g), color.b);    //Max. value of RGB
-	float delta = fmax - fmin;             //Delta RGB value
-
-	hsl.z = (fmax + fmin) / 2.0; // Luminance
-
-	if (delta == 0.0)		//This is a gray, no chroma...
-	{
-		hsl.x = 0.0;	// Hue
-		hsl.y = 0.0;	// Saturation
-	}
-	else                                    //Chromatic data...
-	{
-		if (hsl.z < 0.5)
-			hsl.y = delta / (fmax + fmin); // Saturation
-		else
-			hsl.y = delta / (2.0 - fmax - fmin); // Saturation
-
-		float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
-		float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
-		float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
-
-		if (color.r == fmax )
-			hsl.x = deltaB - deltaG; // Hue
-		else if (color.g == fmax)
-			hsl.x = (1.0 / 3.0) + deltaR - deltaB; // Hue
-		else if (color.b == fmax)
-			hsl.x = (2.0 / 3.0) + deltaG - deltaR; // Hue
-
-		if (hsl.x < 0.0)
-			hsl.x += 1.0; // Hue
-		else if (hsl.x > 1.0)
-			hsl.x -= 1.0; // Hue
-	}
-
-	return hsl;
-}
-
-float HueToRGB(float f1, float f2, float hue)
-{
-	if (hue < 0.0)
-		hue += 1.0;
-	else if (hue > 1.0)
-		hue -= 1.0;
-	float res;
-	if ((6.0 * hue) < 1.0)
-		res = f1 + (f2 - f1) * 6.0 * hue;
-	else if ((2.0 * hue) < 1.0)
-		res = f2;
-	else if ((3.0 * hue) < 2.0)
-		res = f1 + (f2 - f1) * ((2.0 / 3.0) - hue) * 6.0;
-	else
-		res = f1;
-	return res;
-}
-
-vec3 HSLToRGB(vec3 hsl)
-{
-	vec3 rgb;
-
-	if (hsl.y == 0.0)
-		rgb = vec3(hsl.z); // Luminance
-	else
-	{
-		float f2;
-
-		if (hsl.z < 0.5)
-			f2 = hsl.z * (1.0 + hsl.y);
-		else
-			f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
-
-		float f1 = 2.0 * hsl.z - f2;
-
-		rgb.r = HueToRGB(f1, f2, hsl.x + (1.0/3.0));
-		rgb.g = HueToRGB(f1, f2, hsl.x);
-		rgb.b= HueToRGB(f1, f2, hsl.x - (1.0/3.0));
-	}
-
-	return rgb;
-}
-
-
-/*
-** Contrast, saturation, brightness
-** Code of this function is from TGM's shader pack
-** http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=21057
-*/
-
-// For all settings: 1.0 = 100% 0.5=50% 1.5 = 150%
-vec3 ContrastSaturationBrightness(vec3 color, float brt, float sat, float con)
-{
-	// Increase or decrease theese values to adjust r, g and b color channels seperately
-	const float AvgLumR = 0.5;
-	const float AvgLumG = 0.5;
-	const float AvgLumB = 0.5;
-
-	const vec3 LumCoeff = vec3(0.2125, 0.7154, 0.0721);
-
-	vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
-	vec3 brtColor = color * brt;
-	vec3 intensity = vec3(dot(brtColor, LumCoeff));
-	vec3 satColor = mix(intensity, brtColor, sat);
-	vec3 conColor = mix(AvgLumin, satColor, con);
-	return conColor;
-}
-
-
-/*
-** Float blending modes
-** Adapted from here: http://www.nathanm.com/photoshop-blending-math/
-** But I modified the HardMix (wrong condition), Overlay, SoftLight, ColorDodge, ColorBurn, VividLight, PinLight (inverted layers) ones to have correct results
-*/
-
-#define BlendLinearDodgef 			BlendAddf
-#define BlendLinearBurnf 			BlendSubstractf
-#define BlendAddf(base, blend) 		min(base + blend, 1.0)
-#define BlendSubstractf(base, blend) 	max(base + blend - 1.0, 0.0)
-#define BlendLightenf(base, blend) 		max(blend, base)
-#define BlendDarkenf(base, blend) 		min(blend, base)
-#define BlendLinearLightf(base, blend) 	(blend < 0.5 ? BlendLinearBurnf(base, (2.0 * blend)) : BlendLinearDodgef(base, (2.0 * (blend - 0.5))))
-#define BlendScreenf(base, blend) 		(1.0 - ((1.0 - base) * (1.0 - blend)))
-#define BlendOverlayf(base, blend) 	(base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))
-#define BlendSoftLightf(base, blend) 	((blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend)))
-#define BlendColorDodgef(base, blend) 	((blend == 1.0) ? blend : min(base / (1.0 - blend), 1.0))
-#define BlendColorBurnf(base, blend) 	((blend == 0.0) ? blend : max((1.0 - ((1.0 - base) / blend)), 0.0))
-#define BlendVividLightf(base, blend) 	((blend < 0.5) ? BlendColorBurnf(base, (2.0 * blend)) : BlendColorDodgef(base, (2.0 * (blend - 0.5))))
-#define BlendPinLightf(base, blend) 	((blend < 0.5) ? BlendDarkenf(base, (2.0 * blend)) : BlendLightenf(base, (2.0 *(blend - 0.5))))
-#define BlendHardMixf(base, blend) 	((BlendVividLightf(base, blend) < 0.5) ? 0.0 : 1.0)
-#define BlendReflectf(base, blend) 		((blend == 1.0) ? blend : min(base * base / (1.0 - blend), 1.0))
-
-
-/*
-** Vector3 blending modes
-*/
-
-// Component wise blending
-#define Blend(base, blend, funcf) 		vec3(funcf(base.r, blend.r), funcf(base.g, blend.g), funcf(base.b, blend.b))
-
-#define BlendNormal(base, blend) 		(blend)
-#define BlendLighten				BlendLightenf
-#define BlendDarken				BlendDarkenf
-#define BlendMultiply(base, blend) 		(base * blend)
-#define BlendAverage(base, blend) 		((base + blend) / 2.0)
-#define BlendAdd(base, blend) 		min(base + blend, vec3(1.0))
-#define BlendSubstract(base, blend) 	max(base + blend - vec3(1.0), vec3(0.0))
-#define BlendDifference(base, blend) 	abs(base - blend)
-#define BlendNegation(base, blend) 	(vec3(1.0) - abs(vec3(1.0) - base - blend))
-#define BlendExclusion(base, blend) 	(base + blend - 2.0 * base * blend)
-#define BlendScreen(base, blend) 		Blend(base, blend, BlendScreenf)
-#define BlendOverlay(base, blend) 		Blend(base, blend, BlendOverlayf)
-#define BlendSoftLight(base, blend) 	Blend(base, blend, BlendSoftLightf)
-#define BlendHardLight(base, blend) 	BlendOverlay(blend, base)
-#define BlendColorDodge(base, blend) 	Blend(base, blend, BlendColorDodgef)
-#define BlendColorBurn(base, blend) 	Blend(base, blend, BlendColorBurnf)
-#define BlendLinearDodge			BlendAdd
-#define BlendLinearBurn			BlendSubstract
-// Linear Light is another contrast-increasing mode
-// If the blend color is darker than midgray, Linear Light darkens the image by decreasing the brightness. If the blend color is lighter than midgray, the result is a brighter image due to increased brightness.
-#define BlendLinearLight(base, blend) 	Blend(base, blend, BlendLinearLightf)
-#define BlendVividLight(base, blend) 	Blend(base, blend, BlendVividLightf)
-#define BlendPinLight(base, blend) 		Blend(base, blend, BlendPinLightf)
-#define BlendHardMix(base, blend) 		Blend(base, blend, BlendHardMixf)
-#define BlendReflect(base, blend) 		Blend(base, blend, BlendReflectf)
-#define BlendGlow(base, blend) 		BlendReflect(blend, base)
-#define BlendPhoenix(base, blend) 		(min(base, blend) - max(base, blend) + vec3(1.0))
-#define BlendOpacity(base, blend, F, O) 	(F(base, blend) * O + blend * (1.0 - O))
-
-
-// Hue Blend mode creates the result color by combining the luminance and saturation of the base color with the hue of the blend color.
-vec3 BlendHue(vec3 base, vec3 blend)
-{
-	vec3 baseHSL = RGBToHSL(base);
-	return HSLToRGB(vec3(RGBToHSL(blend).r, baseHSL.g, baseHSL.b));
-}
-
-// Saturation Blend mode creates the result color by combining the luminance and hue of the base color with the saturation of the blend color.
-vec3 BlendSaturation(vec3 base, vec3 blend)
-{
-	vec3 baseHSL = RGBToHSL(base);
-	return HSLToRGB(vec3(baseHSL.r, RGBToHSL(blend).g, baseHSL.b));
-}
-
-// Color Mode keeps the brightness of the base color and applies both the hue and saturation of the blend color.
-vec3 BlendColor(vec3 base, vec3 blend)
-{
-	vec3 blendHSL = RGBToHSL(blend);
-	return HSLToRGB(vec3(blendHSL.r, blendHSL.g, RGBToHSL(base).b));
-}
-
-// Luminosity Blend mode creates the result color by combining the hue and saturation of the base color with the luminance of the blend color.
-vec3 BlendLuminosity(vec3 base, vec3 blend)
-{
-	vec3 baseHSL = RGBToHSL(base);
-	return HSLToRGB(vec3(baseHSL.r, baseHSL.g, RGBToHSL(blend).b));
-}
-
-
-/*
-** Gamma correction
-** Details: http://blog.mouaif.org/2009/01/22/photoshop-gamma-correction-shader/
-*/
-
-#define GammaCorrection(color, gamma)								pow(color, 1.0 / gamma)
-
-/*
-** Levels control (input (+gamma), output)
-** Details: http://blog.mouaif.org/2009/01/28/levels-control-shader/
-*/
-
-#define LevelsControlInputRange(color, minInput, maxInput)				min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0))
-#define LevelsControlInput(color, minInput, gamma, maxInput)				GammaCorrection(LevelsControlInputRange(color, minInput, maxInput), gamma)
-#define LevelsControlOutputRange(color, minOutput, maxOutput) 			mix(vec3(minOutput), vec3(maxOutput), color)
-#define LevelsControl(color, minInput, gamma, maxInput, minOutput, maxOutput) 	LevelsControlOutputRange(LevelsControlInput(color, minInput, gamma, maxInput), minOutput, maxOutput)
-
-

+ 1 - 1
src/renderer/Bloom.cpp

@@ -87,7 +87,7 @@ Error Bloom::initInternal(const ConfigSet& config)
 		m_r->getHeight());
 
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
-		m_toneFrag, "shaders/PpsBloom.frag.glsl", pps.toCString(), "r_"));
+		m_toneFrag, "shaders/Bloom.frag.glsl", pps.toCString(), "r_"));
 
 	m_r->createDrawQuadPipeline(
 		m_toneFrag->getGrShader(), colorState, m_tonePpline);

+ 1 - 1
src/renderer/Ssao.cpp

@@ -194,7 +194,7 @@ Error Ssao::initInternal(const ConfigSet& config)
 		&kernelStr[0]);
 
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
-		m_ssaoFrag, "shaders/PpsSsao.frag.glsl", pps.toCString(), "r_"));
+		m_ssaoFrag, "shaders/Ssao.frag.glsl", pps.toCString(), "r_"));
 
 	m_r->createDrawQuadPipeline(
 		m_ssaoFrag->getGrShader(), colorState, m_ssaoPpline);

+ 1 - 1
src/renderer/Sslf.cpp

@@ -44,7 +44,7 @@ Error Sslf::initInternal(const ConfigSet& config)
 		m_r->getPps().getBloom().getHeight());
 
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
-		m_frag, "shaders/PpsSslf.frag.glsl", pps.toCString(), "r_"));
+		m_frag, "shaders/Sslf.frag.glsl", pps.toCString(), "r_"));
 
 	ColorStateInfo colorState;
 	colorState.m_attachmentCount = 1;

+ 1 - 1
tools/format_source.sh

@@ -1 +1 @@
-find ./src ./include ./tests ./testapp ./tools -name '*.h' -o -name '*.hpp' -o -name '*.c' -o -name '*.cpp' | xargs -I % ./thirdparty/bin/clang-format -sort-includes=false -i %
+find ./src ./include ./tests ./testapp ./tools ./shaders -name '*.h' -o -name '*.hpp' -o -name '*.c' -o -name '*.cpp' -o -name '*.glsl' | xargs -I % ./thirdparty/bin/clang-format -sort-includes=false -i %