Supporting new/custom geometry



I come from a RenderMan/Arnold/Mantra background so this question is frame with those renderer as a point of reference.

If I wish to add support to Kraktatoa for some new/custom geometry, is there a concept of geometry procedural ?

I had a look at the example code and I can see that example04.cpp, one can build mesh from scratch for renderering.

If I only wish to extend the renderer associated with a current product/exporter for a given DCC (e.g. Maya), can I write some form of geometry procedural, without writing the whole exporter ? Something like geometry procedural for the old-skool renderer :wink:



No. Krakatoa is a point renderer, not a geometry renderer. You are responsible for converting everything into points. Triangle meshes are used for matte passes to cull and matte out pixels in the render. There are also some built-in functions for converting triangle meshes into points but you can do that yourself. If you want to go directly from nurbs to points, go right ahead.

As it is now, all points should be created at the initialization step. Any procedurally created points are cached in memory. Internally additional points might be created for depth-of-field, motion blur, and repopulation algorithms.


benyaboy is correct in that Krakatoa is a point-renderer. It does not render any geometry of any sort. The general way to do this is to render geometry in a 3rd party renderer (such as RenderMan), and particles in Krakatoa, then composite the two. Krakatoa is able to seamlessly blend with composited geometry. This tutorial is for KMX, but the same thing applies to SR: … d-shadows/

I’m not entirely sure what you are requesting to do. Can you clarify:
-Do you what Krakatoa to render points during a RenderMan render? As in, write a RenderMan procedural that accesses Krakatoa’s API?
-Do you want Krakatoa to render both points and geometry in a single image? So, similar to RenderMan, you would want to write a Krakatoa procedural that draws geometry inside a Krakatoa render?


Putting aside other geometry and talking only about points.

Yes, I wish to know how to write a Krakatoa procedural for Krakatoa SR that draws/render points inside the Krakatoa renderer.

Where can I read up on the API and sample C++ code to do that ?


Ah, yes. Generating procedural particles for Krakatoa to render is done using the krakatoasr::particle_stream_interface API class. The API also includes an example that demonstrates how to use it.

The file “example03.cpp” that is included with the API defines a simple custom particle stream that generates random particles in a 1x1x1 cube. I believe you should be able to adapt that code to your requirements.

Is this what you are looking for? Is there something specifically you are trying to achieve? Let me know if you have any other questions.


Looking at example03.cpp, it is not clear if one should build an executable or shared library (for loading in KrakatoaSR).

Given a production pipeline that is using Krakatoa, how does one deploy the procedural ? How is the procedural loaded within KrakatoaSR ?

Using RenderMan/Arnold as a reference, one would write a procedural geometry DSO e.g.

In the RenderMan/Arnold renderer, it can load the (plus any arguments required) and inject geometry/particles as part of the render.

In the example03.cpp, it talks about camera/lights etc, I don’t have those information, those are part of the rendering scene which is generated by the Karakatoa for Maya and other DCCs.


I think I understand what you are describing. I will try clarify what Krakatoa SR does.

Krakatoa SR is C++ library. The library exposes access to our renderer. Its input is a scene (user defined camera, lights, particles, etc.) and its output is a rendered image.

So, if you are familiar with the RenderMan C API. Krakatoa SR is exactly analogous to the RenderMan C API. When writing a C program, you can use RenderMan’s API to define a scene, and produce a rendered image.

You can’t write a Krakatoa procedural for RenderMan, in the same way you couldn’t write a RenderMan procedural for Krakatoa. Both Krakatoa and RenderMan produce 2D rendered images as output, and the only way to combine the two outputs is through compositing.

This is what I think you’re asking about (correct me if I’m wrong):
-You’d want a procedural for a 3rd party renderer that can draw Krakatoa particles directly within the other rendered image (no compositing required).

If that is the case, that is not possible with Krakatoa SR, as it produces output images. It is theoretically possible for us to adapt the API to work with specific 3rd party renderer’s APIs in this way though. We have experimented with doing so within 3dsmax, since 3dsmax allows for raytraced volume plugins (Maya however does not). It was somewhat successful, but it was written as a voxel raytracer, and not the normal Krakatoa point-renderer.

I hope this clarified how Krakatoa SR works.


Hi Conrad,

No. I want to write a Krakatoa procedural (shared library) that is loadable within Krakatoa :slight_smile:

It might not be possible by design, just want to confirm my understand.

I only mentioned RenderMan and Arnold for architecture/design reference, not as a need to combine them with Krakatoa.



You can do this, however, Krakatoa itself is not an executable, It’s a library. So generally you wouldn’t use a separate shared library for your procedural, and instead, you would just included it in your program directly.

So technically, you could write a shared library procedural, and then link it in your C++ executable, but you wouldn’t normally need to do so.

Normally, you would do it this way:
a) Start a C++ project of executable type. Link KrakatoaSR.lib, and include krakatoa_renderer.hpp. Call it mykrakatoa.exe, and copy the KrakatoaSR.dll into the same directory.
b) Create a krakatoa_renderer object, set the user input (Where would this user input come from in your case?) and call render().

Then, after that, if you wanted to write a procedural that generated particles, you would write it as part of the mykrakatoa.exe project, and not in a separate dll.

I can give you a sample if you’re interested. What platform are you building for (gcc/visual studio 9/10)? And is there any specific project you had in mind? I should be able to help you get started.