Best way to tell Karma not to render certain pixels?

   739   5   1
User Avatar
Member
50 posts
Joined: Jan. 2016
Online
We are rendering for a very particular dome format. The frame itself is a latlong/equirectangular (2:1), but because of the shape of the screen we are only required to render a certain portion of the frame. See attached image - the white areas are active parts of the screen we need to render, black areas we do not need to render.

Thus far we have been rendering in Redshift, where I created a sphere geo with the active area cut out, and then parented it to the camera. The material applied was a pure black emissive material with GI disabled. It works, but there is still some rendering time on the black areas. It's pretty quick to be honest, but we are rendering huge frames and high framerate (24K x 12K @ 60fps) so it does actually add up over the length of rendering a project.

We are now exploring a switch to Karma, and I'm curious what the best way to do this might be. I feel like a rendered integrated into Houdini might have a better/smarter answer than what we ended up with in Redshift. I have tried using the blocking geometry and setting it to matte via a render geometry settings node. Oddly, the render time with the matte geometry was four times slower than not having the geometry at all and just rendering the whole frame. I assume there's a good reason for this, but I had naively imagined that having a matte object right on front of the camera would very quickly and easily tell Karma 'don't render this pixel at all'. But apparently not.

Does anyone know if there is a super cheap way to do this? To just tell Karma to basically completely ignore a pixel?

Attachments:
FullDomeMaskWithBleed_4K.png (46.3 KB)

User Avatar
Member
442 posts
Joined: Nov. 2016
Offline
Have you tried setting it as a foreground image on the camera? Haven't made the test but seems like that's what it's for.
User Avatar
Member
50 posts
Joined: Jan. 2016
Online
Interesting. From reading the documentation, that makes sense conceptually. But I'm having trouble getting it to work.

I've created a totally black image, with a depth AOV as specified in the documentation:

Draw a foreground image over the geometry in the viewer when looking through this camera. If the image contains a depth AOV, this is used to z-composite the image into the scene. This can be used to replace large portions of the scene with a pre-rendered image, saving memory and processing time.

For the area I want to hide, I've tried setting the depth.Z value to something low like 0.1 and for the area I want to see, I've set it beyond the far clip of the camera (eg. 100000). So from what I understand, the camera should depth test this, and if it's closer than anything else, insert the image pixels, but otherwise render the scene.

Except it doesn't seem to work like that, and I can't find any examples of its usage like this.
User Avatar
Member
308 posts
Joined:
Offline
In Karma CPU you can customize a lens shader and set the &valid value to zero to not render a pixel. See the docs here:

https://www.sidefx.com/docs/houdini/solaris/karma_lens_shader.html [www.sidefx.com]
Edited by jparker - June 4, 2024 00:57:46
User Avatar
Member
50 posts
Joined: Jan. 2016
Online
Ah yes, I should have mentioned that the whole intention here is to use Karma XPU as a replacement for Redshift. We’re not in a position to switch to a CPU renderer. Thanks anyway though.
User Avatar
Member
12 posts
Joined: Feb. 2018
Online
Instead of using an emissive shader set to black does setting the geometry to a holdout matte work faster? It makes sense why that would be slowish. It is too bad we don't have the crop function on the camera like the old Mantra camera has. I have done a ton of large scale 360 renders and when I did not need the bottom this would speed things up. Looks like you are rendering for Sphere.
  • Quick Links