Custom Render Property for Shader

   2362   5   0
User Avatar
Member
8 posts
Joined: June 2008
Offline
Hi

I would like to add a custom property to a ROP and query that inside of a shader.
Basically just add a float, name it and get it's value inside of a shader. Some global values, I would rather not define on a per shader basis.

I'm either missing something, or it's quite involved.
I got my extra attribute into the list of rendering attributes (had to make a IFDmantra.user.ds inside of soho/parameters).

Now getting the Parameter to be written to the IFD file seems even more involved (changing SOHO).. am I on track here? Is this the correct way?
—-
twitter [twitter.com]
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
if im understanding correctly, i think all you need to do is create your parameter and then use a channel reference to grab it. to make the parameter click the gear icon and then edit parameter interface and drag an empty float parm over.

then use the expression ch(“path/to/nodename/parametername”) to grab its value.
.
User Avatar
Member
8 posts
Joined: June 2008
Offline
Thanks for the fast answer..
I know I could do it that way. Problem, I'd need to connect all my shaders to the parameter on the ROP.
If I render with a different ROP, it wouldn't update.
I'm looking for a more general “pipeline” solution.

I guess I could to a prerender script that updates the connections.. mhm. I hoped for something more clean.
—-
twitter [twitter.com]
User Avatar
Member
8 posts
Joined: June 2008
Offline
Ah.. found the solution.

Just adding a “user property” on the ROP and get it's value with: renderstate(“object:name”, tmp); in the shader.
—-
twitter [twitter.com]
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
i see the issue. perhaps not the most elegant solution, but does this perhaps work?

Attachments:
fordanylyon.hipnc (126.3 KB)

.
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
oh cool, i didnt know about the renderstate expression. ignore my previous post lol
.
  • Quick Links