Jump to content

PBR all purpose layered shader


danylyon

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

Link to comment
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?

Link to comment
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
Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
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.

Link to comment
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

Link to comment
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

Link to comment
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
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...