]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix alpha handling
authorRudolf Polzer <divverent@xonotic.org>
Mon, 28 Jan 2013 15:54:13 +0000 (16:54 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 28 Jan 2013 15:54:13 +0000 (16:54 +0100)
gl_rmain.c
shader_hlsl.h

index c7b64f153aa6ae53d65f0553544fb6a9989884fa..32003ad681e3107a887ee79024c38f09b09b3cb6 100644 (file)
@@ -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);
index 38629cbd933b8bdfd070840dd5fabc515037b23a..94b1d57aa13e51715797c4c51fa88c1d6a8030a3 100644 (file)
 "                      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"