Sun, Sep 22, 10:29 PM CDT

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Sep 22 10:18 pm)



Subject: Nodes for Dummies


bagginsbill ( ) posted Sun, 25 January 2009 at 6:19 PM

*With colour, you deal with a tupple, so any maths you apply is applied to each member of that tupple

Correct, but it is spelled "tuple".


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 6:29 PM

Attached Link: Candle shader

file_422561.jpg

*Most importantly, don't rely at all on what you see: trust the maths, get the head around the maths, *start* with maths... the nodes will grow out of that * Well I totally agree with that, but let me say it is not the *only* way to have fun in the nodes. I know that many non-mathematicians enjoy messing with nodes. This bothers people when I insist that they must learn the math, think in the math, deal only with the math.

And many non-magicians enjoy doing simple card tricks.

But nobody is going to hire one of those to do a 2-hour Vegas show.

If you want to be a material master, you must do the math. That's all I'm saying.

When I was asked to do a candle shader, I faffed about visually for a while. I tried to guess and visualize what to do. I wasted quite a bit of time doing this.

Then I grabbed myself by the throat and said to myself, do the f'ing math.

So I did. I calculated why and how light leaks down through a candle and comes out the side. Then I wrote a shader using the math formulas and it worked correctly immediately. All the experimenting and visualization was eliminated. It just worked.


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 Sun, 25 January 2009 at 6:35 PM

So, back to square one, aren't I? I'm at the "this is what salt is used for" point, using the gastronomic metaphor. I need to look at the basic of maths as it applied to nodes. Which I've started doing with the simple adding of colours. Subtracting required a bit more understanding of what values mean to Poser. Applying an "average function" was obvious to you because you prove unknowns with knowns. I've got to get to the point where I would naturally reach for that sort of function to solve a problem.

Now, I'm going to have a look at your candle shader...

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


bagginsbill ( ) posted Sun, 25 January 2009 at 6:38 PM · edited Sun, 25 January 2009 at 6:40 PM

*Your wood grain illustration is mouth-watering, Bill. Second-year, stuff, but definitely mouth-watering. So, I look at those nodes and suddenly realize I'm looking at the result of something that was worked out as a math equation before-hand. The maths actually comes first: the nodes create themselves (virtually) based on the math.

Am I getting any closer?

*Totally.

I made a simple assumption. What makes wood look like wood is not the color itself, but relationship between the colors, and the patterns they form. So if I can capture the essential relationship between the colors, then reproduce that relationship, but change the base color, I'll still retain the look of the wood.

And so that's what I set about doing.  There are many mathematical operators. Any of these can be used to describe relationships. Choosing which to use is sometimes a matter of understanding the physics, and sometimes it is just guesswork.

In this case (changing wood color) I took a guess. It works. Is it physics based? Not at all. This is an artistic hackery because it works, not because it is right.

When we think about relationships between different numbers, I like to start with basics.

Fundamentally, there is addition and subtraction (two sides of the same coin).

So, a useful relationship between "a" and "b" can be "a - b". I can then apply that same relationship to some other quantity by addition, i.e. "(a - b) + c". This says, mathematically, compute the additive relationship from a to b, then calculate an equivalent relationship from c. We might call this a mathematical "analogy".

Another possibility is "a / b". So building an analogy from this would simply require "a / b * c". 

There are tons of these floating around in the world. I collect them the way you collect samples of anything. Then I use them.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 6:46 PM

Quote - BTW, it was suggested I start a blog with this topic as focus - thank you, CobaltDream - good suggestion... and so am installing as we speak. I'd like to publish conclusions and experiments from here in that blog since threads are not very searchable, and this information needs to be in a highly accessible format.

If that's still cool with you, of course.

Sure. Quote me all you like.

If I want to write a book and charge for it, I will. Maybe. Eh, probably not. But maybe. In any case, your blog won't change the value of the book. If anything, it will increase it, because I'll not tell you everything I know, the book will have more, and even then it will not be all I know and could tell.


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 Sun, 25 January 2009 at 6:53 PM

Thank you Bill... just confirming your previous offer.

Just looking at the candle shader. Good job I have a bit of programming background, or this whole thing would be Chinese to me. Question:

        # y = Distance from top of candle - anything above Vtop will be
        # considered to be at the top for diffusion purposes, thus the
        # Max with 0.
        y = Max(0, Vtop - V)

Where is V defined? Is that an internal Poser constant?

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


kobaltkween ( ) posted Sun, 25 January 2009 at 6:54 PM

converse is also kind of true.  in my experience, the best way to see if you're accounting for most stuff is to try to reproduce some images.  if i can look at the photo, especially a raw photo, and try to match it, then i know i've got something.  the photo is a representation of reality, not the thing itself, but it's better than just relying on memory or imagination.  so you can take the math, render the result, compare it to a photo, and look at how it's different.   or even compare it to postworked photos or artwork, depending on the result you want. 

iirc, color theory was only invented in the 1800s by a French yarn or thread merchant who wanted to know why he got the feedback on colors he did.  some of the properties of colors and their complements were only discovered and mathematically mapped out in the last two centuries.  but there have been master artists for much longer than that.  

in my experience, it's a real tradeoff.  remember the number of hours bagginsbill talked about needing to become a master at anything?    now keep in mind that being a material room master is not being a master artist.  this whole past year, i've spent time learning more about the material room, light, digital sculpting, UV mapping, modeling, different renderers, and miscellaneous technical aspects.  as a result, i haven't focused on what i've been making the way i did in the previous year.  and it shows.  now i'm ready to put that first and put the technical second.  i don't know how well i'll do; that's actually much harder. 

math is a tool to describe reality, and so it can be used to generate reality.  so take time, and look at things through math for a while.  absorb it.  but don't let go of your artistic vision, or let realism change what you want the picture to look like.



RobynsVeil ( ) posted Sun, 25 January 2009 at 7:08 PM

I agree with that, CobaltDream, and would say that it's my main approach to art. See and try to reproduce:

with patchy results. So whether I use maths or the eyeball, my own sense of what feels right will be most instrumental at creating believable, interesting artwork. I just love the idea of having another tool to play with, but art will always be in a dimension above the tools used to create it.

Betty Edwards wrote this wonderful book: Drawing on the Right Side of the Brain. Through doing the exercises faithfully in that book I was able to create reasonable, recognizable likenesses of people and things. Did that make me an artist? No. Betty just handed me a tool: it was up to me to develop my own art style.

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


bagginsbill ( ) posted Sun, 25 January 2009 at 7:09 PM · edited Sun, 25 January 2009 at 7:14 PM

OK, we've come a long way. Hopefully you can add and subtract and multiply colors now, or at least know how to do so with nodes, and visualize what happens using Poser previews or ADR.

So are we ready for Diffuse?!? There's a lot to it.

The Diffuse node actually clones itself, once for each light in your scene. So you can't describe the behavior of a Diffuse node without also fully describing all the lights in the scene.

The output of all the clones get added together.

Because of this, it will help us to work with one light at a time.

It will also help us out if the light is not a spotlight or a pointlight or an IBL light. The only other kind is an infinite light. That's what we want to study first.

The beauty of an infinite light is that regardless of where the camera is or where the shaded geometry is, the direction to the light is always the same. It is a mathematical constant. It can be represented by a vector.  (A vector is a tuple, consisting of X, Y, and Z coordinate values. These describe an arrow that points in the direction of the light.)

This is perhaps too much math, but calm yourself, relax your muscles, and just read this.

A vector is an arrow in 3D space.

(Think about that. Breathe deeply. It's not complicated. It's just an arrow.)

There are two interesting things about an arrow. 1) Which way is it pointing? 2) How long is it?

You might think there is another interesting thing about an arrow - where is it. But for purposes of shading with an infinite light, that turns out to be not so useful. Trust me.

To make math on vectors (arrows) easier, we often insist that we force the length of the arrow to be 1. (Trust me.) This is called a "normalized" vector. So once we do that, the only interesting property of the arrow is its direction, because its length is 1 by definition.

OK that's a lot of crap - what is the point?

The point is, ignoring shadows, the energy density of light arriving at a particular point is going to vary according to two things:

The energy density emitted by the light source.

The angle of the arriving energy with respect to the surface.

How does it vary, exactly?

If the light is arriving straight down on the surface, it is at its maximum. If it arrives at a shallower angle, it is spread out, so it is less intense. If it arrives at so shallow an angle that it just barely grazes the surfaces, it is nearly 0. When the light vector is laying down flat on the surface, it exactly goes to 0.

Hmm.

Too much? Well suck it up. Here is the math.

The arriving light intensity density is in proportion to the cosine of the angle between the surface normal and the vector to the light.

Let N represent the surface normal vector (normalized - remember that/)
Let L represent the vector to the light. (normalized)

The light energy density arriving is therefore the cosine of the angle between N and L.

It turns out that this is trivially computed. Let's break a vector down into three components, x,  y, and z. So the normal has Nx, Ny, and Nz. The light direction vector also has three components, Lx, Ly, and Lz.

Because we've guaranteed they are normalized, we can say this:

cos(angle between L and N) = Nx * Lx + Ny * Ly + Nz * Lz

That's a neat fricking formula, even if you don't appreciate it, trust me it is mind blowingly elegant.

We use a shorthand for this, which I cannot type in this forum. It is called the "dot product". I'll write it like this: L dot N. It is similar to L * N (L times N) but it is not the same. Use the formula above.

So the amount of energy arriving is easily computed from the surface normal and the light direction vector using that simple little sum of three products, or the dot product, L dot N.

That's a lot to absorb, but we're almost there.

So it turns out that the way almost all materials behave is that they "Diffusely" reflect some of this energy. What that means is they radiate a fixed fraction of that IN EVERY DIRECTION.

Blows my mind every time I think about that. It's so wierd that real life does that.

The beauty of this is it gives us an almost trivial calculation.

The amount of light that reflects from some object is:

K * (L dot N)

where K is some constant. Read that as K times the cosine of the angle between L and N.

K can be a color.

Too much right?

We're almost there.

The Diffuse node actually expresses K as the product of a number and a color.

K = Diffuse_Value * Diffuse_Color

So, finally, the end, here is the formula for Diffuse

Diffuse_Value * Diffuse_Color * (L dot N)

Whew.

Take a breath.

I will demonstrate shortly.

(Amended - forgot something)

That whole thing is the fraction of light that get's reflected. We have to multiply that with the original lighting intensity. Let's call that I. I is a color.

Diffuse_Value * Diffuse_Color * (L dot N) * I

But in Poser, I is actually the Light:Color times the Light:Intensity

So we need to use

Diffuse_Value * Diffuse_Color * (L dot N) * Light:Intensity * Light:Color

 


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 Sun, 25 January 2009 at 7:10 PM · edited Sun, 25 January 2009 at 7:17 PM

Content Advisory! This message contains nudity

I know... need to fiddle with the lights a bit more. Shadows don't line up quite right or have the right intensity.

I'll get it... yet.

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


bagginsbill ( ) posted Sun, 25 January 2009 at 7:18 PM · edited Sun, 25 January 2009 at 7:21 PM

Attached Link: http://sites.google.com/site/bagginsbill/file-cabinet

Go to my file cabinet.

Download BBTestProp01.zip. Put it in any runtime you like. Load it.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 7:22 PM

This prop is built from a few rectangles.

They are oriented 15 degrees apart. The first one points straight south, in the Z direction.

The second is 15 degrees east. The third is 30 degrees east. The fourth is 45 degrees east.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 7:24 PM

file_422565.jpg

Here's what it looks like in preview.

Preview shows us a diffuse reflection.

My light is a single infinite light.

It is pointing straight north, away from the camera.

That means xRotate = 0, yRotate = 0, zRotate = 0.

The Intensity is 100% and the color is [1, 1, 1].

This preview render is entirely made up of the Diffuse node. That is one of the nodes that works pretty well in preview.


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 Sun, 25 January 2009 at 7:24 PM

I knew I was avoiding the diffuse_color and diffuse_value channels for a reason. Something was going on in there, and it was about the lights.

Vector. Arrow. Length of 1. When I think of arrow, I think of where it originates and the target.

So, those concepts and associated ones like energy density emitted by the light source and angle of the arriving energy with respect to the surface make sense except for one thing: we're talking about infinite light where the source is undefined. So, I have no idea what the distance is (well, it's 1 - is that all I worry about?). Is all I need to know then this: the arriving energy on my surface?

Infinite light in Poser has always been a bit enigmatic to me.

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


bagginsbill ( ) posted Sun, 25 January 2009 at 7:26 PM · edited Sun, 25 January 2009 at 7:27 PM

OK, given that the cosine(45 degrees) is .7071, and that the light color is 1 light intensity is 1, material Diffuse_Color = 1, and Diffuse_Value = 1, the formula tells us that

1 * 1 * .7071 * 1 * 1 = .7071

So the rightmost rectangle should be showing .7071 * 255 = 180.

Go measure it.


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 Sun, 25 January 2009 at 7:27 PM

So, you have a source for infinite light. Well, how about that! And you can point it.

Downloading your prop, Bill... I'd dead serious when I say this is edge-of-the-seat stuff, here!!!!

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 7:42 PM

Okay, I've deleted all but the infinite light, set the xy and zrotate coordinates as described. Flipping around with my camera to kinda get an idea how you arranged your rectangles. Now, I'll do a render... with the light directly from behind, first... changed the xy and zOrbits all to 0

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 7:48 PM

I'm thick. That's a constant.

I'm trying to get my head around this Infinite Light which has an interesting property: the light direction is always constant. Sorry? Light - any light - must come from somewhere, and that determines the direction it will travel. I have yet to sort out where the heck Infinite Light comes from. Should this not matter? But, how can it not. I can't understand the concept of direction (arrow) without a source.

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 7:53 PM

Sorry, but that is probably the main obstacle to accepting that vector concept. Or, then, do I work backward from the surface to deal with that arrow? Doesn't matter where it's coming from, but we know the length (1) of the vector and thus can sort out the angle of arriving energy using your formula cos(angle between L and N) = Nx * Lx + Ny * Ly + Nz * Lz?

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 7:58 PM

Quote - OK, given that the cosine(45 degrees) is .7071, and that the light color is 1 light intensity is 1, material Diffuse_Color = 1, and Diffuse_Value = 1, the formula tells us that

1 * 1 * .7071 * 1 * 1 = .7071

So the rightmost rectangle should be showing .7071 * 255 = 180.

Go measure it.

180 being 180, 180, 180, right? Um, if I haven't already driven you to drink with my questions, the next one surely will: how do I measure it?

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:01 PM · edited Sun, 25 January 2009 at 8:05 PM

I did say trust me. But you have not. So I must show you. Unfortunately with math.

So the vector from any point A to any other point B is B - A. In particular, given that points are 3-dimenstional tuples, this is Bx - Ax, By - Ay, Bz - Az.

Clearly if we move A, this changes.

Clearly if we move B, this changes.

Suppose A is your shading point.

Suppose B is your light position.

The vector from surface to light is B - A.

And if you move either this will change.

Or will it?

Imagine you are looking at a small light bulb, and standing next to you is another person a few feet away, also looking at the light bulb. If the bulb is near you two, it is likely that you are looking in different directions.

For example, suppose your bulb is at 0, 0, 0. You are standing 5 feet west, looking east. Your friend is standing 5 feet east, looking west. You two are looking in totally opposite directions, to see that bulb, right?

Now imaging the bulb moves 10 feet north. You'd both be looking at it, and the arrow from your eyeballs to the bulb would be a lot more parallel than they were.

Now move the bulb a mile away. Your eyeball-arrows are nearly parallel.

Move the bulb a hundred miles away. Your eyeball-arrows are so parallel I can hardly measure any difference. The direction to the light is nearly the same, even though you two are standing ten feet apart.

Now move the bulb a hundred million billion trillion miles away. What happens to your eyeball arrows?

Now move the bulb a googleplex (10 to the 100th power, i.e. a 1 followed by 100 zeros) miles away. You two are looking in the same direction, for all intents and purposes. In fact, you two could move around anywhere on the face of the earth and you'd still be looking in the same direction.

Now move the bulb infinitely far away. (Trust me) You are now looking in the same direction, by definition, no matter where you stand.

That is why the light is called an "infinite" light. It is infinitely far away. It has no position. But it has a very clear and specific direction.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:05 PM

Going back, your position is [-5, 0, 0]. Your friends position is [5, 0, 0].

The bulb starts at [0, 0, 0].

Your vector to the bulb (not normalized) is [5, 0, 0], because [0, 0, 0] - [-5, 0, 0] = [5, 0, 0].

Similarly, your friend's vector to the bulb is [-5, 0, 0] initially.

When you move the bulb north (z direction) by 10 feet, your vector is [5, 0, 10] and your friend's vector is [-5, 0, 10].

When the bulb is a mile away, your vector is [5, 0, 5280], and your friend's vector is [-5, 0, 5280].

If we normalize these vectors, they are very nearly the same. As the Z term dominates, the 5 versus -5 becomes a nitpicker's detail. For all reasonable purposes, you are looking in the same direction.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:07 PM · edited Sun, 25 January 2009 at 8:08 PM

Quote - How do I measure it?

Go into the material room.

Arrange your preview (or a render - doesn't matter) so that it is nearby and you can see it.

Click on any color in a node - for example, click on the translucence color.

Then click on some spot on the screen - any spot - where you want to measure the color you see. It will be loaded into the color you first clicked on.

Hold Alt and click on the color parameter again. You will get the Windows color picker instead of the Poser one. In this one, you can read the RGB values.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:11 PM

file_422567.jpg

Again, follow

1: Click on a color parameter
2: Click on the screen to copy/measure that color
3: Alt-Click to read what you got in RGB (255 range)


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:15 PM · edited Sun, 25 January 2009 at 8:16 PM

file_422568.jpg

Here is the prop rendered.

The first rectangle is colored 255, i.e. 1.0 in unit-range.

This is to be expected. It is facing the light.

N dot L = 1
Therefore, the reflected light is 1.0, 1.0, 1.0

2 is 15 degrees off. The cosine of 15 degrees is about .9659. Converting to 8-bit, I should find the rectangle colored .9659 * 255 = 246. It is.

#3 is 30 degrees off. The cosine of 30 degrees is about .866. Converting to 8-bit, I should find the rectangle colors .866 * 255 = 221. It is actually 221.

Wow - math.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:18 PM

file_422569.png

Change the test prop shader like this. This makes it emit black, regardless of your lighting.

That's because we set Diffuse_Value = 0 and Specular_Value = 0. Meaning, all internal built-in light-related nodes are disabled.

The prop renders black all the time as a result.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:19 PM · edited Sun, 25 January 2009 at 8:19 PM

file_422570.jpg

Now I'm going to add a Diffuse node, and connect it to Alternate_Diffuse, making an ADR.

Here's what I get. This is identical to the built-in Diffuse, every time I test it, under every condition it is identical. Is that proof? No. But I have never found it to be otherwise.


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 Sun, 25 January 2009 at 8:21 PM

Quote - I did say trust me. But you have not. So I must show you. Unfortunately with math.

So the vector from any point A to any other point B is B - A. In particular, given that points are 3-dimenstional tuples, this is Bx - Ax, By - Ay, Bz - Az.

Clearly if we move A, this changes.

Clearly if we move B, this changes.

Suppose A is your shading point.

Suppose B is your light position.

The vector from surface to light is B - A.

And if you move either this will change.

Or will it?

Imagine you are looking at a small light bulb, and standing next to you is another person a few feet away, also looking at the light bulb. If the bulb is near you two, it is likely that you are looking in different directions.

For example, suppose your bulb is at 0, 0, 0. You are standing 5 feet west, looking east. Your friend is standing 5 feet east, looking west. You two are looking in totally opposite directions, to see that bulb, right?

Now imaging the bulb moves 10 feet north. You'd both be looking at it, and the arrow from your eyeballs to the bulb would be a lot more parallel than they were.

Now move the bulb a mile away. Your eyeball-arrows are nearly parallel.

Move the bulb a hundred miles away. Your eyeball-arrows are so parallel I can hardly measure any difference. The direction to the light is nearly the same, even though you two are standing ten feet apart.

Now move the bulb a hundred million billion trillion miles away. What happens to your eyeball arrows?

Now move the bulb a googleplex (10 to the 100th power, i.e. a 1 followed by 100 zeros) miles away. You two are looking in the same direction, for all intents and purposes. In fact, you two could move around anywhere on the face of the earth and you'd still be looking in the same direction.

Now move the bulb infinitely far away. (Trust me) You are now looking in the same direction, by definition, no matter where you stand.

That is why the light is called an "infinite" light. It is infinitely far away. It has no position. But it has a very clear and specific direction.

Can you pass me one of those gimlets, please? Forget it... lemme just have the bottle.

Actually, you have explained it extremely well, Bill. After I relaxed and just went with you, it made sense. Thank you.

And no, you're not having the bottle back....

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:24 PM

So let us make another prediction.

If I change the prop color (Diffuse_Color) but I know the numbers, I should still be able to predict the outcome.

If I also change the light color, but I know the nubmers, I should still be able to predict the outcome.

I'm making this up in real time. I'm going to choose:

Prop Diffuse_Color = RGB (212, 180, 154)
Light Color = RGB (177, 215, 199)
Prop Diffuse_Value = .775
Light Intensity = .853

So my front facing rectangle should be colored

RGB(212, 180, 154) / 255 * .775 * RGB(177, 215, 199) * .853

And the others should be in decreasing proportions based on L dot N.

I'm getting out my calculator.


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 Sun, 25 January 2009 at 8:26 PM

Quote - > Quote - How do I measure it?

Go into the material room.

Arrange your preview (or a render - doesn't matter) so that it is nearby and you can see it.

Click on any color in a node - for example, click on the translucence color.

Then click on some spot on the screen - any spot - where you want to measure the color you see. It will be loaded into the color you first clicked on.

Hold Alt and click on the color parameter again. You will get the Windows color picker instead of the Poser one. In this one, you can read the RGB values.

Yup got it. Thanks.

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:29 PM

My calculation tells me I should get 97, 100, 79.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:30 PM · edited Sun, 25 January 2009 at 8:30 PM

file_422571.jpg

OK. Here is my Diffuse node, with Diffuse_Color = RGB(212, 180, 154) and Diffuse_Value = .775.


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 Sun, 25 January 2009 at 8:30 PM

Quote - So let us make another prediction.

If I change the prop color (Diffuse_Color) but I know the numbers, I should still be able to predict the outcome.

If I also change the light color, but I know the nubmers, I should still be able to predict the outcome.

I'm making this up in real time. I'm going to choose:

Prop Diffuse_Color = RGB (212, 180, 154)
Light Color = RGB (177, 215, 199)
Prop Diffuse_Value = .775
Light Intensity = .853

So my front facing rectangle should be colored

RGB(212, 180, 154) / 255 * .775 * RGB(177, 215, 199) * .853

And the others should be in decreasing proportions based on L dot N.

I'm getting out my calculator.

Setting up your prop whilst you calculate...

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:31 PM · edited Sun, 25 January 2009 at 8:32 PM

file_422572.jpg

Here is my infinite light with color =RGB(177, 215, 199) and intensity = .853


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:32 PM

file_422573.jpg

And here is my render. The first rectangle is colored 97, 100, 79 just as I predicted.


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 Sun, 25 January 2009 at 8:35 PM

151, 183, 170

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:36 PM

I'm not going to go throught the effort, but I'm sure you'd find that all the other rectangles are colored according to the proportions laid out by L dot N. That is, .9659, .866, and .7071 from the brightest rectangle, which is the one perfectly facing the light.
 


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:36 PM

Quote - 151, 183, 170

Poser Pro? Gamma correction on?


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 Sun, 25 January 2009 at 8:38 PM

Duh. I'm an idiot.
Put the Diffuse_value .775 in PoserSurface

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 8:39 PM

Poser 7...
97 100 79

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:40 PM

file_422576.jpg

OK Back to white, 100% on both light and prop.

Move the light yRotate to 45 degrees.

Render.

The intensities have swapped. #4 is the brightest now, because it faces the light. #1 is the darkest, because it is 45 degrees out of alignment.


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 Sun, 25 January 2009 at 8:42 PM

Following you so far, Bill...

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:47 PM

file_422577.jpg

Now I get really wacky.

I disconnect the Diffuse node, and build an equivalent from raw math.

The N node is key here.

The N node gives us information about our surface normal vector, N. Not only does it do that, but it  muliplies each component of N (using the parameters) with any values we like.

So if I plug in the components of L for an infinite light with yRotate = 45 degrees, guess what?

This node will give me the value of N dot L!!!

The normalized vector for such a light is approximately [ .707107, 0, .707107 ]. (1 / sqrt(2) is the component value)

The only complication is that we want this as a single number, not a tuple. So we have to plug that into a number. Whenever Poser converts a tuple to a single number, it averages the 3 parts. I.e. it uses (x + y + z) / 3. But we want (x + y + z). So we have to multiply that with 3 to cancel out the average.

This will give us Nx * Lx + Ny * Ly + Nz * Lz, which is our dot product between N and L.

I give you the shader and render. You may not believe it, but this produces nearly identical results to a "lit" prop, but you could completely delete your light here and it would still look like that.


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 Sun, 25 January 2009 at 8:47 PM

181, 181, 181... let's see that can't be right. Based on

cos(angle between L and N which is 45 degrees) = Nx * Lx + Ny * Ly + Nz * Lz

so, that's still .7071, right? and

1 * 1 * .7071 * 1 * 1 = .7071

So it should be 180, 180, 180.

Buggah.

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:52 PM

Well, yes you've hit on a mystery. The render is 181. But the preview is 180. Why?

I have no fricking idea. Poser has off-by-one bugs all over the place.


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 Sun, 25 January 2009 at 8:53 PM

Quote - Now I get really wacky.

I disconnect the Diffuse node, and build an equivalent from raw math.

The N node is key here.

The N node gives us information about our surface normal vector, N. Not only does it do that, but it  muliplies each component of N (using the parameters) with any values we like.

So if I plug in the components of L for an infinite light with yRotate = 45 degrees, guess what?

This node will give me the value of N dot L!!!

The normalized vector for such a light is approximately [ .707107, 0, .707107 ]. (1 / sqrt(2) is the component value)

The only complication is that we want this as a single number, not a tuple. So we have to plug that into a number. Whenever Poser converts a tuple to a single number, it averages the 3 parts. I.e. it uses (x + y + z) / 3. But we want (x + y + z). So we have to multiply that with 3 to cancel out the average.

This will give us Nx * Lx + Ny * Ly + Nz * Lz, which is our dot product between N and L.

I give you the shader and render. You may not believe it, but this produces nearly identical results to a "lit" prop, but you could completely delete your light here and it would still look like that.

I set it up and it did give exactly the same render, Bill. So, here we are doing what, exactly: simulating light behaviour with math nodes, then? What an incredible potential there!

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


RobynsVeil ( ) posted Sun, 25 January 2009 at 8:55 PM

Then, one could postulate that those values .707107 of N's x and z, and for that matter y could be input dynamically?

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


bagginsbill ( ) posted Sun, 25 January 2009 at 8:56 PM

file_422578.jpg

Leaving aside that it is off by one...

Remember I said earlier that it will be very handy to use the difference magnifier?

So let's use it.

Here I set up, in parallel, both the ordinary Diffuse node, and my fake pure-math version of it.

I then run those into my difference magnifier. Initially I use a factor of 1.

I render.

Look - the back side shows a difference, but not the front.

Why is that?

Because I lied. When a back-facing polygon is used in the dot product, we get a negative number. Now it turns out that when we rendered that, we saw black, but there was actually a negative color generated. We just could not see it.

But now we can see it because we're using the difference magnifier, and it will show us positive or negative differences.

Neat huh?

We've come full circle.

The back-facing polygons are actually in shadow. Remember I said the equation was correct, as long as we ignore shadows. But we can't ignore shadows.

For back-facing polygons, the effective illumination is zero, not a negative number.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 8:57 PM

Quote - Then, one could postulate that those values .707107 of N's x and z, and for that matter y could be input dynamically?

Actually, yes. I can calculate the effective illumination that would be produced using any imaginary function for the light source I would like. I can generate the math for 100 point lights, or an area light, or all sorts of things.


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)


bagginsbill ( ) posted Sun, 25 January 2009 at 9:00 PM

file_422579.jpg

So, to correct my math for backward-facing polygons, I introduce one more node.

This is the Math:Max node. I Max my calculated value with 0.

Suppose the calculation produces .3, Then the maximum of .3 and 0 is .3. No change.

Suppose the calculation produces -.3. Then the maximum of -.3 and 0 is 0. The negative value is ignored, in favor of 0.

This is what the Diffuse node normally does. It takes L dot N and does max with 0.

Now I see all black, because there is no meaningful difference between the two calculations.


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)


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.