hello,
i've got a problem using vertexbuffer attribute : dimension is set to a wrong value.
when using the example 10.glsl/16.vertexbufer_attribute, "print_attributes" gives :
vb: program 0.5 vb: position 1003_position vb: attribute LightPosition 1003_LightPosition vb: attribute BrickColor 1003_BrickColor vb: attribute MortarColor 1003_MortarColor vb: attribute BrickSize 1003_BrickSize vb: attribute BrickPct 1003_BrickPct [gemvertexbuffer]: GLSL-ProgramID: 3 [gemvertexbuffer]: Attribute1: LightPosition [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 2 [gemvertexbuffer]: program_index: 1 [gemvertexbuffer]: Attribute2: BrickColor [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 3 [gemvertexbuffer]: Attribute3: MortarColor [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 4 [gemvertexbuffer]: Attribute4: BrickSize [gemvertexbuffer]: size: 32 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 5 [gemvertexbuffer]: Attribute5: BrickPct [gemvertexbuffer]: size: 32 [gemvertexbuffer]: dimen: 4 [gemvertexbuffer]: program_index: 6 vb: print_attributes
in the shader code : attribute vec3 LightPosition; attribute vec3 BrickColor, MortarColor; attribute vec2 BrickSize, BrickPct;
so LightPosition is declare a vec3, but dimen is 2, BrickSize is declare a vec2 and dimen is 3, BrickPct is declare as vec2 and dimen is 4.
when adding a float attribute, I have : vb: program 0.5 vb: position 1003_position vb: attribute LightPosition 1003_LightPosition vb: attribute BrickColor 1003_BrickColor vb: attribute MortarColor 1003_MortarColor vb: attribute BrickSize 1003_BrickSize vb: attribute BrickPct 1003_BrickPct vb: attribute test 1003_test [gemvertexbuffer]: GLSL-ProgramID: 3 [gemvertexbuffer]: Attribute1: LightPosition [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 2 [gemvertexbuffer]: program_index: 1 [gemvertexbuffer]: Attribute2: BrickColor [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 3 [gemvertexbuffer]: Attribute3: MortarColor [gemvertexbuffer]: size: 48 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 4 [gemvertexbuffer]: Attribute4: BrickSize [gemvertexbuffer]: size: 32 [gemvertexbuffer]: dimen: 1 [gemvertexbuffer]: program_index: 5 [gemvertexbuffer]: Attribute5: BrickPct [gemvertexbuffer]: size: 32 [gemvertexbuffer]: dimen: 3 [gemvertexbuffer]: program_index: 6 [gemvertexbuffer]: Attribute6: test [gemvertexbuffer]: size: 16 [gemvertexbuffer]: dimen: 4 [gemvertexbuffer]: program_index: 7 vb: print_attributes
strange...
anyhow, the result of the example 16 is not right : texture is distorted.
- is this example working for anyone? (i test with ubuntu 14.04 / nvidia and intel gpu) - is this example used to work for anyone? - can it be fixed? (i tried, but did not understand where the m_attribute.size() was set - maybe the problem is that it's never set!!!)
my current project is halted because of this problem. any help will be appreciated.
cheers c