Wed, Feb 26, 11:58 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Moderators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Feb 24 11:54 pm)



Subject: The hanging diffuse node - what does it do?


RobynsVeil ( ) posted Sun, 30 October 2011 at 12:46 AM · edited Wed, 26 February 2025 at 11:55 AM

I see this a lot in shaders. You'll have this diffuse node tacked on to the end of a whole chain of nodes. In code, it would be like:

Surface.Alternate_Diffuse = ImageMap("myImage.jpg") * (1 * 1)) * ColorRamp(IColor(8, 0, 0), IColor(23, 0, 0), IColor(4, 0, 8), IColor(0, 0, 16), .52 * Diffuse(1, 1))

...and Diffuse() is just out there. I don't get it. What is it doing?

Oh, and I don't get the Mul(1 * ImageMap, 1) either, even if I see that a fair bit as well, but I reckon that's just a bit of whimsy, maybe.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


pjz99 ( ) posted Sun, 30 October 2011 at 12:51 AM

maybe because various people really don't have the vaguest idea what their node setup is actually doing

just a possibility

My Freebies


bantha ( ) posted Sun, 30 October 2011 at 1:46 AM

Without Diffuse() the whole chain would not react on the light but act as an ambient texture. Usually, you will need either Diffuse or Clay or Scatter for the diffuse component. At least that's how I understand it.


A ship in port is safe; but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing Grace" Hopper

Avatar image of me done by Chidori


RobynsVeil ( ) posted Sun, 30 October 2011 at 2:05 AM

So, Diffuse() driving the input channel of ColorRamp() will give the same effect as ColorRamp() plugged into a Diffuse() diffuse_color channel? IOW, it doesn't matter where in the chain the diffuse channel is plugged in: the effect will be the same?

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


bantha ( ) posted Sun, 30 October 2011 at 5:09 AM · edited Sun, 30 October 2011 at 5:22 AM

file_474673.jpg

I'm not so good in reading mathmatic in my head, I made an error when first reading it. I had to run it through the compiler to read it properly.

I would assume that, since the color values are multiplied, it does not matter if you do Diffusecolor or colordiffuse, both should give the same result if I'm not mistaken. 

In the shader you posted, the diffuse node drives a color ramp, so the color of the light is changed in different ways when the light gets stronger. If I remember correctly, BB did something like this in his early skin shaders to let the shader react differently on different levels of light, before we had GC. With clear colors it's easy to see what the shader does, here is the ground plane with an render as an image with that shader.

If you would connect the diffuse node directly to the color_multiply, it would give the same effect as plugging the image directly in the diffuse channel. At least that's what I would expect.


A ship in port is safe; but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing Grace" Hopper

Avatar image of me done by Chidori


bagginsbill ( ) posted Mon, 31 October 2011 at 9:08 AM · edited Mon, 31 October 2011 at 9:09 AM

RV, you're drawing the wrong conclusion.

Uwe said without diffuse the whole chain would not react to light. Then you suddenly and without any justification equated that to multiplication.

It's nothing of the kind. The color ramp has four colors in it. The Diffuse node drives the lookup of one of those colors. When diffuse is black, or 0, then the first color is chosen. When the diffuse is pure white, or 1, then the last color is chosen. When diffuse is 1/3, the second color is chosen. When diffuse is 2/3, the third color is chosen. Other values select blended versions of the two closest lookup values. 

This technique was published by me in 2006 as a way to add some red to the skin in the shadowed areas. This was the earliest SSS faking tactic that I published as a way to avoid having to use/run face_off's realskin shader over and over. His technique for adding red was based on a script examining the location of the light. My technique was to have the shader do that. How does a shader examine the location of a light? It can't - not really. Not with the nodes Poser gives. But this hack worked in a lot of cases using the Diffuse node as proxy to answer the question "am I pointing away from the light". In low light, or very bright ambient light, it gives the wrong answer.  But in typical Poser-style portrait lighting, it gives the right answer.

When Daz hired face_off to produce the V4 shader, he decided to use this trick in the official V4 shader. Subsequently, almost every vendor copied this style, even though published better tactics in VSS and kept improving the trick in PR2 and PR3. As of PR4, it's quite sophisticated and is able to reproduce front-side scatter almost as well as the new scatter node in P9/2012.

The worst thing about the Diffuse->ColorRamp in the way people use it is it doesn't work right/same when render GC is enabled.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


RobynsVeil ( ) posted Mon, 31 October 2011 at 4:12 PM

Sorry, I didn't mean to leave the impression I was drawing a conclusion, Bagginsbill: I honestly had no idea and was asking a question.

For my purposes, it is really important to understand where in the scheme of Poser shader history this skin shader method fits. It's also significant that you developed this technique, which gives the technique considerably more credibility.

I've been in a quandary whether to replace this shader with a much simpler shader for a figure that would be used in Poser versions 6 through 9 (not GC), but I can see that prior to 9, the shader I developed would be missing some important "artifices" (for lack of a better term) to compensate for lacks in the renderer. The more sophisticated the renderer, the simpler the lights and shaders can be.

I'll leave it in. Thank you for so thoroughly answering my question.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks


LaurieA ( ) posted Mon, 31 October 2011 at 9:51 PM · edited Mon, 31 October 2011 at 10:01 PM

OMG! I almost understood what BB said!! Maybe I woke up with someone else brain...lol.

.....wanders off muttering

Laurie

edited to add: I want assure you Bagginsbill that that was not making fun of you, but myself for all the things you teach going right over my head. I'm a bit too right brained for my own good....lol ;).



Latexluv ( ) posted Mon, 31 October 2011 at 11:32 PM

Quote - OMG! I almost understood what BB said!! Maybe I woke up with someone else brain...lol.

.....wanders off muttering

Laurie

edited to add: I want assure you Bagginsbill that that was not making fun of you, but myself for all the things you teach going right over my head. I'm a bit too right brained for my own good....lol ;).

 

Laurie, sometimes you just crack me up!

"A lonely climber walks a tightrope to where dreams are born and never die!" - Billy Thorpe, song: Edge of Madness, album: East of Eden's Gate

Weapons of choice:

Poser Pro 2012, SR2, Paintshop Pro 8

 

 


LaurieA ( ) posted Tue, 01 November 2011 at 12:12 AM

Quote -
Laurie, sometimes you just crack me up!



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.