opengl - GLSL, interface block -


the problem:

i'm learning opengl http://www.arcsynthesis.org/gltut/index.html tutorial, , had hard time getting tutorial 13: geometry impostors working (6+ hours), , working after minor change in code should no-op, , need find out why change anything.

explanation - edited:

the problem unchanged code fragment shader didn't correct input geometry shader, either replacing geometry shader's out interface block separate variables or giving block instance name makes program work fine. these changes should no-op.

the problem name collision.

like doesn't work:

in vertexdata {     vec3 cameraspherepos;     float sphereradius; } vert[];  out fragdata {     flat vec3 cameraspherepos;     flat float sphereradius;     smooth vec2 mapping; };  void main() {      mapping =       cameraspherepos =       sphereradius =       emitvertex();      /* mapping's value doesn't fragment shader correctly */ } 

but either giving fragdata instance name frag, , using frag.mappaing instad of mapping, or using 3 separate variables solves problem.

why doesn't work without instance name?

edit: seems driver issue.

create instance names interface blocks like:

fragdata { // .. } gs2fs;  

and then:

gs2fs.cameracornerpos = vec4(vert[0].cameraspherepos, 1.0); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -