Jump to content
danylyon

PBR all purpose layered shader

Recommended Posts

Here's two renders I did to test the point cloud caching.

Unfortunately it's a two step process (caching needs to happen in raytrace mode). I explain on the help card how I did it.

Add another 3-4 minutes for the caching on the point cloud rendertime. (Note though that it's also a little bit less noisy)

post-8977-0-29277300-1378238907_thumb.jp

post-8977-0-55214600-1378238909_thumb.jp

Share this post


Link to post
Share on other sites

Sounds really interesting! I was thinking of building something similar myself - so I will definitely check out the trail version! Some questions regarding the commercial version: Is it built in vops or written in vex? Also it being copy protected - does that mean that it's not possible to further extend or edit its functionality?

Share this post


Link to post
Share on other sites

Hi Simon

It's written in VEX, over 1500 lines of code, I don't really think it's feasible to do something like that in vops. I thought alot about doing something extendable, but just ended up making the shader as flexible as possible. (It can do a lot more than say mia_material or the arnold standart).

If you want to write something yourself for PBR specifically, I'm willing to help. If you have specific questions, I can copy paste the relevant VEX code in here. (Probably easier for you than scrolling through all the code)

Edited by danylyon

Share this post


Link to post
Share on other sites

Hey Dany,

Thanks for offering to share some of the code. A free apprentice version sounds great! I was thinking of building my shader in vops (without the custom bsdf part for now ), as I never did much coding in vex other than what I use in point wrangle nodes. But I see your point - in a shader that feature rich, being easier to build and maintain in code.

The main features I am interested in are automatic Mari UDIM support, being able to map every attribute and layering shaders. So more the usability than the math part. But also shading wise the custom more flexible bsdf seems really cool - have you thought about releasing it as a seperate HDA on orbolt - like an alternative to the Physically Based Specular and Diffuse nodes?

I wanted to test your shader this weekend but it crashed my Apprentice Houdini on osx ...but I guess its some orbolt issue other than a problem with your shader -as it did work in the office on friday ..only that I didn't have the time to really take it for a spin then.

Share this post


Link to post
Share on other sites

Hi Simon

UDIM support is a bit tricky, because there's very limited String support in VEX (or VOPS).

I ended up using a trick. I use %d in the filename to replace it with the correct number. %d is also the code to print an integer variable in decimal. (with sprintf)

So given u and v coordinates, it looks for the correct UDIM and replaces %d with the number:


if(match("*%d*", name))
{ // use UDIM
float number = floor(u) + 1001;
filename = sprintf(name, number);
fu = u - floor(u);
}
[/CODE]

maybe theres a better way...

If you have installed both my VEX files from my shader, you can actually use the custom bsdf in any shader you want. just use:

[CODE]
myBSDF = cvex_bsdf("specular_eval", "specular_sample", "label", "reflect", "Nn", Nf, "ex_nu", nu, "ex_nv", nv, "tanU", L_udir, "tanV", L_vdir, "falloff", mff);
[/CODE]

It works just as the standart "bsdf ashikhmin" except for the added falloff parameter.

For the diffuse, my shader uses the standart diffuse bsdf.

The trick is really more how to combine all those ;-)

Can you try again on OSX? Does it crash on install or when rendering? Unfortunately I don't have OSX to test it.

Share this post


Link to post
Share on other sites

Thanks for the code snippet! Well the crash only seemed to occur when I tried to create the asset via the tab menu in shops. Adding the asset from the asset browser does work without a crash.

Share this post


Link to post
Share on other sites

That's strange. Maybe it's due to a flawky default. Mhm. Anything I can do to investigate? Do you want to send it to SESI?

Share this post


Link to post
Share on other sites

I just updated the shader for Houdini 13

The major thing I had to change, was the way the layers are blended together. It is now more predictable and artist friendly. The Parameters all stay the same, but the look will change slightly if you are using more than the Base layer.

Other updates and bug fixes:

  • the shader doesn't do gamma correction anymore, linearization is now handled by Houdini 13. You can now use floating point and 8bit files as textures correctly.
  • negativ bump scale is now possible
  • added transparency & color to OpenGL support
  • fixed a bug in the presets (an orphan script in the sssMap parameter which caused Mantra throw a warning)
  • fixed a (major) bug, that made the shader render in point cloud mode instead of normal, when not explicitly turned off. (Which made it impossible to render glass by default)
  • absorption causes NaN's in H13 (worked in H12). I'm submitted a Bug report and they fixed it in version 13.0.227

Let me know of any issues and feature requests.

Share this post


Link to post
Share on other sites

I've made some tests. It works ok in an artistic way.

There are some great papers and tech out there though.. maybe one of these days I'll make a dedicated Car Paint shader.

post-8977-0-52428500-1384161407_thumb.jp

carpaint.hip

  • Like 1

Share this post


Link to post
Share on other sites

Sounds great! Based on settings of the shader it's surely possible. But it will be great to see a car completely shaded using your material.

Share this post


Link to post
Share on other sites

after evening of testing i have nothing but praise for your work here. the results are just beautiful. the help on every setting makes the initial learning curve fairly flat.

anyone that will try this shader, be sure to see the help card and follow the directions for the .vex install.

brilliant work dany.

LOVE this shader.

Share this post


Link to post
Share on other sites

I would suggest SESI to buy the code from Dany and open it as a standard shader with Houdini and carry on the development.

Share this post


Link to post
Share on other sites

This shader is really great! It covers the vast majority of common shading scenarios.

Specifically what is nice about it is the consideration to the peak of the specular highlight, which is the weakest part of the default BSDF models in Houdini. In the help you say there is no math out there yet to implement such a phenomenon... however recently I've read the SIGGRAPH course notes from Disney in 2012 regarding their physically plausible model:

http://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf

They have a term in their specular model (based on GGX) that does indeed modify the peak and falloff of glossy reflections. If I have any time I want to try to implement it myself as a BSDF... but who knows when that will happen!

In any case if you haven't seen this I thought you might find it useful as it backs up your "hack" with lots of real-world BRDFs that behave very similarly!

-Jon

Share this post


Link to post
Share on other sites

Thanks a lot of the nice comments.

Jon: That disney paper was one of the first inspirations for the shader, I was actually at the talk a few years ago. Being able to adjust the peak (something I've always missed in any other renderers / shaders) was one of my first goals. I guess I didn't know then, that GGX (this one: http://www.cs.cornel...EGSR07-btdf.pdf ) could also be used for specular and not only refraction. I've tried to implement it some time ago, but it's not easy. My math is a bit rusty.

I've looked at a lot of measured BRDFs myself. (I've made a MERL BRDF loader in Houdini). To test and fine tune how things work together. That's also where most of the presets come from.

If you look at this picture: http://forums.odforc...attach_id=17968

A classic Ashkhmin would look more like the one I'm attaching. It's a huge difference and most modern renderer don't seem to care.

Jordi: I'm sure Sesi could come up with better solutions :-) I've also sacrificed some technical possibilities (Like being able to define the filter method) for easy of use. The shader came to life because I need something to texture and shade a lot of objects realistically and fast. (For a short film and other Projects I'm working on)

post-8977-0-91453400-1384767100_thumb.jp

Share this post


Link to post
Share on other sites

Thanks a lot of the nice comments.

Jon: That disney paper was one of the first inspirations for the shader, I was actually at the talk a few years ago. Being able to adjust the peak (something I've always missed in any other renderers / shaders) was one of my first goals. I guess I didn't know then, that GGX (this one: http://www.cs.cornel...EGSR07-btdf.pdf ) could also be used for specular and not only refraction. I've tried to implement it some time ago, but it's not easy. My math is a bit rusty.

I've looked at a lot of measured BRDFs myself. (I've made a MERL BRDF loader in Houdini). To test and fine tune how things work together. That's also where most of the presets come from.

If you look at this picture: http://forums.odforc...attach_id=17968

A classic Ashkhmin would look more like the one I'm attaching. It's a huge difference and most modern renderer don't seem to care.

Jordi: I'm sure Sesi could come up with better solutions :-) I've also sacrificed some technical possibilities (Like being able to define the filter method) for easy of use. The shader came to life because I need something to texture and shade a lot of objects realistically and fast. (For a short film and other Projects I'm working on)

My goal is the same than yours I believe, get on with it and use one single shader for 99% of my work, build a massive library of calibrated materials and make sure I am super-quick with my clients.

I would love SESI to have the opportunity to raise it to the next level, after all I believe it would be great for all users.

  • Like 1

Share this post


Link to post
Share on other sites

Totally agree that we need such an open shader in default shader library. It really helps to solve 99% of shading tasks

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×