gr7.76 Posted June 1, 2022 Posted June 1, 2022 (edited) Hi everyone, The Unigine::Visualizer in v2.15.1 looks like it will will be helpful for a particular feature we have planned, but before I invest time in research, and having only looked at the API doc so far I have a few questions concerning the rendering apects about "renderMessage..." can the size be changed? I have found this thread in the forumAnything new :) ? can the font be changed? can the text be rotated? (maybe using a projection trick?) about: "renderSolid<shape>" can the shape be shaded? Smooth or flat? about "render<shape>" and "renderSolid<shape>", where shape = sphere, capsule and cylinder what is the amount of slices and stacks used? Are they the default values (16 and 32) used in Unigine::Primitives? Or are the shapes rendered without meshes and purely in the post-pro shader, maybe with some form of ray marching / distance functions? Thank you. Edited June 1, 2022 by gr7.76 better title?
silent Posted June 1, 2022 Posted June 1, 2022 gr7.76 If you can tell us what kind of task are you trying to solve with visualizer - we probably can tell will it the right choice. But looking at current requirements I would say not :) Visualizer has very limited functionality implemented via FFP rendering, so there is a lot of strange limitations (like no ability to specify font, it's size or do a 90 degrees text rotation). It probably can be implemented on the engine backend, but that's not our primary focus at the current time. Solid shapes also can't be customized or shaded differently either. Default values are hardcoded (slices / stacks = 32). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
gr7.76 Posted June 1, 2022 Author Posted June 1, 2022 (edited) @silent Thank you for the answer, it helps already. As far as I know the OpenGL-FFP offers functions like glPointSize() and glLineWidth(), but I have no idea about the DirectX side of things and this does not help with text when using Unigine::Ffp. :-D Our feature deals with annotating a 3D scene to show specific bounding boxes (not necessarily based on asset geometry, and some in the world, some in screen-space), histograms (world- and screen-space), labels (world- and screen-space) and general visualization of abstract or otherwise invisible elements (like signal strength, sensor cones and lobes, paths, forces, tachometer overlays, etc.. A lot of it can be done with the Visualizer class, but not all. We will likely end up using a mix of Visualizer, ObjectText, ObjectStaticMesh, and Widgets, especially WidgetLabel instances for screen-space Labels (can't be rotated though, can they?) Edited June 1, 2022 by gr7.76
silent Posted June 1, 2022 Posted June 1, 2022 With WidgetCanvas you can actually specify the text rotation: https://developer.unigine.com/en/docs/future/api/library/gui/class.widgetcanvas?rlang=cpp#setTextTransform_int_mat4_void How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
gr7.76 Posted June 3, 2022 Author Posted June 3, 2022 Thank you for the idea. Maybe I can use a WidgetCanvas for all screenspace stuff, as an overlay (with transparent background) over the WidgetSprite instances that we use for our different views (the scene can be viewed from several cameras). This may be impractical though: 1) I need to render in each WidgetCanvas based on the camera of each view 2) the transparent background may be a performance killer
gr7.76 Posted June 3, 2022 Author Posted June 3, 2022 (edited) I just had a look in UnigineVizualiser.h and apparently the font size can be changed... I need to experiment a bit :) static void renderMessage2D(const Math::vec3& position, const Math::vec3& center, const char *str, const Math::vec4& color, int outline = 0, int font_size = -1, float duration = 0.0f); static void renderMessage3D(const Math::Vec3& position, const Math::vec3& center, const char *str, const Math::vec4& color, int outline = 0, int font_size = -1, float duration = 0.0f); Edit: font_size is apparently in pixels. The default size (when font_size = -1) is 13px on my system, but it may be tied to the system settings. Edited June 3, 2022 by gr7.76
silent Posted June 6, 2022 Posted June 6, 2022 Yeah, looks like documentation a bit outdated on this methods. Font size was added recently and somehow corresponding methods were not updated automatically. Will check and fix this as soon as possible. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts