Thu, 08/18/2022 - 20:24
Forums:
I'm trying to create a Graphic3d_AspectMarker3d
and Graphic3d_ShaderProgram
s to display various markers from an atlas instead of using the predefined markers or providing and switching custom Graphic3d_MarkerImage
.
Everything is working fine except that i cannot find a way to make the value set with SetMarkerScale
work.
This seems to be because the marker size is
- either taken directly from the sprite
- or taken from the scale but then the context is not suitable to draw textures because of the early exit in
OpenGl_PrimitiveArray::drawMarkers
The only option seems to be to use a empty image to let the size be determined by it and get a suitable draw context and scale it on every scale change accordingly.
Am i missing something obvious?
Is there maybe a way to provide a custom instance of OpenGl_Aspects
from the outside to basically tweak the MarkerSize method?
Mon, 08/22/2022 - 10:27
Indeed, size of a marker sprite is expected to be determined out of image texture dimensions by current design. I can imagine defining a subclass of OpenGl_PrimitiveArray to hack this limitation or setting "glEnable(GL_VERTEX_PROGRAM_POINT_SIZE)" somewhere to define points size using gl_PointSize in GLSL program, though this would break drawing built-in markers as this code path is statically enabled in OCCT Shader Manager for OpenGL ES code path.
Currently, OCCT uses texture atlas for rendering text, which theoretically might be used for drawing (single) markers as well. But I guess hacking textured fonts would be more complicated than hacking markers...