Page 1 of 1

Implementing Brightskins.

PostPosted: 2012-07-03 13:37:36
by Christiaan
How would one go about implementing brightskins in a mod?

I am using the promode skins and the corresponding players.shader file.

I added the following fields to the clientinfo struct:
headColor
torsoColor
legsColor

all of type vec4_t.

Where the models and skins are loaded, I set those fields by getting the colour characters from a cvar (cg_enemyColor "iii") and use those characters to obtain a vec4_t color from the color table.

In CG_Players, I set the shaderRGBA for the refEntities like this for the head, torso, and legs:

Code: Select all
if( cg_forceColor.integer ) {
   int i;
   for( i = 0; i < 3; i++) {
      head.shaderRGBA[i] = ci->headColor[i] * 255;
   }
}


Yet the shader is not applied, in fact the model is partiall invisible, and the model keeps it's colour. Am I doing something wrong or forgetting something?

Re: Implementing Brightskins.

PostPosted: 2012-07-06 08:24:48
by Cyrax
Code: Select all
head.shaderRGBA[3] = 255; // alpha channel

?

Re: Implementing Brightskins.

PostPosted: 2012-07-06 23:03:36
by foksieloy
We went through a long talk on irc, in the end it was this line (the vertex fix):

if ( atoi( vertex ) ) {
trap_Cvar_Set( "r_vertexlight", vertex );
}