You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The SphereRenderer does not seem to bind the transfer function correctly to a texture. The fallback to the gray (/linear ramp) function still generates the expected result, however upon connecting the TF the spheres all switch to the same color (black).
To Reproduce
See attached Minimal Reproducible Example below.
Expected behavior
The particles should obtain coloring according to their scalar value and the connected transfer function, and not only default to 0.
Additional context
I did a bit of digging and happened upon following TODO in the SphereRenderer.cpp, which I suspect is responsible for the unexpected bahaviour:
boolSphereRenderer::enableTransferFunctionTexture(std::shared_ptr<glowl::GLSLProgram> prgm) {
mmstd_gl::CallGetTransferFunctionGL* cgtf = this->get_tf_slot_.CallAs<mmstd_gl::CallGetTransferFunctionGL>();
if ((cgtf != nullptr) && (*cgtf)(0)) {
// TODO: how to do with unique?//cgtf->BindConvenience(prgm, GL_TEXTURE0, 0);
} else {
glEnable(GL_TEXTURE_1D);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_1D, this->grey_tf_);
glUniform1i(prgm->getUniformLocation("tfTexture"), 0);
glUniform2fv(prgm->getUniformLocation("tfRange"), 1, static_cast<GLfloat*>(this->range_.data()));
}
returntrue;
}
Describe the bug
The
SphereRenderer
does not seem to bind the transfer function correctly to a texture. The fallback to the gray (/linear ramp) function still generates the expected result, however upon connecting the TF the spheres all switch to the same color (black).To Reproduce
See attached Minimal Reproducible Example below.
Expected behavior
The particles should obtain coloring according to their scalar value and the connected transfer function, and not only default to 0.
Additional context
I did a bit of digging and happened upon following TODO in the
SphereRenderer.cpp
, which I suspect is responsible for the unexpected bahaviour:And here a minimal working example: sphere_renderer_ignores_tf.zip
Screenshots
Here the comparison as seen in the sample file with the transfer function connected (scalar value of particles is simply their y-value):
And without the connection:
The text was updated successfully, but these errors were encountered: