[PATCH] WineD3D: Fix projected bump mapping=0A=

unknown (none) stefan at .
Sun Aug 17 22:49:33 CDT 2008


=0A=
---=0A=
 dlls/wined3d/arb_program_shader.c |   20 +++++++++++++++++---=0A=
 1 files changed, 17 insertions(+), 3 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/arb_program_shader.c =
b/dlls/wined3d/arb_program_shader.c=0A=
index 250845a..97a1cab 100644=0A=
--- a/dlls/wined3d/arb_program_shader.c=0A=
+++ b/dlls/wined3d/arb_program_shader.c=0A=
@@ -2756,9 +2756,23 @@ static GLuint gen_arbfp_ffp_shader(struct =
ffp_settings *settings, IWineD3DStateB=0A=
             shader_addline(&buffer, "DP3 ret.r, arg1, tex%u;\n", stage =
- 1);=0A=
             shader_addline(&buffer, "SWZ arg1, bumpmat%u, y, w, 0, =
0;\n", stage - 1);=0A=
             shader_addline(&buffer, "DP3 ret.g, arg1, tex%u;\n", stage =
- 1);=0A=
-            shader_addline(&buffer, "ADD ret, ret, =
fragment.texcoord[%u];\n", stage);=0A=
-            shader_addline(&buffer, "%s%s tex%u, ret, texture[%u], =
%s;\n",=0A=
-                            instr, sat, stage, stage, textype);=0A=
+=0A=
+            /* with projective textures, texbem only divides the static =
texture coord, not the displacement,=0A=
+             * so we can't let the GL handle this.=0A=
+             */=0A=
+            if (settings->op[stage].projected !=3D proj_none) {=0A=
+                /* Note: Currently always divide by .a because the =
vertex pipeline moves the correct value=0A=
+                 * into the 4th component=0A=
+                 */=0A=
+                shader_addline(&buffer, "RCP arg1.a, =
fragment.texcoord[%u].a;\n", stage);=0A=
+                shader_addline(&buffer, "MUL arg1.rg, =
fragment.texcoord[%u], arg1.a;\n", stage);=0A=
+                shader_addline(&buffer, "ADD ret, ret, arg1;\n");=0A=
+            } else {=0A=
+                shader_addline(&buffer, "ADD ret, ret, =
fragment.texcoord[%u];\n", stage);=0A=
+            }=0A=
+=0A=
+            shader_addline(&buffer, "TEX%s tex%u, ret, texture[%u], =
%s;\n",=0A=
+                            sat, stage, stage, textype);=0A=
             if(settings->op[stage - 1].cop =3D=3D =
WINED3DTOP_BUMPENVMAPLUMINANCE) {=0A=
                 shader_addline(&buffer, "MAD ret.r, tex%u.b, =
luminance%u.r, luminance%u.g;\n",=0A=
                                stage - 1, stage - 1, stage - 1);=0A=
-- =0A=
1.5.6.4=0A=
=0A=

------=_NextPart_000_001B_01C90695.A4105F80--




More information about the wine-patches mailing list