Lacking documentation?!

this is a part of “ParticleSphereGpu” Sample

mUpdateProg = gl::GlslProg::create(gl::GlslProg::Format().vertex(loadAsset(“particleUpdate.vs”))
.feedbackFormat(GL_INTERLEAVED_ATTRIBS)
.feedbackVaryings({ “position”, “pposition”, “home”, “base”, “colorActive”, “colorInactive”, “color”, “damping” })
.attribLocation(“iPosition”, 0)
.attribLocation(“iColor”, 1)
.attribLocation(“iOColor”, 2)
.attribLocation(“iPPosition”, 3)
.attribLocation(“iHome”, 4)
.attribLocation(“iBase”, 5)
.attribLocation(“iDamping”, 6)
);

in this sample there is a use of “feedbackFormat( )” and “feedbackVarying( )”. which I am not able to find in the documentation. though I am able to understand what they do. I wonder why are they absent from the documentation?!!

What existing documentation are you referring to?

In any case, they are part of the initialization of a transform feedback shader. See also this sample.

-Paul

I am looking at https://libcinder.org/docs/structcinder_1_1gl_1_1_glsl_prog_1_1_format.html. I can find attribLocation( ) as a member function of “Format” class. but there is no mention of feedbackFormat( ) or FeedbackVarying( ) in the member functions. May be I am looking in the wrong place or not understanding some concept here.

If I am correct, the documentation is generated from the source, but the process runs manually instead of automatically. It could be that it hasn’t been fully updated yet. It could also be that the script that generates the documentation does not define the CINDER_GL_HAS_TRANSFORM_FEEDBACK macro, thereby skipping the transform feedback members.

For the time being, you could take a look at the source instead of the documentation.

Thanks Paul for taking out your time to explain. I guess the more I
practice the more I will get clarity about workings of open.

Yes I found it in the source. Thanks Paul for taking out your time to
explain.

1 Like

I have a question on a similar topic. I was playing around with the TransformFeedbackSmokeParticles sample. Adding another buffer to store current particle colour was straight forward, but adding another one (5th - particle size (for gl_PointSize)) turned out not to work out. All buffers are stored separately thus using GL_SEPARATE_ATTRIBS.

When using 1, 2, 3 or 4 varyings, everything works, is there a limit I am facing at this point? Even if you name 3 varyings and leave the 4th empty, compiler throws an error, but when adding one extra (3 + two empty) the compiler will not throw an exception, but the end result will not be good.

Quick edit:
Gave it a go with a single buffer solution from a particle sphere gpu sample and it worked like a charm. It is a solution, but would still want to understand if there is a limit when using SEPARATE_ATTRIBS.

Hi,

there is a GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS that defines the maximum attribute number supported. According to the documentation, it should be at least 4.

you could use

GLint val;
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, &val);

to check. But I assume on a lot hardwares it should be just 4.

1 Like

That was it.
Thank you!