Panagiotis Christopoulos Charitos 15 anos atrás
pai
commit
55326e4905

+ 9 - 13
shaders/GaussianBlurGeneric.glsl

@@ -1,12 +1,10 @@
-/**
- * @file
- * Generic shader program for Gausian blur inspired by Daniel Rakos' article
- * http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
- *
- * Switches: VPASS or HPASS, COL_RGBA or COL_RGB or COL_R
- *
- * This is an optimized version. See the clean one at rev213
- */
+/// @file
+/// Generic shader program for Gaussian blur inspired by Daniel Rakos' article
+/// http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
+///
+/// Switches: VPASS or HPASS, COL_RGBA or COL_RGB or COL_R
+///
+/// This is an optimized version. See the clean one at rev213
 
 #pragma anki vertShaderBegins
 
@@ -35,9 +33,7 @@ void main()
 #pragma anki fragShaderBegins
 
 
-/*
- * Preprocessor switcher sanity checks
- */
+// Preprocessor switches sanity checks
 #if !defined(VPASS) && !defined(HPASS)
 	#error "See file"
 #endif
@@ -54,7 +50,7 @@ in vec2 vTexCoords;
 in float vOffsets[2];
 
 
-// Determin color type
+// Determine color type
 #if defined(COL_RGBA)
 	#define COL_TYPE vec4
 #elif defined(COL_RGB)

+ 16 - 17
shaders/HwSkinningTrffbGeneric.glsl

@@ -1,22 +1,22 @@
 #pragma anki vertShaderBegins
 
-attribute vec3 position;
-attribute vec3 normal;
-attribute vec4 tangent;
-attribute float vertWeightBonesNum;
-attribute vec4  vertWeightBoneIds;
-attribute vec4  vertWeightWeights;
+in vec3 position;
+in vec3 normal;
+in vec4 tangent;
+in float vertWeightBonesNum;
+in vec4  vertWeightBoneIds;
+in vec4  vertWeightWeights;
 
 const int MAX_BONES_PER_MESH = 60;
 uniform mat3 skinningRotations[MAX_BONES_PER_MESH];
 uniform vec3 skinningTranslations[MAX_BONES_PER_MESH];
 
-#pragma anki transformFeedbackVarying outPosition
-varying vec3 outPosition;
-#pragma anki transformFeedbackVarying outNormal
-varying vec3 outNormal;
-#pragma anki transformFeedbackVarying outTangent
-varying vec4 outTangent;
+#pragma anki transformFeedbackVarying vPosition
+out vec3 vPosition;
+#pragma anki transformFeedbackVarying vNormal
+varying vec3 vNormal;
+#pragma anki transformFeedbackVarying vTangent
+varying vec4 vTangent;
 
 
 void main()
@@ -33,19 +33,18 @@ void main()
 		tsl += skinningTranslations[boneId] * weight;
 	}
 	
-	outPosition = (rot * position) + tsl;
+	vPosition = (rot * position) + tsl;
 	
 	#if defined(NORMAL_ENABLED)
-		outNormal = rot * normal;
+		vNormal = rot * normal;
 	#endif
 	
 	#if defined(TANGENT_ENABLED)
-		outTangent = vec4(rot * vec3(tangent), tangent.w);
+		vTangent = vec4(rot * vec3(tangent), tangent.w);
 	#endif	
 }
 
 #pragma anki fragShaderBegins
 
 void main()
-{
-}
+{}

+ 2 - 1
shaders/IsAp.glsl

@@ -1,5 +1,6 @@
 /// @file
-/// Ilumination stage ambient pass shader program
+/// Illumination stage ambient pass shader program
+
 #pragma anki vertShaderBegins
 
 #pragma anki include "shaders/SimpleVert.glsl"

+ 0 - 41
shaders/PpsSsaoBlur.glsl

@@ -1,41 +0,0 @@
-#pragma anki vertShaderBegins
-
-#pragma anki include "shaders/SimpleVert.glsl"
-
-#pragma anki fragShaderBegins
-
-#pragma anki include "shaders/median_filter.glsl"
-
-uniform sampler2D tex;
-
-in vec2 vTexCoords;
-
-layout(location = 0) out float fFragColor;
-
-void main()
-{
-	#if defined( _PPS_SSAO_PASS_0_ )
-		float offset = 1.0 / PASS0_FAI_WIDTH;
-	#else
-		float offset = 1.0 / PASS1_FAI_HEIGHT;
-	#endif
-	const int KERNEL_SIZE = 7;
-	float kernel[KERNEL_SIZE] = float[]( 0.0 * offset, 
-	                                    -1.0 * offset, 1.0 * offset,
-	                                    -2.0 * offset, 2.0 * offset,
-																			-3.0 * offset, 3.0 * offset/*,
-																			-4.0 * offset, 4.0 * offset,
-																			-5.0 * offset, 5.0 * offset,
-																			-6.0 * offset, 6.0 * offset*/ );
-
-	float factor = 0.0;
-	for(int i=0; i<KERNEL_SIZE; i++)
-	{
-		#if defined( _PPS_SSAO_PASS_0_ )
-			factor += texture2D( tex, vTexCoords + vec2(kernel[i], 0.0) ).a;
-		#else
-			factor += texture2D( tex, vTexCoords + vec2(0.0, kernel[i]) ).a;
-		#endif		
-	}
-	fFragColor = factor / float(KERNEL_SIZE);
-}