Karma ST Derivatives VS Prman area() - Houdini 20.5.522

   263   0   1
User Avatar
Member
3 posts
Joined: Oct. 2009
Offline
I have used the area() function in the past with other renderers like Prman or Arnold to calculate the size of raster-space-dicing micropolygons ( or sample area in the case of Arnold ) so i could use it as a measure of size of an object in the frame and use this float value to adjust the materials accordingly, especially on subdivided geometries.

In Karma it looks like the closest thing to such a function is the Karma ST Derivatives VOP, however I am not sure about its behaviour. it's almost as if the input is ignored altogether. and i can observe the following:

- If I plug a mtlxposition node into the input to provide a P to calculate the derivatives, the result does not change between a 'world' space or a 'object' space P, or even 'model'. Even if I plug a mtlxNormal node the result doesn't change.

- The derivScale output shows higher values on grazing angles, which makes sense as the micropolygons are diced in raster space and will increase in size and the surface becomes parallel to camera rays (or view vector), but there seems to be some areas of the geometry that have a higher value based on something else that is dependent on the topology density. Which makes me think that it is not doing what i want.

- I tried to plug derivS or derivT in an AOV for debugging. It behaves properly when plugged directly. however when I try to multiply cush vector with a mtlxmultiply, the output breaks and it becomes a colored rainbow of patches on the geometry. if i unplug the position from the Derivatives input, this result becomes black instead. See Screenshot 3.

I attached a couple of screenshots. In image 1 you can see the output of derivScale as it is. In image 2 I multiplied it's value with a Karma Camera Falloff node to cancel out the grazing angle variations in an attempt to flatten the appearance of this measurement across the shape of the geometry on screen, but i am still left with those areas that are more geometry dependent and i would like to get rid of those. Since a lot of these things in Karma are happening under the hood, I am not sure how i can achieve that and just seems a bit buggy to me.

The documentation states that the derivatives are calculated in the ST parametric space, which makes me assume are the S and T coordinated of each single micropolygon like in PRman as in dPdU and dPdV and should not depend on the mesh density in the UV coordinates at all?

My goal is to have those area values mostly flat across the whole silhouette. the pig head mesh closer to camera should not have those bright patches around the eyes and in the ears.

Any thought is appreciated.

R

Image Not Found

Image Not Found

Attachments:
3 - broken derivT:S when multiply is applied.png (469.3 KB)

  • Quick Links