_buf3d

11-14-2013, 04:01 AM

If inside a vertex shader (or geometry shader) had the ability to make calls at the same vertex shader, would create new mesh tessellation algorithms such as terrain visualization using quads, or selective refinement, without using the CPU.

Virtual sample (G_POINTS to vertex shaders and Geometry shader construct triangles)

layout( recalls=4 ) out; // allocate data to make 0 or 4 recalls

uniform usamplerBuffer mapVertexData;

uniform mat4 PMatrix,MVMatrix;

int computeErrorVisibitlity(usamplerBuffer map,int idVertex)

{

// return the computed value from PMatrix, MVMatrix or other

}

main()

{

for (int k=0;k<4;k++) {

if (computeErrorVisibility(mapVertexData,gl_VertexID+ k)) {

// construct attributes & other values

glRecall_VertexID[k] = (gl_VertexID+k)*4; //or another computed value

glRecall(); //don't return or wait values (need for paralelism)

} else {

gl_Position = PMatrix * MVMatrix * getVertex(mapVertexData,gl_VertexID+k);

}

}

}

Virtual sample (G_POINTS to vertex shaders and Geometry shader construct triangles)

layout( recalls=4 ) out; // allocate data to make 0 or 4 recalls

uniform usamplerBuffer mapVertexData;

uniform mat4 PMatrix,MVMatrix;

int computeErrorVisibitlity(usamplerBuffer map,int idVertex)

{

// return the computed value from PMatrix, MVMatrix or other

}

main()

{

for (int k=0;k<4;k++) {

if (computeErrorVisibility(mapVertexData,gl_VertexID+ k)) {

// construct attributes & other values

glRecall_VertexID[k] = (gl_VertexID+k)*4; //or another computed value

glRecall(); //don't return or wait values (need for paralelism)

} else {

gl_Position = PMatrix * MVMatrix * getVertex(mapVertexData,gl_VertexID+k);

}

}

}