Voxel rendering mode crashes with custom save callback

Use this forum for discussions specifically related to the Krakatoa SR C++ API.
For discussion of topics applicable to both the C++ and Py APIs, please use the parent forum.
Navié
Posts: 24
Joined: Tue Mar 19, 2013 7:27 am

Voxel rendering mode crashes with custom save callback

Postby Navié » Tue Jun 18, 2013 1:30 pm

Hi,

Rendering in particle mode always seems to work but whenever I change the mode to voxel rendering KSR crashes. The logger says it is retrieving particles. No issues in particle rendering mode (voxel size and voxel filter length are both set to their respective default values, 1.0 and 0.5).

This only happens when a custom render save interface is used! It doesn't have to do anything (only overloading save_render_data() which is empty), as soon as I set it with set_render_save_callback the render() call crashes in voxel mode.
Can you confirm this?

User avatar
Conrad Wiebe
Posts: 774
Joined: Wed Aug 15, 2007 12:24 pm
Location: Thinkbox Software

Re: Voxel rendering mode crashes with custom save callback

Postby Conrad Wiebe » Tue Jun 18, 2013 5:25 pm

I shall check it out and see if I can reproduce the problem.
Conrad Wiebe
Software Development Manager
Thinkbox Software

Navié
Posts: 24
Joined: Tue Mar 19, 2013 7:27 am

Re: Voxel rendering mode crashes with custom save callback

Postby Navié » Wed Jun 19, 2013 6:36 am

thanks.

Navié
Posts: 24
Joined: Tue Mar 19, 2013 7:27 am

Re: Voxel rendering mode crashes with custom save callback

Postby Navié » Thu Jul 04, 2013 5:32 am

Any update on this? Can you confirm it and is there a fix in sight?

Thanks for any info
Navié

User avatar
Conrad Wiebe
Posts: 774
Joined: Wed Aug 15, 2007 12:24 pm
Location: Thinkbox Software

Re: Voxel rendering mode crashes with custom save callback

Postby Conrad Wiebe » Mon Jul 08, 2013 2:26 pm

I am unable to reproduce the crash you are seeing.

I tried writing a custom save callback, then setting voxel mode, and it did not crash for me.

Is there a snip of code you could send me that I can compile that shows the error?
Conrad Wiebe
Software Development Manager
Thinkbox Software

Navié
Posts: 24
Joined: Tue Mar 19, 2013 7:27 am

Re: Voxel rendering mode crashes with custom save callback

Postby Navié » Tue Jul 09, 2013 3:43 am

Hi,

yes here is some code (stripped down to the problematic code):

Code: Select all

class Krakatoa_C4D_SaveHookEmpty : public krakatoasr::render_save_interface
         {
         public:
            virtual void save_render_data
               ( int width
               , int height
               , int imageCount
               , const krakatoasr::output_type_t* listOfTypes
               , const krakatoasr::frame_buffer_pixel_data* const* listOfImages ) { }
         };
[...]

krakatoasr::light*   klight   = new krakatoasr::point_light;
m_renderer.add_light(klight, MatrixToKrakatoa(t_light->m));
delete (klight);

Krakatoa_Effex_ParticleStream effex_stream(groups,types,t_settings);
krakatoasr::particle_stream particleStream = krakatoasr::particle_stream::create_from_particle_stream_interface( &effex_stream );
m_renderer.add_particle_stream( particleStream );

Krakatoa_C4D_SaveHookEmpty fileSaver;
//add the file saver to the m_renderer
m_renderer.set_render_save_callback( &fileSaver );
//Render
m_renderer.render();


The custom particle stream has only 6 particles without any extra information. Position only.
Remove the light being added and the voxel mode doesn't crash anymore. Or remove the save hook and it works. Both in there always crash (once I call render()).

User avatar
Conrad Wiebe
Posts: 774
Joined: Wed Aug 15, 2007 12:24 pm
Location: Thinkbox Software

Re: Voxel rendering mode crashes with custom save callback

Postby Conrad Wiebe » Mon Jul 15, 2013 9:02 pm

Thank you for the code. I will attempt to track down the problem from here.

I will be away for the coming week at the SIGGRAPH conference, so I apologize if my response is slow. Thanks in advance for your patience. I will try to get to the bottom of this problem for you.
Conrad Wiebe
Software Development Manager
Thinkbox Software

Navié
Posts: 24
Joined: Tue Mar 19, 2013 7:27 am

Re: Voxel rendering mode crashes with custom save callback

Postby Navié » Wed Aug 14, 2013 10:46 am

Hi,

is there any news on the issue?

Thanks!

User avatar
Conrad Wiebe
Posts: 774
Joined: Wed Aug 15, 2007 12:24 pm
Location: Thinkbox Software

Re: Voxel rendering mode crashes with custom save callback

Postby Conrad Wiebe » Fri Aug 16, 2013 7:17 pm

I have found a bug in the voxel code. I am working on a new build with a few fixes. I'll post it as soon as it's ready.
Conrad Wiebe
Software Development Manager
Thinkbox Software

User avatar
Conrad Wiebe
Posts: 774
Joined: Wed Aug 15, 2007 12:24 pm
Location: Thinkbox Software

Re: Voxel rendering mode crashes with custom save callback

Postby Conrad Wiebe » Tue Aug 20, 2013 12:40 pm

So, it turns out the code I fixed didn't have anything to do with your bug.

I noticed one problem with the code you sent:
-Point lights are not supported by the voxel renderer.

Can you ensure that you are wrapping the "render" call in a try-catch block? You need to be catching the exceptions since error reporting is done using exceptions.

To help me further debug the issue, can you try modifying your code to this, then letting me know what is outputted:
The following code removes the point light, and wraps render in a try-catch block.

Code: Select all

class Krakatoa_C4D_SaveHookEmpty : public krakatoasr::render_save_interface
         {
         public:
            virtual void save_render_data
               ( int width
               , int height
               , int imageCount
               , const krakatoasr::output_type_t* listOfTypes
               , const krakatoasr::frame_buffer_pixel_data* const* listOfImages ) { }
         };
[...]

krakatoasr::light*   klight   = new krakatoasr::spot_light; //NOTE: I changed this.
m_renderer.add_light(klight, MatrixToKrakatoa(t_light->m));
delete (klight);

Krakatoa_Effex_ParticleStream effex_stream(groups,types,t_settings);
krakatoasr::particle_stream particleStream = krakatoasr::particle_stream::create_from_particle_stream_interface( &effex_stream );
m_renderer.add_particle_stream( particleStream );

Krakatoa_C4D_SaveHookEmpty fileSaver;
//add the file saver to the m_renderer
m_renderer.set_render_save_callback( &fileSaver );
//Render
try {
    m_renderer.render();
} catch( std::exception& e ) {
    std::cout << "THIS IS THE ERROR: " << e.what() << std::endl;
}

Conrad Wiebe
Software Development Manager
Thinkbox Software


Return to “Krakatoa SR C++ API”

Who is online

Users browsing this forum: No registered users and 1 guest