vec4_t the values?


(Indloon) #1

Can somebody tell me how can I apply default colors to vec4_t?

I mean, if I want to get white color( RGB: 255, 255, 255 ), I have to use
vec4_t mycolor = { 1.0f, 1.0f, 1.0f, 1.0f }

But why it’s so?


(UJERebel) #2

I guess as in OpenGL: 0.0f (0 as an float) is no color, 1.0f is full color.
http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml


(Indloon) #3

Doc says that:


  vec4_t( float x, float y, float z, float dist );
...
ID_INLINE vec4_t::vec4_t( float x, float y, float z, float dist ) {
    this->x = x;
   this->y = y;
  this->z = z;
 this->dist = dist;
 }

But I noticed somewhere in ET SDK RGB color usages,I think it was at limbo panel,dont remeber…


vec4_t some color;

if(somecase==something) {
      color[0] = 255;
      color[1] = 255;
      color[2] = 255;
      color[3] = 1;
}

Anyway I’m waiting PM from RR2DO2 for futher information…


(ailmanki) #4

its rgba and normalized values and all values are floats. E.g. 255 = 1.0, 0 = 0.0 127=.5
and the opacity should be obvious.

edit: q3ase can make the colors… check the fogparms.


(Indloon) #5

Thank you Ailmanki.
R:255 G:158 B:0

{ 1.0, 0.501961, 0, 1 }
Gives a nice orange.

And .f is float, thought it would be better to use double …


(Scennative) #6

X/256: x.xf

Also:

R:100 G:128 B:30 A:90

R:100/256 G:128/256 B:30/256 A:90/256

{ 0.39f, 0.5f, 0.12f, 0.35f }

PS: dont forgot the f after the numbers :stuck_out_tongue: