Control curve width with material (Karma)

   1753   4   1
User Avatar
Member
45 posts
Joined: Nov. 2019
Offline
Hello,

I have been trying to drive the width of a curve from a material when rendering with Karma.

I know the usual workflow is to put a 'pscale' attribute (or a 'width' attribute) at SOP level.
But I was hoping to use a bind node to import that attribute inside material builder, modify it in some way (like have the width react to light or camera distance at render time) and then use a bind export or parameter node to send it to karma.

But so far it seems that the pscale attribute is not even accessible from a material builder when using karma. And I could not find a way to export it to the renderer.

I have attached some of things I have tried, hope it helps.

Does anyone has ever tried that ? Or has some idea on how to proceed ?
Any help appreciated, thanks !

Attachments:
pscaleMat.hiplc (530.9 KB)

User Avatar
Member
8041 posts
Joined: Sept. 2011
Offline
Edmond BG
I have been trying to drive the width of a curve from a material when rendering with Karma.

It's not possible. Shading is too late to modify curve width. The best way to modify curve width in Solaris is either an attribute wrangle LOP or a SOP modify.
User Avatar
Member
8786 posts
Joined: July 2007
Offline
pscale is automatically converted to widths property so it will not end up as primvar on the geo, even though I see it could be useful to have such option or at least be able to access widths in the shader

you can create f@width = 2*f@pscale; in SOPs then width would be converted to widths property and your pscale will end up as primvar:pscale
or literally copy f@pscale as f@radius or anything else so that you have that as primvar

in the shader, at least in Mantra when renering curves as ribbons you are able to access s coordinate of the ribbon and remap the width to any width you want as long as its smaller or equal essentially doing opacity cutout
that way you can pretend you are setting width in the shader, which can be useful for per shading sample high frequency detail
but I'm not sure if this is possible in Karma, I had issues trying to get s curve coordinate in Karma in the past
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
45 posts
Joined: Nov. 2019
Offline
Thank you both for all those info.

Using the S coordinate is quite a good idea, at least to scale the curve down, which is very interesting for me.

I managed to get it work in Mantra but no luck in Karma so far. Out of the 2 parametric coordinate (s,t) only t seems to be working, s is just returning a black value.

I will keep digging in that direction.
Thanks !
User Avatar
Member
32 posts
Joined: Aug. 2011
Offline
Edmond BG
Thank you both for all those info.

Using the S coordinate is quite a good idea, at least to scale the curve down, which is very interesting for me.

I managed to get it work in Mantra but no luck in Karma so far. Out of the 2 parametric coordinate (s,t) only t seems to be working, s is just returning a black value.

I will keep digging in that direction.
Thanks !

Did you have any luck trying to do this? The only way I've done it so far is to wrangle the widths, or modify it in the render geometry settings.
  • Quick Links