Custom Marker Scale with custom texture and custom shader

I'm trying to create a Graphic3d_AspectMarker3d and Graphic3d_ShaderPrograms 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

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?

Kirill Gavrilov's picture

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...