Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the term "genType" mean in OpenGL/GLSL?

In GLSL documentation, the term genType is used often as the type of parameters. For example, the function dot is documented as follows:

float dot(genType x,
          genType y);

double dot(genDType x,
           genDType y);

What does the term genType mean? What does it abbreviate? Is it used elsewhere than OpenGL?

like image 697
Nicolas Louis Guillemot Avatar asked May 23 '14 08:05

Nicolas Louis Guillemot


1 Answers

It's a catch-all for multiple types. From the specification section 8

When the built-in functions are specified below, where the input arguments (and corresponding output) can be float , vec2 , vec3 , or vec4 , genType is used as the argument. Where the input arguments (and corresponding output) can be int , ivec2 , ivec3 , or ivec4 , genIType is used as the argument.

For reference, all the "generic" types:

  • genType: floats
  • genDType: double floats
  • genIType: signed integers
  • genUType: unsigned integers
  • genBType: booleans
  • mat: float matrices
  • dmat: double matrices
like image 81
Bahbar Avatar answered Nov 18 '22 11:11

Bahbar