Panagiotis Christopoulos Charitos преди 3 години
родител
ревизия
05925d0dd0
променени са 4 файла, в които са добавени 7 реда и са изтрити 6 реда
  1. 2 2
      AnKi/ShaderCompiler/ShaderProgramParser.cpp
  2. 2 2
      AnKi/Shaders/GBufferCommon.glsl
  3. 2 1
      AnKi/Shaders/IndirectDiffuse.glsl
  4. 1 1
      Sandbox/Main.cpp

+ 2 - 2
AnKi/ShaderCompiler/ShaderProgramParser.cpp

@@ -253,9 +253,9 @@ layout(std140, row_major) uniform;
 layout(std140, row_major) buffer;
 
 #if ANKI_FORCE_FULL_FP_PRECISION
-#	define ANKI_RP mediump
+#	define ANKI_RP
 #else
-#	define ANKI_RP highp
+#	define ANKI_RP mediump
 #endif
 
 #define ANKI_FP highp

+ 2 - 2
AnKi/Shaders/GBufferCommon.glsl

@@ -40,7 +40,7 @@ out gl_PerVertex
 layout(location = 0) out Vec2 out_uv;
 layout(location = 1) out ANKI_RP Vec3 out_normal;
 layout(location = 2) out ANKI_RP Vec3 out_tangent;
-layout(location = 3) out ANKI_RP Vec3 out_bitangent;
+layout(location = 3) out Vec3 out_bitangent;
 
 #		if REALLY_USING_PARALLAX
 layout(location = 4) out F32 out_distFromTheCamera;
@@ -61,7 +61,7 @@ layout(location = 7) out Vec2 out_velocity;
 layout(location = 0) in Vec2 in_uv;
 layout(location = 1) in ANKI_RP Vec3 in_normal;
 layout(location = 2) in ANKI_RP Vec3 in_tangent;
-layout(location = 3) in ANKI_RP Vec3 in_bitangent;
+layout(location = 3) in Vec3 in_bitangent;
 
 #	if REALLY_USING_PARALLAX
 layout(location = 4) in F32 in_distFromTheCamera;

+ 2 - 1
AnKi/Shaders/IndirectDiffuse.glsl

@@ -100,9 +100,10 @@ void main()
 		const UVec2 globalInvocation = UVec2(gl_FragCoord.xy);
 #endif
 		const UVec2 random = rand3DPCG16(UVec3(globalInvocation, u_clusteredShading.m_frame)).xy;
+		const F32 aspectRatio = u_unis.m_viewportSizef.x / u_unis.m_viewportSizef.y;
 		for(U32 i = 0u; i < u_unis.m_sampleCount; ++i)
 		{
-			const Vec2 point = UV_TO_NDC(hammersleyRandom16(i, u_unis.m_sampleCount, random));
+			const Vec2 point = UV_TO_NDC(hammersleyRandom16(i, u_unis.m_sampleCount, random)) * Vec2(1.0, aspectRatio);
 			const Vec2 finalDiskPoint = ndc + point * projRadius;
 
 			// Do a cheap unproject in view space

+ 1 - 1
Sandbox/Main.cpp

@@ -229,7 +229,7 @@ Error MyApp::userMainLoop(Bool& quit, Second elapsedTime)
 	if(in.getKey(KeyCode::U) == 1)
 	{
 		renderer.setCurrentDebugRenderTarget(
-			(renderer.getCurrentDebugRenderTarget() == "GBuffer_albedo") ? "" : "GBuffer_albedo");
+			(renderer.getCurrentDebugRenderTarget() == "IndirectDiffuse") ? "" : "IndirectDiffuse");
 	}
 
 	if(in.getKey(KeyCode::I) == 1)