Experiment: Testing Houdini Karma XPU in a Big Scene
I’ve been trying some new things with SideFX Houdini’s new renderer called Karma. If you haven’t read my initial simple experiment about Karma head HERE. This time I decided that I would try Karma XPU with a huge scene.
Beginning
At first there was actually not really a plan to render a big scene with Karma XPU or even Karma CPU because I was working with Houdini 18.5 and was doing a personal work. I would have probably rendered it with Mantra (Houdini’s native and now old render engine). I checked some movies for references and came across a movie called Fifth Wave (IMDB Link). I loved the violent and dynamic nature of the big wave hitting the Tower Bridge in the movie so decided to do something similar. I actually searched a lot to find the 3d model of Tower Bridge in UK but the models were either so low poly or super expensive. Therefore I chose another fictional bridge model. Also for the buildings on the left hand side, found some simple free house models. Scattered a few low poly cars on the bridge, made the ground plane on the left and populated it with rocks, grass and plants. Added a grid below the bridge and used ocean spectrum node to turn it into a sea. Lastly added a tube, cut it in half, placed and animated it to hit the camera and gave it a noisy look with two mountain SOPs.
Simulation and Materials
When I was at the simulation and materials stage, Houdini 19 was out, I quickly tried to learn as much as I could, read some articles, watched some tutorials and did some tests. I learned that Karma XPU did not support particle rendering which was a horrible situation for me because I was working on foam simulations for the last three days. There was still the option to turn the foam particles into VDBs then to volumes but I wanted to render as particles or maybe both. And since there were approximately 10 million foam particles there was no way sphere instancing would work. Therefore decided to render the particles with Karma CPU or Mantra and matte the rest of the objects. After changing the wave couple of times, adding FLIP simulations and playing around with the white water (emitted white water from FLIP, which are the particles that emit from where the wave meets with the sea, the rest of the foam particles are standard POP simulations). I did the RBD simulations on the bridge, pier and houses. Then came materials, where I decided to use the new Material X shaders. They were easy to use and a bit faster with Karma compared to Principled Shader. I actually tried to use displacement with Material X on the wave which I failed so had to tweak the mesh. Maybe displacement was not available at the day I was working on this. Refraction was a bit different, I wanted to see the blurry bridge pieces that were inside the wave mesh for a very short time. Refraction alone was not enough, I cranked up the roughness of refraction a lot (compared to other render engines) and turned on Caustics in the render properties. Other geos had standard diffuse, roughness and normal values with textures that I got from textures.com.
After that, while trying to render to viewport I got hundreds of weird errors that sometimes even crashed Houdini but still rendered with some stuff missing. I was not in Solaris context but was working with a Karma ROP and it wanted every material to be assigned to a geo in the object level. For example I couldn’t put a material node after the bridge and assigned each named primitive a different material. So had to make different geos for each named piece of the bridge and assigned their material to corresponding geos. That got rid of the errors and was rendering much faster but was a tedious task.
While I was struggling with the materials. I realized that a new daily build which is 19.0.428 was released and that it could render particles with XPU. Downloaded the new version and started to tweak particles (velocity, pscale, number, drag) but wherever there were particles the render became so slow and it didn’t really look as I imagined. Also enabling motion blur with particles crashed the render. So even though particles were now renderable I still went with the volume foam version.
For the lighting I used an HDRI from one of Houdini’s own HDRIs that come with it. Placed it accordingly, also added a distant sun light that gave very soft shadows because wanted to fill very dark parts of the render.
Render Settings
For the render settings first I used the new trick that I hear often which is to get a sharp 1920x1080 render, you render in a 4K resolution with low samples then denoise with Intel or NVIDIA Optix Denoiser inside Houdini and then scale down to 1920x1080. I tested this and it really didn’t lose any quality and had a much sharper look. The great thing about this method is, for example rendering 3840x2160 resolution with 16 samples takes the same time as 1920x1080 with 64 samples. And if you denoise the 1920x1080 with 64 or even 128 samples it does not look as sharp. Also keep in mind that you can denoise your render both from the Karma Render Node or after the render inside COPs. I turned off motion blur for this render because even though all the objects had velocities some had very minor blurring and the render times increased a lot so decided to add it in After Effects with Pixel Motion Blur.
Then I had some fireflies issues, where even though I increased the samples a lot I couldn’t really get rid of them completely. Decreasing the color limit in the Limits tab on the Karma ROP helped clean the fireflies which were mainly on the sea surface. However keep in mind that decreasing it slowly starts to darken the whole scene so maybe it is best to find a balance between samples and color limit for fireflies.
I set the diffuse limit to 1 at the final render, setting it to 2 increased render times a lot and since this was an outdoor scene didn’t really had much effect in the overall look.
Reflection limit was set to 3 and refraction to 2. If I decreased refraction limits I would start to lose the bridge pieces in the wave that are visible once the wave collides with it. It is also pretty impressive that increasing the reflection and refraction limits do not increase render times a lot. When compared to Mantra I always used to save a lot of time decreasing them.
There is no depth of field enabled since it didn’t make much difference and when activated made the scene feel a lot smaller.
I tested the light sampling which is supposed to make a clearer image when it is increased. Once I increased it, didn’t see any change and render times increased a little so left it at 1. I set the Russian Roulette to 3, which was the optimum value on my tests. What it does is after a certain number of diffuse bounces it decreases samples for the bounced rays. Again it seems like it is more important in interior scenes and with emissive objects. Increasing the Russian Roulette also increased render times.
After these tweaks render times on average was 6.5 minutes per frame. Of course the beginning of the shot rendered faster since there was not much foam and the HDRI -which is very fast to render- was more visible. Whereas the end parts of the render was much slower, the reason being a big wave, more foam and refractions and less negative space.
Keep in mind that I didn’t use any render layers or AOVs for this because shadow matte or turning any object into a matte object does not work in Karma XPU yet. Also even though I tried a lot couldn’t make the AOVs to work. So compositing was a bit tricky this way. But still I added some post effects to the render in Fusion, like some floating little water drops, god rays, glow, haze, color correction and as I mentioned motion blur in After Effects.
If you are wondering, I tried to render with Karma CPU too and it gave me 13 hours and 45 minutes ETA for one frame and I didn’t wait for it to finish as you might have guessed. Although after writing my first experiment I learned that Karma CPU has a lot more options compared to XPU and tweaking them properly will decrease render times a lot. But still XPU is much faster.
Outcome
- Karma XPU is again pretty fast and for an Alpha version of a renderer it doesn’t crash often.
- One of the most important thing is, the render starting instantly, so when you hit render you start to see the first pixels immediately (most GPU renderers are not like that) and it makes material and render tests a lot easier. The annoying thing is each time I open the Karma Viewport it converted everything into USD which when added up takes a lot of time. But if you use the Solaris Context you won’t have that issue, therefore using Solaris for big scenes is essential.
- There are no random weird errors or crashes like in Karma Beta in Houdini 18.5.
- Material X is very easy to use compared to principled shader, it resembles the other materials you find in various render engines like Arnold, Redshift, Octane, Vray, therefore migrating to MatX is not painful.
- Particles felt a bit unpredictable, both renderwise and had issues with motion blur but I am sure it will be fixed soon.
- I also feel motion blur makes the render run more slower compared to other GPU renderers although I didn’t do a side by side test with the same scene on another GPU renderer with motion blur.