Jump to content

UberShader


LaidlawFX

Recommended Posts

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

I am wondering how this shader compares with the new ubershader (mantra surface - all purpose shader) in the new Houdini 11. I'm not so experienced with shaders...so which one is beetter?

Currently I would say the the mantra surface is better right now than this version of the shader, especially if you are going to use PBR.

I've only had one day to rip apart the mantra surface so far but it has a lot of the new pbr based vops inside of it. It has bump and normal maps built in it, that do to their nature are wired in completely differently than the displacement map since it is one of the first things that runs in the surface node because it has to bend the normals prior to doing other calculations. I believe you can also easily insert ramps, and other patterns for the surface parameters. The subsurface scattering is more thoroughly implemented.

The only thing going for mine as of it's current version is it's texture mapping abilities, vop area placement(file size), occlusion(for mantra)...

Once I'm back in LA in a week I'll slash most of those things out and put them in mine. I only got as far as ripping the nodes out of the new subnet they put everything in and organizing it so I can tell what everything does, and combining my displacement and surface shader nodes. I need to convert it to an .otl to easily keep the interface controls together... grumble, grumble, grumble

Link to comment
Share on other sites

  • 2 weeks later...

Here is an update for H11, no longer will work in H10

There are a bunch of kinks I'm betting I need to work out(lots of new vops), so if you find a kink please tell me, I haven't gotten to test this one yet.

Overview:

I hacked in a bunch of the mantra surface node into this one, so I have Normal and bump maps, and the new reflection, refraction, opacity, and SSS heart from the ms

Oldies but goodies that have been retained are the mantra renders of Occlusion and Irradiance, plus I kept Sheen, and the multi-tex 3-D(cubic, triplanar, what ever)

Future Updates:

Reinstall conserve energy

Better bsdf composite workflow

Mantra, PBR component switch

Env Map converter to SESI Cubic Style

Rat Converter, courtesy of Prototype

Interface Re-Arrange

Step Backs: I did the interface by hand in the shop vop network, so the interface is not as robust as it once was, H11 output node issue. Since it is not in the Vex Vop area, and since I've already done the interface by hand too many time this round, the shader is now bloated in the shop area so it is not good for too many uses for file size reasons. Feel free to bring over to Vop VEX area and redo interface and post if you like.

UberShader_v6.hip

Link to comment
Share on other sites

  • 1 month later...

Have you tried SSS functions of physicalsss.h? I suppose that is pretty SSS solution. For example:

#include <voptype.h>
#include <physicalsss.h>

surface
MySSSurface(
     export vector sss_color = {0, 0, 0};
     int sssNSamples = 50;
     float sssIOR = 0.45;
     vector absrption = {0.3, 0.3, 0.3};
     vector scattering = {0.7, 0.7, 0.7}; 
     )
{
    //SSS color
    VOPvector transmited  = normalize(refract(normalize(I), normalize(N), sssIOR));
    VOPfloat sss_phase = 0;

    sss_color = vop_sss_single(
    P, normalize(N), transmited, absrption, scattering, sss_phase, sssIOR, 1, sssNSamples);


    //Final surface color
    Cf = sss_color;
}


Edited by we_are_the_night
Link to comment
Share on other sites

Have you tried SSS functions of physicalsss.h? I suppose that is pretty SSS solution. For example:

#include <voptype.h>
#include <physicalsss.h>

surface
MySSSurface(
 export vector sss_color = {0, 0, 0};
 int sssNSamples = 50;
 float sssIOR = 0.45;
 vector absrption = {0.3, 0.3, 0.3};
 vector scattering = {0.7, 0.7, 0.7}; 
 )
{
 //SSS color
 VOPvector transmited = normalize(refract(normalize(I), normalize(N), sssIOR));
 VOPfloat sss_phase = 0;

 sss_color = vop_sss_single(
 P, normalize(N), transmited, absrption, scattering, sss_phase, sssIOR, 1, sssNSamples);


 //Final surface color
 Cf = sss_color;
}


Haha, I'm not that smart... sorry. I'll have to some learning to figure some of that out. I got some time today so I'm starting to rework the shader. I'll see what I can do inserting it into an inline vop, and seeing what nodes that code is generated from. If it process faster that would be good, it would be great if sesi showed a direct equivalent between vops and vex code in their help that would teach people a lot faster.

Link to comment
Share on other sites

UberShader_v7 - Nice phat and happy and works with PBR in H11... plus with help!!!

....the verbal roll over stuff, not the mental help... alcohol is cheaper

Background:

I hacked the mantra surface for the heart of this node, so it has all those functions and more. After using the mantra surface for two months I like how some of the features are laid out and decided to keep them, since, they make more sense than the old shaders, plus you get all that lovely new pbr functionality. I also revealed all the layers that they had hidden in the mantra surface(second reflection, ray distance, etc.). I removed all sub tabs so there is less navigating. The shader parameters needs more screen space, but I don't work with a parameter window open, Ctr+B and P most of the time, which is my motivation for this layout.

Node Layers:

Diffuse

Subsurface

Reflection 1

Reflection 2 - 2nd one for car paint

Refraction

Sheen

Occlusion - non-PBR

Irradiance - non-PBR use mantra irradiance cacheing...

Opacity Alpha - Allows you to use diffuse map alpha(even for cubic), use opacity parameters for alpha, and the other alpha channel enhancements from the mantra surface

Texture Style - UV/PTEX and Cubic

Settings - Mantra Surface settings with IOR, and Ray Limits for Non-PBR renders

Normal - Normal and Bump

Displacement

Heads up:

This node is getting fatter each generation, so I recommend dropping the heart of the node into the vex vop area and creating instances of the interface. If you have dozens of this node your file size on disk will regret it. Feel free to rip out the chunks you never use.

New Info I found out:

If you look at if for study I destroyed the lay out of the old mantra surface node, so it is laid out in nice net boxes.

One very beautiful thing is if you drop a vex vop surface node into a material you can organize it in that middle layer, you can organize the interface with the edit parameter interface, and still be able to promote parameters at the shop level... don't tell anyone I don't want this feature to go away, it's better than the old way.

Give me a shout if you find any errors, I got a bunch while testing that I fixed and I didn't test every single function this round. Going to put it to the test these next weeks, now that I got my alternative to the mantra surface.

UberShader_BRL_v7.otl

UberShader_v7.hip

Link to comment
Share on other sites

  • 3 weeks later...

Hi, when i add LatLong texture in reflection ( 1 or 2 )i get this message in houdini console:

" Warning: can't find object, light or fog named 'chs('../envobject/stringdef')' to compute transform "

But render start anyway....

Yeah I see that line in the environment map node. I removed it for local space. Actually re-read the help document on the node and can't find where it says lat long map either(was pretty sure about that even when I tested it too, so I guess it's back to sesi env map.

I'll fix it when I get back home, tonight.

_ben

Link to comment
Share on other sites

Yeah I see that line in the environment map node. I removed it for local space. Actually re-read the help document on the node and can't find where it says lat long map either(was pretty sure about that even when I tested it too, so I guess it's back to sesi env map.

I'll fix it when I get back home, tonight.

_ben

Tell me if this works better or worse(I changed where it made that call to object space, which should be the env map node???). I also gave more control on to what you can use the env map with, before it was just added to the spec color, now it works just like any other texture map(multiplied with everything else) in either reflection spec or both(not sure if both is a good idea in the working concept)

Ubershader_BRL_v8.otl

Edited by LaidlawFX
Link to comment
Share on other sites

Yes reflection and displacement not working V8

Yeah sorry had to work late last night(thought I was going to do it then) so I didn't get the chance, there was some minute changes between the two versions that was altered to cause this. I need to open them side by side to slowly modify the difference to see where it broke(possibly an updated node). I know at least the default constants since they are being multiplied need to be changed to ones instead of zero since they are not being added, but couldn't figure out why it was completely broke in half hour. Gona try and go be social tonight, so will see how much time I get back in front of my computer. Will try soon though.

Link to comment
Share on other sites

lol, working on it, I'll try and hurry up. Decided to re-encase the node from a material vop so there wasn't that secondary level anymore, Sesi must have fixed one of the issues I was having before with the parameter interface that sent me down the route in the first place. For some reason I haven't found a simple reason why between v7 to v8 it broke like that after the first pass too, so I'm scanning through most of the nodes to see what was at issue which is also why I'm doing the over haul.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

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...