Jump to content

Referencing COP nodes in shaders problem using op:


Recommended Posts

I have a small compositing network which I want to reference as texture in the shader using the op: expression .ie op:/img/trail

Even though I've managed to make it work several times, I always find it a bit flaky and many times mantra doesn't manage to load the image, even though it may be visible on the viewport when referencing the same image operator in a uvquickshade node, or just by loading the shader.

It works with a principle shader out of the box, but if I put the same shader within a material builder it breaks. Is there a render attribute or something else I need to add to the shader?

 

I understand it's better to use pre-rendered images the normal way, but I want to use dynamic heighfields SOPs for textures and ideally avoid having to write out thousands of frames in advanced. 

 

 

 

Link to comment
Share on other sites

Is there a general limitation to expressions and connections within a material builder in comparison to promoted parameters?

Seems like the op: expression or even a reference to a path chs() doesn't work within the material builder and they have to be promoted outside it. Is that normal?

Link to comment
Share on other sites

Well, despite of the warning about VEX not supporting animated parameters, for years placing $F inside a shader body simply worked. There is a subtle nuance here though, and it't hard to see, since GUI wise all Houdini parms look the same. There are two different things involved here: shader's variables (inputs inside Shops/Vops) and parameters on a nodes.  

Basically think about Vops  (material builder or anything involving nodes and vex) as a pure string based code generator. Code listening will be generated inside Houdini, but interpreted in a different context (inside Mantra), so expressions (usually evaluated inside Houdini) don't fit. Promoting them outside a shader body, allows them to be correctly evaluated prior execution (passing the result to shader body as plain old data variable).

Seems like different types of Vops involved subnets has different opinion about what is possible though.

  • Like 2
Link to comment
Share on other sites

Ah great, that makes total sense now.

I guess it's somewhat similar to the way glsl/openCl shader kernels expect all parameters to be imported a certain way.

thanks a lot for the in-depth explanation.

Link to comment
Share on other sites

So even if the shader pulls the image from the /img content, it doesn't seem to update it over time. Whether it's an animated noise pattern, or a changing heightfield which is what I am trying to use it for.

The frame the scene is when I kick off the sequence render, is used across all frames.

Any ideas for that?

 

thanks again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...