GLSL packs 4 float attributes in vec4

I have a question about consuming attribute resource floatin glsl.

Are there as many resources as needed vec4or not?

I am asking about this because the form takes overflow https://stackoverflow.com/a/2126185/ (at least they can)

If this is not the case, does it make sense to pack 4 floatinto one attribute vec4?

+1
source share
2 answers

Yes, all vertex attributes require several multiple 4-component vectors for storage.

, float vertex 1 , vec2, vec3 vec4. , , vec4, . mat4 vertex 4 x vec4 . dvec4 (double-precision vector) 2 x vec4. 16 vertex, float, 4x4.

. ( float vec4), 4- . .


, GL GLSL:

OpenGL 4.4 - 10.2.1 - . 307

(. 11.1) 4- . , , GL_MAX_VERTEX_ATTRIBS.

GLSL 4.40 - 4.4.1 - . 60

, . , dvec3 dvec4, , dvec3 dvec4 . double dvec2 .

, , dvec4, . GL_ARB_vertex_attrib_64bit , , dvec3 dvec4 . , ... 1 , .

() :

ARB_vertex_attrib_64bit

     
  

[...]

         

, 64-          , ,          . 64-          ; -          "" .          GL,         .

  
+2

vec4 4 . - . (vec4 4 ).

0

All Articles