How to set Reflection/Refraction limits globally?

   719   12   1
User Avatar
Member
379 posts
Joined: Nov. 2013
Offline
Hi,
How to set Reflection/Refraction limits globally on karma? I only find them on render geometry setting lop which burn them into primvar. I wish to set them in renderer.

Thanks!
User Avatar
Member
3843 posts
Joined: Sept. 2011
Offline
The only way currently is to set the render geometry setting primvars on a common ancestor of all the geometry in the scene.
User Avatar
Member
93 posts
Joined: April 2015
Offline
The main way of setting primvars is via the Attribute Wrange LOP right? Since Edit Properties seems to need the attributes to be extant already.
User Avatar
Member
4964 posts
Joined: July 2007
Offline
OdFotan
Since Edit Properties seems to need the attributes to be extant
you can use Edit Properties to create properties or primvars if dropdown next to property is set to default Set Or Create
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
93 posts
Joined: April 2015
Offline
tamte
OdFotan
Since Edit Properties seems to need the attributes to be extant
you can use Edit Properties to create properties or primvars if dropdown next to property is set to default Set Or Create

Ah I see.. I had set ‘Action’ option to ‘Create’, but that is for creating a new primitive. Set it back to ‘Edit’ and the primvars appear. :-)
User Avatar
Member
93 posts
Joined: April 2015
Offline
How would you set a primvar to another primvar and have this ‘linked’?

For example set an prims 'displayColor' primvar and 'basecolor' primvar (used as material override) to a 'JohnsBlueShirtColor' global primvar?

In a way that when u change the 'JohnsBlueShirtColor' primvar later in another hip file on an imported USD, the 'displayColor' and 'basecolor' primvars change also?
Edited by OdFotan - Sept. 9, 2020 11:04:38
User Avatar
Member
3843 posts
Joined: Sept. 2011
Offline
OdFotan
How would you set a primvar to another primvar and have this ‘linked’?

For example set an prims 'displayColor' primvar and 'basecolor' primvar (used as material override) to a 'JohnsBlueShirtColor' global primvar?

In a way that when u change the 'JohnsBlueShirtColor' primvar later in another hip file on an imported USD, the 'displayColor' and 'basecolor' primvars change also?

The material would have to be looking for the primvar you want to use.

Primvars don't have relationships or other orders of precedence like that.
User Avatar
Member
93 posts
Joined: April 2015
Offline
Okay, how then does the material look for the primvar you want to use?

I think I saw something of that once at 46:30 on this video: https://www.youtube.com/watch?v=QqE4HYFDbGk&t=2792s [www.youtube.com]

But I am not sure if what he uses there are primvars..
Anyways: when I myself use a bind VOP like he did or a USD Prim Var Reader VOP it doesn't apply to the material basecolor.

I made a small hip file: I used a ‘constant’ primvar so it would inherit, altho I am still a little confused about how this inherit works.
Edited by OdFotan - Sept. 10, 2020 12:16:47

Attachments:
material basecolor by primvar.hipnc (334.5 KB)

User Avatar
Member
3843 posts
Joined: Sept. 2011
Offline
OdFotan
Okay, how then does the material look for the primvar you want to use?

same way as with a mantra material, use a bind or a parameter vop. Primvar readers also work I think, but only outside a material network.
User Avatar
Member
93 posts
Joined: April 2015
Offline
I used a bind vop in that hip file, now I have checked a hundred times if I have a spelling error or something, so there is something else why it isn't working, or where I am confused about..

- Are you supposed to see every inherited primvar/attribute? Like ‘visibility’ has ‘inherited’ as it's value in the screenshot? I ‘know’ visibility is not a primvar by all appearance, but I hope u get my confusion… How can you see inherited primvars?
- Why is my CustomBlue primvar value it's type and why is it grey?
- Is the primvar being grey a sign of it being constant primvar, or is the value just not set rightly? i.e. Is my VEX code wrong?




EDIT:

okay, so when I disable the first line of the VEX, and now in some weird way the primvar appears in prims down the hierarchy, but every attribute of the scene is underneath that ‘CustomBlue’ and the Bind VOP material override still don't seem to work.

I tried restarting the render multiple times. Please help.
Edited by OdFotan - Sept. 11, 2020 07:36:30

Attachments:
Screenshot 2020-09-11 at 13.21.09.png (613.3 KB)
Screenshot 2020-09-11 at 13.26.34.png (1.1 MB)
material basecolor by primvar.hipnc (334.5 KB)

User Avatar
Member
3843 posts
Joined: Sept. 2011
Offline
OdFotan
I used a bind vop in that hip file, now I have checked a hundred times if I have a spelling error or something, so there is something else why it isn't working, or where I am confused about..

It looks like this is something that has to be done in the shader, not in the material library usd material. So for the built-in principled, without unlocking, the primvar has to be basecolor, reflect, rough, or some other parameter on the material. I thought connecting a primvar reader to a material would bind it, but that doesn't work for karma materials.

OdFotan
- Are you supposed to see every inherited primvar/attribute? Like ‘visibility’ has ‘inherited’ as it's value in the screenshot? I ‘know’ visibility is not a primvar by all appearance, but I hope u get my confusion… How can you see inherited primvars?

Yes, the scene graph details shows all inherited primvars.

OdFotan
- Why is my CustomBlue primvar value it's type and why is it grey?

I'm not sure what you mean.

OdFotan
- Is the primvar being grey a sign of it being constant primvar, or is the value just not set rightly? i.e. Is my VEX code wrong?

I don't know what you mean by being gray. It's clearly blue in your screenshot.

OdFotan
okay, so when I disable the first line of the VEX, and now in some weird way the primvar appears in prims down the hierarchy, but every attribute of the scene is underneath that ‘CustomBlue’ and the Bind VOP material override still don't seem to work.

The inherited primvars expand to show the prim they were inherited from. You've just expanded that prim to see all of its primvars.

I've attached a scene that shows some examples of primvar inheritance that also get picked up by the material.

Attachments:
primvar_inherit.png (916.6 KB)
customprimvar_inherit.hip (488.3 KB)

User Avatar
Member
93 posts
Joined: April 2015
Offline
Allright thanks, jsmack. I think I have some clarity now around this.

Btw with it being grey, I meant that the primvar was ‘greyed out’ in the Scene Graph Details panel, but you can't see that in the screenshot because I have selected it there. Sorry for that miscommunication.

But it being ‘greyed out’ and having it's type (color3f) as value was somehow caused(?) by having this ‘usd_addprimvar’ function before the ‘usd_setprimvar’ function, altho these two functions follow one another in the SideFX documentation code-examples [www.sidefx.com].

I still wonder tho why in that video of Rohan Dalvi on 46:30 connecting the Bind VOP right into the basecolor input did work..
And if this is something that has changed during the Houdini builds.
I still love this idea of having a global ‘color palette’/variable pallete on the top level that you can use, replace and even modify on lower levels, would love to see development towards this or other ideas of achieving such a thing. I guess that would partly be solved if you could use the Bind VOPs right into the material library or read USD attribs in parameters, (I guess I add an rfe for that now)

Thanks anyways. :-)
Edited by OdFotan - Sept. 12, 2020 05:46:48
User Avatar
Member
3843 posts
Joined: Sept. 2011
Offline
OdFotan
But it being ‘greyed out’ and having it's type (color3f) as value was somehow caused(?) by having this ‘usd_addprimvar’ function before the ‘usd_setprimvar’ function, altho these two functions follow one another in the SideFX documentation code-examples .

Strange, I haven't tried either of those functions.

OdFotan
I still wonder tho why in that video of Rohan Dalvi on 46:30 connecting the Bind VOP right into the basecolor input did work..
And if this is something that has changed during the Houdini builds.

Most likely. Bind VOPs used to modify the material source by adding a parameter to the shader.
Now they create inputs to the USD materials. USD does not have a mechanism for connecting primvars to shader inputs, That is the domain of the shader. That's why USD preview surface uses USDPrimVarReader, itself a shader, to connect primvars to shader inputs. Karma does not use shading networks so there's no such primvar reader node to connect to a Karma shader. It uses parameters in the same way as mantra materials to bind to attributes.
  • Quick Links