how to use cvex for surface shader

   688   1   1
User Avatar
3 posts
Joined: March 2018
I was thinking about how to use a cvex mat builder to create a vop for both mat and sop,so I can build a procedual shader without rendering.As I know,it just worked in procedual volume shader.

Now I must render for visualization,Or complete it in attributeVop then copy node to mat and reconnect some disconnect input,copy ramp parameter one by one.When I think this net isn't enough,I should add or modify some nodes themselves instead change parameter,all the previous operations were done in vain.

Could sidefx release any tutorial for this kind of solution,Im very appreciate.
Edited by SpiLit - June 8, 2022 15:55:14
User Avatar
6827 posts
Joined: July 2007
if by mat you mean use it as Surface shader as suggested in other thread then you can't since Surface shader doesn't use CVEX context

but you can create VOP HDA from Subnet VOP that can be used in both as long as you use only nodes that are supported in both

and then use it in CVEX shader that you reference in Attribute VOP or use it directly in Attribute VOP
and you can also use it in Surface shader, potentially Displacement shader, also COP and CHOP shader if you use only compatible functions

its the same logic that many generic VOPs use like patterns, etc.

you will potentially still need to bind them internally slightly differently as Surface shader has some inputs hardcoded like P
while in CVEX you can bind it using Bind VOP, etc...

here [] is some info about different VEX contexts, may not be detailed enough explanation, but shows the separation between surface, cvex and other contexts
Edited by tamte - June 8, 2022 18:31:57
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links