The idea of a gloffuse- shader revisited

Not too long ago i discovered that glossy- surfaces get darker with higher roughness- values. I learned pretty quickly that i wasn’t the only one who noticed it. Since i dont like it this way (because i like color- consisteny etc.), i tried to counter that surface darkening by adding a diffuse- shader at different intensities to the glossy for different roughness- values. (This wasn’t my idea, but something i read on blenderartist (can’t remeber which thread :no:). However all credit for the idea goes to the person who made that comment. I created my gloffuse shader for the Ashikhmin- Shirley- glossy- shader first (measured some values and created a blance function from them). You can read more about this and the PROBLEMS i ran into in the documentation. Here is my results so far:



Documentation.pdf (72.9 KB)GloffuseShaderAsh.blend (2.97 MB)
I put much effort into this, so if you feel the urge to tell me that i am a fool :smiley: please explain to me why and suggest a better approach. Then it is totally fine :cool:

apart from preferring the term “diflossy” (sorry, lol) that’s really good. i must admit to not noticing the darkening thing before, it’s probably going to irk me now!

@wolfie138 Haha thx :slight_smile: Today is your lucky day though! No tear will be shed about this no more because i did the same thing for Beckmann and GGX now!***
@Secrop i am not sure that i understand correctly what you mean. I know that my documentation is quite sloppy :wink: i can give you more exact values if you like!

To answer your question: First off a big thanks for linking that threat i could not remember, this was the one i was talking about in the initial post! So credit for the idea of “correting” a Glossy- shader with a Diffuse one goes to Isscpp!

To the second part: I think its a very similar topic but not quite the same, because the approaches are very different and also the goal differs slightly. If i understood correctly and judging by the node- setup provided by Isscpp, he tried to mix the behavior of a Glossy and Diffuse- distribution towards higher roughness values, while i try adding the lost energy in the form of a Diffuse component, while trying to keep the characteristic light- distribution of the Glossy- shader intact. If you think about it with a mix based setup it can’t be possibly to eliminate the energy- loss and with my add/ mix- setup you can’t possibly have the nice 100% diffused surface a Lambert- shader gives. So to me it’ s a slightly different thing. But you be the judge on that :wink:

Here is the complete set of Shaders: DiflossyShaders.blend (5.43 MB)

Here is another sloppy documentation :wink: :
Beckmann_GGX.pdf (58 KB)
A notable fact i missed to mention in the first post: The Diffuse component i use has a roughness- value of 0 which means it is a 100% Lambert- diffuse- shading. The reason for that is that the Oren-Nayar- diffuse seems to have darkening problems too.

cheers :wink:

aaand i would LOVE to see some tests that you guys do/did with this and/or similar ideas/setups!

Yep, that’s a pretty well-known problem of most current Microfacet models - they ignore multiple scattering, which occurs when the reflected light hits another microfacet. That effect is replaced with an empirical term (Smith G term), which causes these losses.

There’s been a paper about a new and 100% energy-conserving approach a while back and I’m currently playing around with an implementation of it - so far, it seems to be really great and not that much slower. That would be a nice opportunity to fix the energy-loss problem, the fresnel problem and the wish for a decent glossy-coat-on-diffuse-base with a single node :smiley:
Nothing’s finished and/or certain, though :wink:

@lukasstockner97 i would love to read that paper if you have the link for me :wink: I am really looking forward to seeing what you will do! I tried to build a Schlicks approximation node- setup, but needed a halfway- vector as is reommended for microfacet surfaces. But unfortunately i was unable to get it and didnt just want to use the normal ^^. Maybe i will try to look into Blenders sourcecode too sometime soon!

Here’s the link:

In case you’re interested in Cycles’ code, the relevant part is in intern/cycles/kernel/closure/bsdf_microfacet.h

Hello,
very interresting thread. This leads me to the - maybe stupid - question if it is necessary (or possible) to do such improvements to an emission shader.
I mean, we all know how important it is to have realistic light. And we also know that in reality light comes from surfaces that are neither mathematically fully plane, nor fully smooth.

Am i totally wrong?

Greetings,

Karl Andreas Groß

I would say yes and no to that. Since we pretend that light were a bunch of rays coming from a source and then interacting with some objects or rather their respective bsdfs i think that there is nothing wrong with an object evenly emitting light in all directions it has surfaces to emit from. Especially considering the fact that we can manipulate our emission- object to behave differently! On the other hand you are totally right just dropping a white emission plane into a scene can’t possibly produce a realistic result. I think practially though HDRi’ s are a great way to fake realistic lighting. And i think for other purposes textures would need to suffice since other more complex ways to create your light would probably get very computation heavy (just imagine modelling a lightbulb and giving the glow wire an emission material… i dont even want to see the amount of fireflies this produces) :wink: BUT maybe some smart person will figure ways out to make even that kind of stuff work!

Almost forgot about that thread!
Now, awaiting for some of Lukas magic :wink: I put a little more work in my setup. Now it behaves better and works for transparent shaders too.

Hi Chris, regarding your setup, the screenshots look good in terms of energy conservation, but indeed the math is obscure! How did you set those numbers?
Also it looks to me that the addtoashkimin node has the first two outputs completely useless

awesome! I would like to see your progress :slight_smile: The first two outputs are already removed in my previous upload for all glossy types :wink: I wasnt quite sure initially if i would do something with them so i had them as an option. Well i think my math isn’t that obscure. I didn’t provide the measured data that i modelled, but i can tell you, that i rendered glossy surfaces with the camera dead on lit by a white world material with a strength of 1 so that if everything works correctly my white surface should stay exactly as it was no matter which roughness. The next step is also pretty straightforward i believe since i modelled the data pretty accurately. The step where the math gets fishy is when i put everything into a node setup for blender, because mix and add are not linear!

Very interesting i will look into it! :slight_smile: