Jump to content

​Visualizer.RenderObject duration zero doesnt work as expected


photo

Recommended Posts

The API says:

Quote

void RenderObject ( Object object, vec4 color, float duration = 0.0f ) 
    Renders an object wireframe.
    
Arguments
    Object object - Object, which wireframe will be rendered.
    vec4 color - Color, in which the wireframe will be rendered.
    float duration - Time period (in seconds) during which the rendered element shall be displayed. 0 - means "display forever" (default).

 

I made a script to visualize some debug information, when i click the defined button, the callback is as follows:

Visualizer.Enabled = wiremesh_enabled;	// its true, i checked
Visualizer.RenderObject(some_object, new vec4(1,0,0,1)); // duration 0 = forever

When i run the script, it shows nothing for the wireframe.
But the same script, changing only the duration to something above zero, it works as expected.

 

Engine version: 2.12.0.2 ver-2.12.0.0-ead212 (using C#)
OS: Windows 7 x64

 

DebugHelper.cs

Edited by gamedev2020
Link to comment

gamedev2020

Thank you for the test code. It looks like it's a bug in documentation. 0 shows wireframe for a single frame (as it was before 2.12 update). To set the infinity time for wireframe rendering you can use following constant: Unigine.MathLib.INFINITY:

Visualizer.RenderObject(some_object, new vec4(1,0,0,1), Unigine.MathLib.INFINITY);

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...