From: Rudolf Polzer Date: Mon, 28 Jan 2013 15:54:13 +0000 (+0100) Subject: fix alpha handling X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f44158264a0ca05ed3c201a5ec1e94e3e8cbb6b;p=xonotic%2Fdarkplaces.git fix alpha handling --- diff --git a/gl_rmain.c b/gl_rmain.c index c7b64f15..32003ad6 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -6633,7 +6633,7 @@ static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortext r_refdef.stats.bloom_copypixels += r_refdef.view.viewport.width * r_refdef.view.viewport.height; } - if(!R_Stereo_Active() && (r_motionblur.value > 0 || r_damageblur.value > 0) && r_fb.ghosttexture) + if(!R_Stereo_Active() && (r_motionblur.value > 0 || r_damageblur.value > 0) && r_fb.ghosttexture && !r_refdef.envmap) { float motionblur_maxfactor, motionblur_factor, motionblur_mouseaccel, motionblur_velocity; static float motionblur_average; // FIXME move to cl. @@ -6717,7 +6717,7 @@ static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortext R_ResetViewRendering2D(fbo, depthtexture, colortexture); // if blur amount is very small, we don't need the old frame - if (cl.motionbluralpha > 1 / 256.0 && !r_refdef.envmap && r_fb.ghosttexture_valid) + if (cl.motionbluralpha > 0 && r_fb.ghosttexture_valid) { GL_BlendFunc(GL_ONE, GL_ZERO); switch(vid.renderpath) @@ -6743,7 +6743,7 @@ static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortext } // only if the ghost texture changed - if(cl.motionbluralpha < 1.0) + if(cl.motionbluralpha < 1) { // copy view into the ghost texture R_Mesh_CopyToTexture(r_fb.ghosttexture, 0, 0, r_refdef.view.viewport.x, r_refdef.view.viewport.y, r_refdef.view.viewport.width, r_refdef.view.viewport.height); diff --git a/shader_hlsl.h b/shader_hlsl.h index 38629cbd..94b1d57a 100644 --- a/shader_hlsl.h +++ b/shader_hlsl.h @@ -374,7 +374,7 @@ " int i;\n" " float2 tc = TexCoord;\n" " float3 tex1 = tex2D(Texture_First, tc).rgb;\n" -" float3 tex1 = tex2D(Texture_Second, tc).rgb;\n" +" float3 tex2 = tex2D(Texture_Second, tc).rgb;\n" " float3 tex3 = tex2D(Texture_Dither, tc*8.0+Rand2f).rgb;\n" " dp_FragColor = (Alpha)*tex1 + (1.0-Alpha)*tex2 + (tex3-0.5)*BitValue;\n" " }\n"