Browse Source

Remove the gather4 path similarly from HLSL FXAA3. Fix FXAA2 tag name in the examples. Removed dead link from documentation.

Lasse Öörni 11 years ago
parent
commit
e079878e40

+ 10 - 36
Bin/CoreData/Shaders/HLSL/FXAA3.hlsl

@@ -49,14 +49,6 @@
 #include "Transform.hlsl"
 #include "ScreenPos.hlsl"
 
-/*==========================================================================*/
-//
-//                      Shader Requirements
-//
-/*--------------------------------------------------------------------------*/
-
-#define FXAA_GATHER4 0
-
 /*============================================================================
                         FXAA QUALITY - TUNING KNOBS
 ------------------------------------------------------------------------------
@@ -378,25 +370,12 @@ float4 FxaaPixelShader(
     posM.x = pos.x;
     posM.y = pos.y;
     
-    #if (FXAA_GATHER4 == 1)
-        float4 rgbyM = FxaaTexTop(tex, posM);
-        float4 luma4A = FxaaTex4(tex, posM);
-        float4 luma4B = FxaaTexOff4(tex, posM, float2(-1, -1));
-        #define lumaM rgbyM.w
-        #define lumaE luma4A.z
-        #define lumaS luma4A.x
-        #define lumaSE luma4A.y
-        #define lumaNW luma4B.w
-        #define lumaN luma4B.z
-        #define lumaW luma4B.x
-    #else
-        float4 rgbyM = FxaaTexTop(tex, posM);
-        #define lumaM rgbyM.y
-        float lumaS = FxaaLuma(FxaaTexOff(tex, posM, float2( 0, 1), fxaaQualityRcpFrame.xy));
-        float lumaE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1, 0), fxaaQualityRcpFrame.xy));
-        float lumaN = FxaaLuma(FxaaTexOff(tex, posM, float2( 0,-1), fxaaQualityRcpFrame.xy));
-        float lumaW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1, 0), fxaaQualityRcpFrame.xy));
-    #endif
+    float4 rgbyM = FxaaTexTop(tex, posM);
+    #define lumaM rgbyM.y
+    float lumaS = FxaaLuma(FxaaTexOff(tex, posM, float2( 0, 1), fxaaQualityRcpFrame.xy));
+    float lumaE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1, 0), fxaaQualityRcpFrame.xy));
+    float lumaN = FxaaLuma(FxaaTexOff(tex, posM, float2( 0,-1), fxaaQualityRcpFrame.xy));
+    float lumaW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1, 0), fxaaQualityRcpFrame.xy));
 /*--------------------------------------------------------------------------*/
     float maxSM = max(lumaS, lumaM);
     float minSM = min(lumaS, lumaM);
@@ -414,15 +393,10 @@ float4 FxaaPixelShader(
     if(earlyExit)
         return FxaaTexTop(tex, pos);
 /*--------------------------------------------------------------------------*/
-    #if (FXAA_GATHER4 == 0)
-        float lumaNW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1,-1), fxaaQualityRcpFrame.xy));
-        float lumaSE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1, 1), fxaaQualityRcpFrame.xy));
-        float lumaNE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1,-1), fxaaQualityRcpFrame.xy));
-        float lumaSW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1, 1), fxaaQualityRcpFrame.xy));
-    #else
-        float lumaNE = FxaaLuma(FxaaTexOff(tex, posM, float2(1, -1), fxaaQualityRcpFrame.xy));
-        float lumaSW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1, 1), fxaaQualityRcpFrame.xy));
-    #endif
+    float lumaNW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1,-1), fxaaQualityRcpFrame.xy));
+    float lumaSE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1, 1), fxaaQualityRcpFrame.xy));
+    float lumaNE = FxaaLuma(FxaaTexOff(tex, posM, float2( 1,-1), fxaaQualityRcpFrame.xy));
+    float lumaSW = FxaaLuma(FxaaTexOff(tex, posM, float2(-1, 1), fxaaQualityRcpFrame.xy));
 /*--------------------------------------------------------------------------*/
     float lumaNS = lumaN + lumaS;
     float lumaWE = lumaW + lumaE;

+ 2 - 2
Bin/Data/LuaScripts/09_MultipleViewports.lua

@@ -142,7 +142,7 @@ function SetupViewports()
     -- Make the bloom mixing parameter more pronounced
     effectRenderPath:SetShaderParameter("BloomMix", Variant(Vector2(0.9, 0.6)))
     effectRenderPath:SetEnabled("Bloom", false)
-    effectRenderPath:SetEnabled("FXAA", false)
+    effectRenderPath:SetEnabled("FXAA2", false)
     viewport:SetRenderPath(effectRenderPath)
 
     -- Set up the rear camera viewport on top of the front view ("rear view mirror")
@@ -201,7 +201,7 @@ function MoveCamera(timeStep)
         effectRenderPath:ToggleEnabled("Bloom")
     end
     if input:GetKeyPress(KEY_F) then
-        effectRenderPath:ToggleEnabled("FXAA")
+        effectRenderPath:ToggleEnabled("FXAA2")
     end
 
     -- Toggle debug geometry with space

+ 2 - 2
Bin/Data/Scripts/09_MultipleViewports.as

@@ -147,7 +147,7 @@ void SetupViewports()
     // Make the bloom mixing parameter more pronounced
     effectRenderPath.shaderParameters["BloomMix"] = Variant(Vector2(0.9f, 0.6f));
     effectRenderPath.SetEnabled("Bloom", false);
-    effectRenderPath.SetEnabled("FXAA", false);
+    effectRenderPath.SetEnabled("FXAA2", false);
     viewport.renderPath = effectRenderPath;
 
     // Set up the rear camera viewport on top of the front view ("rear view mirror")
@@ -202,7 +202,7 @@ void MoveCamera(float timeStep)
     if (input.keyPress['B'])
         effectRenderPath.ToggleEnabled("Bloom");
     if (input.keyPress['F'])
-        effectRenderPath.ToggleEnabled("FXAA");
+        effectRenderPath.ToggleEnabled("FXAA2");
 
     // Toggle debug geometry with space
     if (input.keyPress[KEY_SPACE])

+ 0 - 1
Docs/Urho3D.dox

@@ -110,7 +110,6 @@ Urho3D is greatly inspired by OGRE (http://www.ogre3d.org/) and Horde3D (http://
 - Euler Angle Formulas by David Eberly (http://www.geometrictools.com/Documentation/EulerAngles.pdf)
 - Red Black Trees by Julienne Walker (http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_rbtree.aspx)
 - Comparison of several sorting algorithms by Juha Nieminen (http://warp.povusers.org/SortComparison/)
-- NVIDIA FXAA II for Consoles by Timothy Lottes (http://timothylottes.blogspot.com/2011/04/nvidia-fxaa-ii-for-console.html)
 
 Urho3D uses the following third-party libraries:
 

+ 0 - 2
Readme.txt

@@ -73,8 +73,6 @@ Urho3D is greatly inspired by OGRE (http://www.ogre3d.org) and Horde3D
   http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_rbtree.aspx
 - Comparison of several sorting algorithms by Juha Nieminen
   http://warp.povusers.org/SortComparison/
-- NVIDIA FXAA II for Consoles by Timothy Lottes
-  http://timothylottes.blogspot.com/2011/04/nvidia-fxaa-ii-for-console.html
 
 Urho3D uses the following third-party libraries:
 - AngelScript 2.28.1 (http://www.angelcode.com/angelscript/)

+ 2 - 2
Source/Samples/09_MultipleViewports/MultipleViewports.cpp

@@ -203,7 +203,7 @@ void MultipleViewports::SetupViewports()
     // Make the bloom mixing parameter more pronounced
     effectRenderPath->SetShaderParameter("BloomMix", Vector2(0.9f, 0.6f));
     effectRenderPath->SetEnabled("Bloom", false);
-    effectRenderPath->SetEnabled("FXAA", false);
+    effectRenderPath->SetEnabled("FXAA2", false);
     viewport->SetRenderPath(effectRenderPath);
     
     // Set up the rear camera viewport on top of the front view ("rear view mirror")
@@ -260,7 +260,7 @@ void MultipleViewports::MoveCamera(float timeStep)
     if (input->GetKeyPress('B'))
         effectRenderPath->ToggleEnabled("Bloom");
     if (input->GetKeyPress('F'))
-        effectRenderPath->ToggleEnabled("FXAA");
+        effectRenderPath->ToggleEnabled("FXAA2");
     
     // Toggle debug geometry with space
     if (input->GetKeyPress(KEY_SPACE))