Bundling shaders

   3724   2   1
User Avatar
Member
12490 posts
Joined: July 2005
Offline
Hi there,

Recently I have been doing a fair amount of meddling with shader assignments in 6.1, and I see that there might be room for yet another simple concept.

How about being able to bundle shaders together? Many types of surfaces really are only represented right when you use a combination of Surface and Displacement shaders. In the world of GI, there is one more concept being photon (and photon volume) shaders.

Water, for instance, would be complete if the corresponding water Displacement and Surface shaders are applied. Add the relevant photon shader and you've described water that also has application in a GI render.

This idea would be to be able to have shader “bundles” (probably a bad word now) that could be assigned as a whole. Think of assigning a @water shader which expands to the water shader bundle which a list of the 3 types of shaders. Instead of remembering to assign all three shaders, you just assign the shader bundle.

Maybe this really entails having Shader subnet asset which contains other shaders? Or it could similar to the Select SHOP? Or a custom asset's vex code could have different contexts defined in it, i.e.
surface water()
{..} and
displacement water()
{..}
.. in the same vfl file. But this is probably quite ugly and you may not want to grow behemoth unflexible shaders like this.

A really useful benefit to this is that you can parm-link your shaders together- for instance, you can parmlink your Surface shaders' Specular color to your Photon shader's Specular color or the Transmission colors together, etc. If this asset could be saved to an OTL, then the user just needs to set up these parm links once and everyone else can benefit from having a nicely balanced shader set setup for them.

Just an idea,
Jason
Edited by - Dec. 7, 2003 01:19:20
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
118 posts
Joined: July 2005
Online
In the mental ray world a shader collection like this is named a “phenomena”.

-Drew
User Avatar
Member
4140 posts
Joined: July 2005
Offline
It's an interesting idea. One of the more annoying behaviours is the restriction of having to keep displace code separate from surface shader code - already noted in the forum. This is a good opportunity to do something a little more ambitious than simply allowing that - each shader “bundle” could have any number of outputs - diffuse, specular, displacement, occulsion…and in addition to some standard defaults like these the user could make custom named/typed outputs - much like the deep map outputs in ROPs. These are just names, really, “specular” is a user's concept and in a shader is typically just part of the surface shader definition, but now you can generate everything from one common code area(shareable code = good), and also allow you to create a specular pipe right in the shader that could be spit out from a ROP. Yes, you can do all this now, but it's a more manual process and doing it all in one big shader with swappable and shared elements has some great advantages.

You'd need some sort of restriction over certain things. For instance, the destination for displacement is obviously different than diffuse - so there would need to be certain types such as “surface colour”, “displacement”, “deep maps”. However, the more I think about this, the more useful it sounds - you could build the layered output approach right into the shader and spit out your passes more quickly than having to manage your own separate layers in the ROP. Continuing the NWN concept - you have these Supershaders that can contain other shaders that can create whatever types of targets you want…so instead of only having something being a displacement “shader” - you would have a displacement “output” that could be piped somewhere. Alternatively, if you just want to render one thing with all the bells and whistles - it's all there. Very kewl.

My Sunday coffee will probably kick in soon and all this will stop making sense…

Cheers,

J.C.
John Coldrick
  • Quick Links