Wed, 03/08/2023 - 18:14
Forums:
Hi gentlemen, I am using ToPixmap(...) to generate a nice image from a ray tracing view, but there is only one call to Redraw() in ToPixmap() so my image is 'not finished' as it requires many more passes...
I am thinking to create a new class that inherits from V3d_View and override the redraw function to redraw n times in place of one time but I am not sure it is the best solution ?
For the future OCC version maybe adding a redraw count parameter to V3d_ImageDumpOptions ?
Can you please give me some advices?
Thanks.
Best regards.
Jerome.
Mon, 03/13/2023 - 10:52
You may call
Redraw()
on your own before making an image dump. If image dump parameters are the same as viewer parameters - you'll get accumulated PathTracing results.Mon, 03/13/2023 - 12:00
Hi gkv and thanks for your answer. I tried but it is not working as ToPixmap() is switching to another framebuffer for offscreen rendering, this is why I thougth to a more complex way.
Jerome.
Thu, 01/09/2025 - 19:58
I am also not able to save a rendered picture to a file. I tried to match the parameters but still get the first picture. I tried with toPixmap and Dump - both same result
width and height are the dimensions of view
Thanks for any help
Sat, 01/11/2025 - 10:03
Daniel Duesentrieb wrote:
Conceptually, Path Tracing renderer invalidates frame when detects any changes in rendering parameters. Otherwise, it should be able to dump already drawn image in the window (but
V3d_View::ToPixMap()
will perform one extraV3d_View::Redraw()
anyway). This is done in Draw Harness using the same API within automated tests likeopengl raytrace sample_ball_alpha
, so it does work.In your context,
dumpOptions.TileSize = 256;
will certainly break things, as tile rendering will perform drawing of individual tiles anew. But you have mentioned, that you have triedV3d_View::Dump()
as well... In this case I may only suggest trying to debug to figure out which condition Path Tracing in OCCT decides to invalidate accumulated rendering results (probably due to some bug). The final invalidation is done insrc/OpenGl/OpenGl_View_Raytrace.cxx
within places likemyAccumFrames = 0;
.It would be more interesting to extend
V3d_ImageDumpOptions
with parameter defining a number of Path Tracing iterations (to ensure exact quality - not higher and not lower), but I guess that this is not what you are currently looking for (in your context you are trying to dump image as it seen on the screen).Thu, 01/09/2025 - 23:01
i have a super ugly workaround for QT but it is better then a kick in the butt...
m_occView = qWidget where the scene is.
nothing else is working for me.
what is the point of making pretty pictures and then you can't save them to a file?!?
Cheers