From 40d919b352a553913f2c1e93e9fa39f2b968b04b Mon Sep 17 00:00:00 2001 From: Rodolfo Bogado Date: Thu, 28 Mar 2013 20:08:51 -0300 Subject: Implement dual source blending to avoid unneeded alpha pass. this implementation does not work in windows xp (sorry no support for dual source blending there). this should improve speed on older hardware or in newer hardware using super sampling. disable partial fix for 4x supersampling as I'm interested in knowing the original issue with the implementation to fix it correctly. remove the deprecation label from the plugin while I'm working on it. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index d863a6e0a9..dafaede7f7 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -848,8 +848,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType // single pass if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) { - // Colors will be blended against the alpha from ocol1... - WRITE(p, "\tocol1 = prev;\n"); + if(ApiType & API_D3D9) + { + //Colors will be blended against the color from ocol1 in D3D 9... + //ALPHA must be 0 or the shader will not compile( direct3d9 ex resriction) + WRITE(p, "\tocol1 = float4(prev.a, prev.a, prev.a, 0.0f);\n"); + } + else + { + // Colors will be blended against the alpha from ocol1... + WRITE(p, "\tocol1 = prev;\n"); + } // ...and the alpha from ocol0 will be written to the framebuffer. WRITE(p, "\tocol0.a = " I_ALPHA"[0].a;\n"); } -- cgit v1.2.3 From c743e75d928f3367214d0ac87f80f3946c73e818 Mon Sep 17 00:00:00 2001 From: Rodolfo Bogado Date: Fri, 29 Mar 2013 00:41:36 -0300 Subject: fixes for my last commit --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index dafaede7f7..26391be4dd 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -844,14 +844,14 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType WRITE(p, "\tocol0 = prev;\n"); } - // On D3D11, use dual-source color blending to perform dst alpha in a + // Use dual-source color blending to perform dst alpha in a // single pass if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) { if(ApiType & API_D3D9) { - //Colors will be blended against the color from ocol1 in D3D 9... - //ALPHA must be 0 or the shader will not compile( direct3d9 ex resriction) + // alpha component must be 0 or the shader will not compile (Direct3D 9Ex restriction) + // Colors will be blended against the color from ocol1 in D3D 9... WRITE(p, "\tocol1 = float4(prev.a, prev.a, prev.a, 0.0f);\n"); } else -- cgit v1.2.3 From 61c327ba8b2e09e67acbcd7d1c807910fc0c1a68 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Wed, 3 Apr 2013 18:53:49 +0200 Subject: D3D11: Fix glitched polygon edges when MSAA is enabled. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 26391be4dd..31a80076d4 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -668,17 +668,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType per_pixel_depth ? "\n out float depth : SV_Depth," : ""); } - WRITE(p, " in float4 colors_0 : COLOR0,\n"); - WRITE(p, " in float4 colors_1 : COLOR1"); + WRITE(p, " in centroid float4 colors_0 : COLOR0,\n"); + WRITE(p, " in centroid float4 colors_1 : COLOR1"); // compute window position if needed because binding semantic WPOS is not widely supported if (numTexgen < 7) { for (int i = 0; i < numTexgen; ++i) - WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i); - WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen); + WRITE(p, ",\n in centroid float3 uv%d : TEXCOORD%d", i, i); + WRITE(p, ",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen); if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) - WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1); + WRITE(p, ",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1); WRITE(p, " ) {\n"); } else -- cgit v1.2.3 From 9f8841e96047ab4c09cbbc67380a0212c5ad9b3b Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Wed, 3 Apr 2013 21:17:09 -0700 Subject: Revert "D3D11: Fix glitched polygon edges when MSAA is enabled." This reverts commit 61c327ba8b2e09e67acbcd7d1c807910fc0c1a68. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 31a80076d4..26391be4dd 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -668,17 +668,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType per_pixel_depth ? "\n out float depth : SV_Depth," : ""); } - WRITE(p, " in centroid float4 colors_0 : COLOR0,\n"); - WRITE(p, " in centroid float4 colors_1 : COLOR1"); + WRITE(p, " in float4 colors_0 : COLOR0,\n"); + WRITE(p, " in float4 colors_1 : COLOR1"); // compute window position if needed because binding semantic WPOS is not widely supported if (numTexgen < 7) { for (int i = 0; i < numTexgen; ++i) - WRITE(p, ",\n in centroid float3 uv%d : TEXCOORD%d", i, i); - WRITE(p, ",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen); + WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i); + WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen); if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) - WRITE(p, ",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1); + WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1); WRITE(p, " ) {\n"); } else -- cgit v1.2.3 From 0ca7ea6c3ffb257f097a90610f6cca3070f99ee7 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 7 Apr 2013 20:58:48 +0200 Subject: D3D11: Fix glitched polygon edges when MSAA is enabled (this time without breaking OpenGL) --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 26391be4dd..5c2e4a66b8 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -668,17 +668,20 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType per_pixel_depth ? "\n out float depth : SV_Depth," : ""); } - WRITE(p, " in float4 colors_0 : COLOR0,\n"); - WRITE(p, " in float4 colors_1 : COLOR1"); + // "centroid" attribute is only supported by D3D11 + const char* optCentroid = (ApiType == API_D3D11 ? "centroid" : ""); + + WRITE(p, " in %s float4 colors_0 : COLOR0,\n", optCentroid); + WRITE(p, " in %s float4 colors_1 : COLOR1", optCentroid); // compute window position if needed because binding semantic WPOS is not widely supported if (numTexgen < 7) { for (int i = 0; i < numTexgen; ++i) - WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i); - WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen); + WRITE(p, ",\n in %s float3 uv%d : TEXCOORD%d", optCentroid, i, i); + WRITE(p, ",\n in %s float4 clipPos : TEXCOORD%d", optCentroid, numTexgen); if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) - WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1); + WRITE(p, ",\n in %s float4 Normal : TEXCOORD%d", optCentroid, numTexgen + 1); WRITE(p, " ) {\n"); } else -- cgit v1.2.3 From 195336021f7890cc4a308b4437bd0f3e083cfc0a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Apr 2013 17:11:29 -0400 Subject: Fix a few typos in the comments/logging in VideoDX9, VideoCommon, and VideoSoftware projects. See Render.cpp, PixelShaderGen.cpp, and PixelShaderManager.cpp for most of the changes. See VertexShaderManager.cpp for a logging typo fix. See SWRenderer.cpp for a small typo fix for a message that gets swprintf'd in DrawDebugText. See SWVertexLoader.cpp for a typo fix of an assert message. Should slightly improve the readability of some of those files. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 5c2e4a66b8..5385d09546 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -390,7 +390,7 @@ static const char *tevCInputTable[] = // CC "float3(0.5f, 0.5f, 0.5f)", // HALF "(konsttemp.rgb)", //"konsttemp.rgb", // KONST "float3(0.0f, 0.0f, 0.0f)", // ZERO - ///aded extra values to map clamped values + ///added extra values to map clamped values "(cprev.rgb)", // CPREV, "(cprev.aaa)", // APREV, "(cc0.rgb)", // C0, @@ -1336,7 +1336,7 @@ static void WriteFog(char *&p) // x_adjust = sqrt((x-center)^2 + k^2)/k // ze *= x_adjust - //this is complitly teorical as the real hard seems to use a table intead of calculate the values. + //this is completely theoretical as the real hardware seems to use a table instead of calculating the values. if (bpmem.fogRange.Base.Enabled) { WRITE (p, "\tfloat x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n"); -- cgit v1.2.3 From 4c40e70b8af839f84d7d9b8306116cabf3965cdb Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 8 Apr 2013 14:50:58 +0200 Subject: ogl: support glsl120 --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 5385d09546..93f328fb61 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -598,9 +598,9 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType if (ApiType == API_OPENGL) { - WRITE(p, "out float4 ocol0;\n"); + WRITE(p, "COLOROUT(ocol0)\n"); if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) - WRITE(p, "out float4 ocol1;\n"); + WRITE(p, "COLOROUT(ocol1)\n"); if (per_pixel_depth) WRITE(p, "#define depth gl_FragDepth\n"); -- cgit v1.2.3 From bab9963b00953d60bdd6fabe265d5daa45a27661 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 17 Apr 2013 23:09:55 -0400 Subject: New license header introduced for DiscIO, AudioCommon, InputCommon, VideoCommon, and Common projects. --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 93f328fb61..8580e66c93 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -1,19 +1,6 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. #include #include -- cgit v1.2.3 From 8da425b008b46ef90d649e55c6c0d4a0bc2b556b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Apr 2013 09:21:54 -0400 Subject: Formatting cleanup for VideoCommon. Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck). --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 60 ++++++++++++++++---------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 8580e66c93..efc16566eb 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -61,7 +61,8 @@ static void StageHash(u32 stage, u32* out) out[3] |= bpmem.tevorders[stage/2].getEnable(stage&1); if (bpmem.tevorders[stage/2].getEnable(stage&1)) { - if (bHasIndStage) needstexcoord = true; + if (bHasIndStage) + needstexcoord = true; out[0] |= bpmem.combiners[stage].alphaC.tswap; out[3] |= bpmem.tevksel[bpmem.combiners[stage].alphaC.tswap*2].swap1 << 1; // 2 @@ -98,20 +99,27 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo bool enablePL = g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting; uid->values[0] |= enablePL << 10; // 1 - if (!enablePL) uid->values[0] |= xfregs.numTexGen.numTexGens << 11; // 4 + if (!enablePL) + { + uid->values[0] |= xfregs.numTexGen.numTexGens << 11; // 4 + } AlphaTest::TEST_RESULT alphaPreTest = bpmem.alpha_test.TestResult(); uid->values[0] |= alphaPreTest << 15; // 2 // numtexgens should be <= 8 for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i) + { uid->values[0] |= xfregs.texMtxInfo[i].projection << (17+i); // 1 + } uid->values[1] = bpmem.genMode.numindstages; // 3 u32 indirectStagesUsed = 0; for (unsigned int i = 0; i < bpmem.genMode.numindstages; ++i) + { if (bpmem.tevind[i].IsActive() && bpmem.tevind[i].bt < bpmem.genMode.numindstages) indirectStagesUsed |= (1 << bpmem.tevind[i].bt); + } assert(indirectStagesUsed == (indirectStagesUsed & 0xF)); @@ -255,7 +263,7 @@ void ValidatePixelShaderIDs(API_TYPE api, PIXELSHADERUIDSAFE old_id, const std:: // // color for this stage (alpha, color) is given by bpmem.tevorders[0].colorchan0 // konstant for this stage (alpha, color) is given by bpmem.tevksel -// inputs are given by bpmem.combiners[0].colorC.a/b/c/d << could be current chan color +// inputs are given by bpmem.combiners[0].colorC.a/b/c/d << could be current channel color // according to GXTevColorArg table above // output is given by .outreg // tevtemp is set according to swapmodetables and @@ -268,7 +276,7 @@ static void WriteFog(char *&p); static const char *tevKSelTableC[] = // KCSEL { - "1.0f,1.0f,1.0f", // 1 = 0x00 + "1.0f,1.0f,1.0f", // 1 = 0x00 "0.875f,0.875f,0.875f", // 7_8 = 0x01 "0.75f,0.75f,0.75f", // 3_4 = 0x02 "0.625f,0.625f,0.625f", // 5_8 = 0x03 @@ -407,7 +415,7 @@ static const char *tevAInputTable[] = // CA "rastemp", // RASA, "konsttemp", // KONST, (hw1 had quarter) "float4(0.0f, 0.0f, 0.0f, 0.0f)", // ZERO - ///aded extra values to map clamped values + ///added extra values to map clamped values "cprev", // APREV, "cc0", // A0, "cc1", // A1, @@ -827,7 +835,9 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType } if (dstAlphaMode == DSTALPHA_ALPHA_PASS) + { WRITE(p, "\tocol0 = float4(prev.rgb, " I_ALPHA"[0].a);\n"); + } else { WriteFog(p); @@ -959,10 +969,14 @@ static void WriteStage(char *&p, int n, API_TYPE ApiType) WRITE(p, "float2 indtevtrans%d = " I_INDTEXMTX"[%d].ww * uv%d.xy * indtevcrd%d.yy;\n", n, mtxidx, texcoord, n); } else + { WRITE(p, "float2 indtevtrans%d = float2(0.0f, 0.0f);\n", n); + } } else + { WRITE(p, "float2 indtevtrans%d = float2(0.0f, 0.0f);\n", n); + } // --------- // Wrapping @@ -1022,7 +1036,9 @@ static void WriteStage(char *&p, int n, API_TYPE ApiType) SampleTexture(p, "textemp", "tevcoord", texswap, texmap, ApiType); } else + { WRITE(p, "textemp = float4(1.0f, 1.0f, 1.0f, 1.0f);\n"); + } if (cc.a == TEVCOLORARG_KONST || cc.b == TEVCOLORARG_KONST || cc.c == TEVCOLORARG_KONST || cc.d == TEVCOLORARG_KONST @@ -1226,14 +1242,14 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con static const char *tevAlphaFuncsTable[] = { - "(false)", //ALPHACMP_NEVER 0 - "(prev.a <= %s - (0.25f/255.0f))", //ALPHACMP_LESS 1 - "(abs( prev.a - %s ) < (0.5f/255.0f))", //ALPHACMP_EQUAL 2 - "(prev.a < %s + (0.25f/255.0f))", //ALPHACMP_LEQUAL 3 + "(false)", //ALPHACMP_NEVER 0 + "(prev.a <= %s - (0.25f/255.0f))", //ALPHACMP_LESS 1 + "(abs( prev.a - %s ) < (0.5f/255.0f))", //ALPHACMP_EQUAL 2 + "(prev.a < %s + (0.25f/255.0f))", //ALPHACMP_LEQUAL 3 "(prev.a >= %s + (0.25f/255.0f))", //ALPHACMP_GREATER 4 - "(abs( prev.a - %s ) >= (0.5f/255.0f))", //ALPHACMP_NEQUAL 5 - "(prev.a > %s - (0.25f/255.0f))", //ALPHACMP_GEQUAL 6 - "(true)" //ALPHACMP_ALWAYS 7 + "(abs( prev.a - %s ) >= (0.5f/255.0f))", //ALPHACMP_NEQUAL 5 + "(prev.a > %s - (0.25f/255.0f))", //ALPHACMP_GEQUAL 6 + "(true)" //ALPHACMP_ALWAYS 7 }; static const char *tevAlphaFunclogicTable[] = @@ -1250,7 +1266,7 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode { I_ALPHA"[0].r", I_ALPHA"[0].g" - }; + }; // using discard then return works the same in cg and dx9 but not in dx11 @@ -1275,7 +1291,7 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode // or after texturing and alpha test. PC GPUs have no way to support this // feature properly as of 2012: depth buffer and depth test are not // programmable and the depth test is always done after texturing. - // Most importantly, PC GPUs do not allow writing to the z buffer without + // Most importantly, PC GPUs do not allow writing to the z-buffer without // writing a color value (unless color writing is disabled altogether). // We implement "depth test before texturing" by discarding the fragment // when the alpha test fail. This is not a correct implementation because @@ -1293,14 +1309,14 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode static const char *tevFogFuncsTable[] = { - "", //No Fog - "", //? - "", //Linear - "", //? - "\tfog = 1.0f - pow(2.0f, -8.0f * fog);\n", //exp - "\tfog = 1.0f - pow(2.0f, -8.0f * fog * fog);\n", //exp2 - "\tfog = pow(2.0f, -8.0f * (1.0f - fog));\n", //backward exp - "\tfog = 1.0f - fog;\n fog = pow(2.0f, -8.0f * fog * fog);\n" //backward exp2 + "", // No Fog + "", // ? + "", // Linear + "", // ? + "\tfog = 1.0f - pow(2.0f, -8.0f * fog);\n", // exp + "\tfog = 1.0f - pow(2.0f, -8.0f * fog * fog);\n", // exp2 + "\tfog = pow(2.0f, -8.0f * (1.0f - fog));\n", // backward exp + "\tfog = 1.0f - fog;\n fog = pow(2.0f, -8.0f * fog * fog);\n" // backward exp2 }; static void WriteFog(char *&p) -- cgit v1.2.3