Transparent Console

 

Copyright info

All code in this tutorial is protected by the [GPL License].
All text in this tutorial is protected by the [FDL License].

 

Tutorial by: Nghia

Mailto: nho@optushome.com.au

This is a quick tutorial showing how to much the console transparent for a nifty look.

Open up the file gl_rmain.c and find the function R_SetGL2D. You should see:

 
 
void    R_SetGL2D (void)
{
        // set 2D virtual screen size
        qglViewport (0,0, vid.width, vid.height);
        qglMatrixMode(GL_PROJECTION);
          qglLoadIdentity ();
        qglOrtho  (0, vid.width, vid.height, 0, -99999, 99999);
        qglMatrixMode(GL_MODELVIEW);
          qglLoadIdentity ();
        qglDisable (GL_DEPTH_TEST);
        qglDisable (GL_CULL_FACE);
        qglDisable (GL_BLEND);
        qglEnable (GL_ALPHA_TEST);
        qglColor4f (1,1,1,1);
}
< font>

Change the last 3 lines from

 
 
   qglDisable (GL_BLEND);
   qglEnable (GL_ALPHA_TEST);
   qglColor4f (1,1,1,1);
 
     

to

 
 
   qglEnable (GL_BLEND);
   // qglEnable (GL_ALPHA_TEST);
   qglColor4f (1,1,1,0.3);
 
     

Thats it! the parameter 0.3 can be changed to suit your taste but it should look good as it is. I'm not sure how this change actually works since I was mucking around late one night and not sure what I was doing :)

 

 

Tutorial Originally found at: