Commit ab74030e authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Optimize the projected bump map handling.

parent ddec94bf
......@@ -2790,25 +2790,22 @@ static GLuint gen_arbfp_ffp_shader(struct ffp_settings *settings, IWineD3DStateB
shader_addline(&buffer, "DP3 ret.g, arg1, tex%u;\n", stage - 1);
/* with projective textures, texbem only divides the static texture coord, not the displacement,
* so we can't let the GL handle this.
* so multiply the displacement with the dividing parameter before passing it to TXP
*/
if (settings->op[stage].projected != proj_none) {
/* Note: Currently always divide by .a because the vertex pipeline moves the correct value
* into the 4th component
*/
if(settings->op[stage].projected == proj_count4) {
shader_addline(&buffer, "RCP arg1.a, fragment.texcoord[%u].a;\n", stage);
shader_addline(&buffer, "MOV ret.a, fragment.texcoord[%u].a;\n", stage);
shader_addline(&buffer, "MUL ret.rgb, ret, fragment.texcoord[%u].a, fragment.texcoord[%u];\n", stage, stage);
} else {
shader_addline(&buffer, "RCP arg1.a, fragment.texcoord[%u].b;\n", stage);
shader_addline(&buffer, "MOV ret.a, fragment.texcoord[%u].b;\n", stage);
shader_addline(&buffer, "MAD ret.rgb, ret, fragment.texcoord[%u].b, fragment.texcoord[%u];\n", stage, stage);
}
shader_addline(&buffer, "MUL arg1.rg, fragment.texcoord[%u], arg1.a;\n", stage);
shader_addline(&buffer, "ADD ret, ret, arg1;\n");
} else {
shader_addline(&buffer, "ADD ret, ret, fragment.texcoord[%u];\n", stage);
}
shader_addline(&buffer, "TEX%s tex%u, ret, texture[%u], %s;\n",
sat, stage, stage, textype);
shader_addline(&buffer, "%s%s tex%u, ret, texture[%u], %s;\n",
instr, sat, stage, stage, textype);
if(settings->op[stage - 1].cop == WINED3DTOP_BUMPENVMAPLUMINANCE) {
shader_addline(&buffer, "MAD_SAT ret.r, tex%u.b, luminance%u.r, luminance%u.g;\n",
stage - 1, stage - 1, stage - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment