Thu, Nov 28, 1:26 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 28 11:20 am)



Subject: Nylon Material?


RobynsVeil ( ) posted Fri, 11 June 2010 at 4:25 PM

When you get a change, BB, what I'm much more curious to see is the .mm1, if you're willing to share that. Or did you do all this sans scripting?

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


Latexluv ( ) posted Fri, 11 June 2010 at 5:48 PM

I would be interested in the .mm1 also, if you made a matmatic file for this excersize. I have completed the render I that started me on this thread. I'll post it in a moment.

"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

 

 


Latexluv ( ) posted Fri, 11 June 2010 at 5:53 PM

file_454315.jpg

Resized for posting.

"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

 

 


Winterclaw ( ) posted Fri, 11 June 2010 at 5:58 PM

Is nylon supposed to be that shiny?

Otherwise looks nice.

WARK!

Thus Spoketh Winterclaw: a blog about a Winterclaw who speaks from time to time.

 

(using Poser Pro 2014 SR3, on 64 bit Win 7, poser units are inches.)


kobaltkween ( ) posted Sat, 12 June 2010 at 1:05 AM · edited Sat, 12 June 2010 at 1:07 AM

mmm.

ok, then i think i'll be more explicit about my comment.  as much as i wanted to verify (and i'm thankful to bagginsbill for doing so), i was also hoping to point something out.  a lot of the time i see all sorts of questions about how to vary bagginsbill's work when he's already posted either a material or equation.  and there seems to be a basic principle people are missing.

whenever a function is defined by a variable, or a node has certain input, you can always fill it with whatever you want.  just the same way you can make diffuse color any mixture of nodes you want, you can make any input any mixture of  nodes you want.  if someone says to use an equation f(x), x can be anything.  just because the examples provided use numbers, that doesn't mean that's all you can use.  you can make it a number, a color, an image map, etc.  

the only issue is if the new input makes the equation go crazy (become undefined, produce output that makes other parts of the material become undefined, etc.).  for instance, the nylon equations are designed to work with values from 0 to 1 for opacity and density.  so you don't want to offset your displacement map to indent (be negative), and then use the same output for density and opacity.  you want to apply the map to the opacity and density, then adjust it for displacement. 

don't get me wrong; i know lots of effects are difficult.  but if you want to apply a known control to parameters that have already been defined, it's easy: just use Matmatic to give the parameters the definitions you want or take the nodes you want and plug them into the appropriate inputs set to values of 1 or white.  also, it's easier to focus on the general behavior of the function than to think about what it does given specific input.  it's generally better to think about the whole set of valid input rather than the infinite possibilities that make up the set.  and 9 times out of 10,  bagginsbill normalizes his parameters to work from 0 to 1.



LAJ1 ( ) posted Sat, 12 June 2010 at 1:02 PM

dumb question, what parameters should I change to adjust the color ?
thx.


bagginsbill ( ) posted Sat, 12 June 2010 at 1:45 PM

The color is the product (multiplication) of Diffuse Color and Diffuse Value. If either is 0 (or black) you'll get black.

To get non-black, you need a non-black (non-zero) value in both.

The point of having both is so that you can pick a color in the color picker, and then easily make it brighter or darker by adjusting the diffuse value, without having to resort to the color picker again.


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)


LAJ1 ( ) posted Sat, 12 June 2010 at 7:52 PM

many thanks BB.. I was changing PMC Diffuse Color and kept getting black, perfect results now.


Sentinelle ( ) posted Sun, 13 June 2010 at 12:08 PM

Quote -   ... Far easier for Poser is to calculate the cosine of the angle. I don't know if you are familiar with vector math, but it turns out that given two vectors, P and Q, the cosine of the angle between them is trivially given by computing the dot product of P and Q, as long as the vectors are unit length. In math notation, you actually write a dot between them, but I don't know how to type such a thing, so I'll just say P dot Q.

So - why is P dot Q so cheap? Because it is simply:

P.x * Q.x + P.y * Q.y + P.z * Q.z

...

So Poser has a super trivial way to compute cos(alpha) without doing any transcendental math at all. And this very neatly gives a value of 1 when the surface points straight at the camera, and 0 when it points away to the side. Values in between decrease monotonically from 1 to 0.

... 

Bagginsbill, thanks so much for taking the time to explain how the Edge_Blend node works mathematically.  I remember having seen the dot product in my distant past while in college.  I've always been fascinated by linear algebra and calculus although I'm not very good with math.  I'm pleasantly surprised to learn that linear algebra and calculus are used extensively in computer graphics.  For those of us who constantly struggle with math, we really need someone like you, BB, to simplify the math involved in CG and to help us understand the beauty of math as it is absolutely essential to digital art.

How does Poser avoid division by zero in D/cos(alpha) when alpha = 90 degrees?  Does alpha ever reach 90 in Poser?



Sentinelle ( ) posted Sun, 13 June 2010 at 1:00 PM

Quote - ... Now when we model a volume of translucent material with sheets like this, we're letting each sheet represent a slice of the volume. The more of these we use to model the volume, the more transparent each sheet needs to be. Using calculus, if we take the limit as the number of sheets approaches infinity, and the thickness of each slice approaches 0, it exactly models a volume. And in that limit, the effective transparency is T ** D, where D is the distance that the light has to pass through.

If the distance is infinitely long then the amount of light passing through is T to the infinite power, which is 0. But for any distance that is not infinite, then the transparency is greater than 0. So this is interesting. A translucent material of finite thickness cannot block all the light. There is always some non-zero amount that can get through. 

BB, would you post your calculus equations?  Unfortunately mathematical notations are not part of our standard keyboard although they really should be.  Please use whatever notations you wish to indicate their corresponding math symbols, e.g., sum for summation, S for integration (the elongated S), {lim x->0} for limit as x approaches zero, etc.
 



odf ( ) posted Sun, 13 June 2010 at 9:23 PM

Quote -
Far easier for Poser is to calculate the cosine of the angle. I don't know if you are familiar with vector math, but it turns out that given two vectors, P and Q, the cosine of the angle between them is trivially given by computing the dot product of P and Q, as long as the vectors are unit length. In math notation, you actually write a dot between them, but I don't know how to type such a thing, so I'll just say P dot Q.

Just a quick remark: another common notation for the dot product (a.k.a. scalar product) is <P,Q>.

-- I'm not mad at you, just Westphalian.


bagginsbill ( ) posted Mon, 14 June 2010 at 2:18 PM

file_454432.jpg

Sorry it's taking me a bit of time to catch up here.

Last week I promised to show how the effective transparency of opaque vertical tubes was calculated.

Here's the first of two diagrams.

The circles marked A and B are two adjacent fibers or tubes, viewed in cross section. Since the cloth repeats this over and over, we need only consider the effective opacity between the center points A and B.

Imagine the camera is at the bottom, looking up.

The fibers are separated by some distance, which we'll call S. In this case, I made S = 1, but it really doesn't matter what it is because everything involved is going to be a ratio.

Now recall that I defined the "density" (D) of the fibers as a fraction of the spacing (S).

In this case, I'm using a Density of .4 or 40% of the spacing. Which means the radius of each fiber is half that, or .2. But between A and B we have an obstruction from both fibers, resulting in a total obstruction of D. 

The red bar, marked T, is the area of transmittance - the gap we see between the fibers.

So the ratio of obstruction (which is the defintiion of opacity here) is precisely D, The shaded blue bars show us the area of obstruction in the space between A and B.


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 Mon, 14 June 2010 at 2:27 PM · edited Mon, 14 June 2010 at 2:29 PM

file_454433.jpg

Now, with the cloth turned somewhat away from the camera, the angle of incidence comes into play.

The yellow slice is tha angle of incidence, alpha. Keeping our point of view of the A tube as before, the B tube has moved along the dotted black arc.

The width of the obstruction is still D. But the width of the gap or transmittance section, T, has been reduced.

The effective spacing because of the viewing angle is marked by the black bar E. It is smaller than the original, true spacing, S. How much smaller is it?

Well, trig tells us that:

cos(alpha) = E / S

Therefore, E  = S cos(alpha).  But since I made S = 1, that's just cos(alpha).

Now the opacity is the width of the obstructions divided by the width of the effective spacing.

So: opacity = D / E

Voila - effective opacity = D / cos(alpha)

If you're not convinced that the scale doesn't matter, then let's be more explicit.

Letting r represent the actual radius of a fiber, given the chosen density, the radius must be:

r = DS / 2

The actual obstruction is twice the radius, because it's from A and B, so the obstructed area is SD.

And the true effective spacing is S cos(alpha)

The ratio of obstruction to effective spacing is then:

SD / (S cos(alpha))

The S in numerator and denominator cancel, leaving

D / cos(alpha)

This means S doesn't matter.


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 Mon, 14 June 2010 at 2:39 PM · edited Mon, 14 June 2010 at 2:39 PM

Quote - When you get a change, BB, what I'm much more curious to see is the .mm1, if you're willing to share that. Or did you do all this sans scripting?

I have to publish the new version of matmatic before you can use the script.

Also, I'm still not convinced I've taken everything into account yet. I'm making some simplifying math assumptions that I have yet to justify, except for the fact that the shader looks pretty convincing.


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 Mon, 14 June 2010 at 2:44 PM · edited Mon, 14 June 2010 at 2:46 PM

Quote - How does Poser avoid division by zero in D/cos(alpha) when alpha = 90 degrees?  Does alpha ever reach 90 in Poser?

That's a great question. I took it into account, but first let's see if we can figure out if alpha can ever reach 90.

So - for alpha to be 90, it means that the polygon we're looking at (or micro-polygon - doesn't matter) has to be exactly parallel to the viewing vector. Which means the viewing vector cannot intersect the polygon. Which means the shader will never be called in this case, because by definition the perspective view of such a polygon has zero width, effectively making it invisible. Poser doesn't render invisible things.

However, in practice, due to round-off error, I allow for the possibility that the angle could get so close to 90 that cos(alpha) becomes effectively 0. And if it is 0, then we have a problem, because we can't divide by 0 - the value is undefined.

So in my shader, (not what I showed earlier) I don't actually use 1/cos(alpha). Instead, I add a slight bias, and use 1 / (.00001 + cos(alpha)). This means the denominator never goes to 0, no matter what.

It could go to 0 if cos(alpha) becomes negative, but that would mean the surface is pointing away from the camera - we'd be looking at the back of the polygon.

The truth, though, is that Poser doesn't use cos(alpha), but instead uses the absolute value of the cos(alpha), which means it is never negative, even when we are looking at a back-facing polygon.


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 Mon, 14 June 2010 at 5:02 PM · edited Mon, 14 June 2010 at 5:10 PM

Quote - BB, would you post your calculus equations?  Unfortunately mathematical notations are not part of our standard keyboard although they really should be.  Please use whatever notations you wish to indicate their corresponding math symbols, e.g., sum for summation, S for integration (the elongated S), {lim x->0} for limit as x approaches zero, etc.
 

 
There are actually two ways to approach this, one with calculus, the other as an example of compound interest.

The compound interest approach:

We are trying to find a formula for a scenario in which a volume is modeled with n slices each with thickness x, and there is an infinite number of them, and each has continuous opacity k. Each slice takes away some light via opacity, and the rest goes to the next slice.

Transmittance (or transparency) is 1 - opacity.

So if we let the unknown continuous opacity be represented by k, we are asking for:

lim as n->infinity of (1 - k/n)^nx

The answer is e^(-kx)

This is exponential decay.

We can get the same answer via differential equations. Starting with the premise that the change in the amount of light transmitted is a decrease that is directly proportional to the amount passing reaching each slice:

dy/dx = -ky

The answer is again y = e^-kx.

Since k is some arbitrary constant, the negation can be absorbed without loss of generality, so the function is e^kx.

Now the question becomes how to figure out what value to use for k.

This is pretty easy.

Assuming you measured the ratio of light entering and leaving a sample of known thickness, X,  and you find the effective transparency is T, then

e^kX = T

Take the log of both sides:

kX = ln(T)

Then divide by X

k = ln(T) / X

An example. Suppose you are simulating a material that is 90% transparent at 2 mm.

k = ln(.9)/2

Now the interesting thing about e^kx is it is the same as (e^k)^x.

Which means that e^(ln(.9)/2) can be used as a new base, T (note I'm changing what I mean by "T" now), and you can just use T^x.

In this case, T is .948683298.

If you calculate T^2, i.e. the transmittance for 2 mm, you should get .9, and you do. Furthermore, T^4 (double thickness) will give you .81 (,9 * .9) which makes sense.

You can more directly get to the base T by simply taking the measured transparency and raise it to the power 1/D, where D is the depth of the sample.

.9 ^ (1/2) gives the same answer directly.

Another example:

Suppose you want 15% transparency at 3 inches of thickness.

.15 ^ (1/3) gives T = .793700526

What is the transparency of one inch then?

.793700526 ^ 1 = .793700526

Oh! The base T is the unit transparency. How about 2 inches?

.793700526 ^ 2 = .62996

The final opacity is just the complement of the transmittance, so 1 - T^x is the formula.


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 Mon, 14 June 2010 at 5:18 PM

Note:

This article:

http://en.wikipedia.org/wiki/Exponential_decay

Says:

Quote - The intensity of electromagnetic radiation such as light or X-rays or gamma rays in an absorbent medium, follows an exponential decrease with distance into the absorbing medium.

I was glad to see that. I had calculated from first principles that light had to work this way, but I wasn't sure. But if Wiki says that's how it works, I'm going to assume I did it right.


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)


Sentinelle ( ) posted Sun, 20 June 2010 at 1:52 PM

Quote - Well, trig tells us that:

cos(alpha) = E / S

Therefore, E  = S cos(alpha).  But since I made S = 1, that's just cos(alpha).

Now the opacity is the width of the obstructions divided by the width of the effective spacing.

So: opacity = D / E

Voila - effective opacity = D / cos(alpha)

BB, thanks for drawing the trigonometry diagrams and explaining how you came up with D / cos(alpha) as the effective opacity.  Your step by step explanation helped me understand the trig formulas involved, although on my own I would not have been able to derive from them the effective opacity.  You are simply brilliant BB.



Sentinelle ( ) posted Sun, 20 June 2010 at 2:01 PM

Quote - > Quote - When you get a change, BB, what I'm much more curious to see is the .mm1, if you're willing to share that. Or did you do all this sans scripting?

I have to publish the new version of matmatic before you can use the script.

Also, I'm still not convinced I've taken everything into account yet. I'm making some simplifying math assumptions that I have yet to justify, except for the fact that the shader looks pretty convincing.

I'll be interested in the matmatic script also.  I have downloaded matmatic and am now learning how to use it, one tiny step at a time.  Through your matmatic, I'm beginning to "see" the beauty of math as it is applied to art.  So when is the new version of matmatic going to be published?
 



Sentinelle ( ) posted Sun, 20 June 2010 at 2:17 PM

Quote -
So - for alpha to be 90, it means that the polygon we're looking at (or micro-polygon - doesn't matter) has to be exactly parallel to the viewing vector. Which means the viewing vector cannot intersect the polygon. Which means the shader will never be called in this case, because by definition the perspective view of such a polygon has zero width, effectively making it invisible. Poser doesn't render invisible things.

However, in practice, due to round-off error, I allow for the possibility that the angle could get so close to 90 that cos(alpha) becomes effectively 0. And if it is 0, then we have a problem, because we can't divide by 0 - the value is undefined.

So in my shader, (not what I showed earlier) I don't actually use 1/cos(alpha). Instead, I add a slight bias, and use 1 / (.00001 + cos(alpha)). This means the denominator never goes to 0, no matter what.

It could go to 0 if cos(alpha) becomes negative, but that would mean the surface is pointing away from the camera - we'd be looking at the back of the polygon.

The truth, though, is that Poser doesn't use cos(alpha), but instead uses the absolute value of the cos(alpha), which means it is never negative, even when we are looking at a back-facing polygon.

BB, thanks for explaining how Poser internally computes and utilizes cos(alpha).  Will the updated shader be posted at your website site?  I downloaded your BBNylon.mt5.txt from this thread and started rendering with it.  It looks great on Hongyu's outfits.  Thanks again BB.



Sentinelle ( ) posted Sun, 20 June 2010 at 2:50 PM

Quote - ...
The compound interest approach:

We are trying to find a formula for a scenario in which a volume is modeled with n slices each with thickness x, and there is an infinite number of them, and each has continuous opacity k. Each slice takes away some light via opacity, and the rest goes to the next slice.

Transmittance (or transparency) is 1 - opacity.

So if we let the unknown continuous opacity be represented by k, we are asking for:

lim as n->infinity of (1 - k/n)^nx

The answer is e^(-kx)

This is exponential decay.

We can get the same answer via differential equations. Starting with the premise that the change in the amount of light transmitted is a decrease that is directly proportional to the amount passing reaching each slice:

dy/dx = -ky

The answer is again y = e^-kx.

Since k is some arbitrary constant, the negation can be absorbed without loss of generality, so the function is e^kx.

Now the question becomes how to figure out what value to use for k.

This is pretty easy.

Assuming you measured the ratio of light entering and leaving a sample of known thickness, X,  and you find the effective transparency is T, then

e^kX = T

Take the log of both sides:

kX = ln(T)

Then divide by X

k = ln(T) / X

An example. Suppose you are simulating a material that is 90% transparent at 2 mm.

k = ln(.9)/2
...
Now the interesting thing about e^kx is it is the same as (e^k)^x.

Which means that e^(ln(.9)/2) can be used as a new base, T (note I'm changing what I mean by "T" now), and you can just use T^x.

You can more directly get to the base T by simply taking the measured transparency and raise it to the power 1/D, where D is the depth of the sample.

.9 ^ (1/2) gives the same answer directly.
...
The final opacity is just the complement of the transmittance, so 1 - T^x is the formula.

It's pretty easy to figure out the value of k you say?  I beg to differ.  Thanks BB for the detailed explanation on how you derived the final opacity via calculus.  I actually had to reference my good old pre-calculus and calculus books to understand all the math involved.  Your examples surely helped (thank you).  This is sheer brilliance BB.  I was able to follow your logic but again, on my own I would not have been able to come up with the final opacity.
 



bagginsbill ( ) posted Sun, 20 June 2010 at 9:12 PM

I have more. Remember I said I believe I have not taken everything into account. There is refraction!

How does this affect things? Hmm? Can anyone guess? It has to do with the attenuation calculation, using the 1 / cos(alpha). This is actually not the correct angle, i.e. the angle of incidence is not the angle of transmission, therefore the distance of transmission is different, therefore attenuation is different, therefore opacity is different.

Fascinating stuff this. Both my nylon shader and my glass shader are becoming very much more than any I've posted before.


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)


Winterclaw ( ) posted Mon, 21 June 2010 at 12:32 AM

Would it be 1/{cos(alpha) + Angle of Refraction}, or 1/{cos(refraction)} or something like that?  I'm thinking that the angle would be equal to attenuation plus the angle of the refraction.  When you are looking head on, both of them should be rather small but as you look at higher angles, the light is bouncing through a different thickness of material thus its refraction should change/increase.    Part of me is also thinking you'll have to add an edge blend as well because of this.  All this will also change opacity it is going to be taking a different angle to the viewer.

So how would refraction work once you get closer to the sides and you start having parts of several fibers refracting the light?  Too complex for what you are doing?

Sorry for making such vague generalizations, it's been years since I've done any real math or physics.

I also have a silly question.  Since nylon is stretchy, shouldn't the fiber density be greater in areas where the material is stretching less (leg parts with lower diameter) and lower in areas it is stretching more?

WARK!

Thus Spoketh Winterclaw: a blog about a Winterclaw who speaks from time to time.

 

(using Poser Pro 2014 SR3, on 64 bit Win 7, poser units are inches.)


Latexluv ( ) posted Mon, 21 June 2010 at 4:42 PM

I am waiting with baited breath, BB, for you to publish to us either shader!

"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

 

 


Winterclaw ( ) posted Mon, 21 June 2010 at 5:51 PM

Without any answers, I'm starting to wonder if it is 1/cos(alpha+refraction).

WARK!

Thus Spoketh Winterclaw: a blog about a Winterclaw who speaks from time to time.

 

(using Poser Pro 2014 SR3, on 64 bit Win 7, poser units are inches.)


bagginsbill ( ) posted Mon, 21 June 2010 at 6:43 PM

Quote - Without any answers, I'm starting to wonder if it is 1/cos(alpha+refraction).

Sort of, yes.

The angle of transmission is not equal to the angle of incidence on the outside. The angle of transmission is modified, causing the ray to pass more directly through the cloth, thus traversing a smaller distance than the angle of incidence would indicate.

Let's call the angle of transmittance beta.

So our attenuation factor due to angle was 1/cos(alpha) and it needs to be 1/cos(beta).

The relationship of the angle of transmittence, beta, to alpha is given by Snell's law:

IOR * sin(beta) = sin(alpha)

Which means:

sin(beta) = sin(alpha) / IOR

In other words, increasing the IOR from 1 decreases the sin of the angle beta.

Now the difficulty we have is that we're dealing with cosines, not sines. How to get cos(beta)?

Well, we use the following identity:

sin(x) ^ 2 + cos(x) ^ 2 = 1

Rearranging, we have:

sin(x) ^ 2 = 1 - cos(x) ^ 2

Cool. Start with Snell's law, but square both sides:

sin(beta) ^ 2 = (sin(alpha) ^ 2 ) /  (IOR ^ 2)

Now use the previous identity to replace sin with cos.

1 - cos(beta)^2 = (1 - cos(alpha) ^ 2) / (IOR ^ 2)

Rearrange a bit:

cos(beta)^2 = 1 - (1 - cos(alpha)^2) / (IOR^2)

And taking square root, gives us cos(beta) in terms of cos(alpha).

cos(beta) = Sqrt(1 - (1 - cos(alpha)^2) / (IOR^2))

Since we have cos(alpha) [ from the Edge_Blend node ] we now have the correct attenuation factor taking IOR into account.

If you graph this it shows that the IOR makes a huge difference. The edge attenuation is much less when the material has even slightly higher IOR than air. According to a couple sources I Googled, the IOR of nylon is very high - 1.53.

I don't really know what to make of this, but I'll put it in the shader and see what happens.


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)


AnAardvark ( ) posted Wed, 23 June 2010 at 10:02 AM

Bagginsbill -- you just have to get a product into the marketplace so that we can credit you in the galleries :)


bagginsbill ( ) posted Thu, 24 June 2010 at 1:25 PM

Did some more research and I'm close to finished with the BBNylon2.

I found this micrograph of how nylon is woven in things like stockings.

Looking at this, I estimate the linear density of the fibers when viewed flat appears to be around .17 - there are lots of openings where we can see through between the fibers.

Looking at the geometry, we can see this is much more complicated than a simple weave. When this rotates, it doesn't do what a flat sheet of nylon would do. I have no hope of generating a completely accurate transmission function for this. However, I made a few assumptions and did some experimental observation (ahem) and concluded that I'm very close to done.


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 Thu, 24 June 2010 at 1:26 PM · edited Thu, 24 June 2010 at 1:27 PM

Content Advisory! This message contains nudity

file_454866.jpg

Here's a demo with various settings. All are at opacity = 1. The stockings are density = .17, but .67 at the welt and toe. The skirt part of the dress is .5. And the upper part is .3.

(Click for full size as the reduced version is distorted.)


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 Thu, 24 June 2010 at 1:29 PM

For the curious, this is the part of my matmatic script that calculates the value to plug into transparency.

cosA = EdgeBlend(1, 0, 1).asNumber() + .00001

fx = cosA ** 2
gx = 1 - (1 - fx) / (IOR ** 2)
b = opacity
a = density
factor = 1 / Sqrt((1 - b) * gx + b * fx)

y3 = 2 * a - a * a
transValue = 1 - (1 - y3 * b) ** factor


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 Thu, 24 June 2010 at 1:45 PM

Quote - I also have a silly question.  Since nylon is stretchy, shouldn't the fiber density be greater in areas where the material is stretching less (leg parts with lower diameter) and lower in areas it is stretching more?

 
Indeed, but trying to figure that out in a shader is difficult at best, and close to not possible in Poser nodes.

If you really want to get to that level of accuracy, I'd probably just use a gray-scale map, drawing where the fibers are stretched or compressed, and use that to modulate the density value.


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 Thu, 24 June 2010 at 1:48 PM

file_454868.txt

For those that want to try it, here is version 2. Still a WIP as far as controls and options, but I think the core math isn't going to change.

Remember to remove the ".txt" from the material file name when you save 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)


Latexluv ( ) posted Thu, 24 June 2010 at 3:46 PM

Wow! Impressive! I have great hopes for the new Glass shader you mention in another thread! Thank you so much!

"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

 

 


parkdalegardener ( ) posted Thu, 24 June 2010 at 5:19 PM

Six years of post secondary education and none of it involved math or physics. I'm beginning to wish it did. Thanks a lot BB for explaining this in such detail. Now back to re-reading this thread till it clues in completely.
pdg



Sentinelle ( ) posted Fri, 25 June 2010 at 8:20 PM

Quote - ...

The relationship of the angle of transmittence, beta, to alpha is given by Snell's law:

IOR * sin(beta) = sin(alpha)

Which means:

sin(beta) = sin(alpha) / IOR

In other words, increasing the IOR from 1 decreases the sin of the angle beta.

Now the difficulty we have is that we're dealing with cosines, not sines. How to get cos(beta)?

Well, we use the following identity:

sin(x) ^ 2 + cos(x) ^ 2 = 1

Rearranging, we have:

sin(x) ^ 2 = 1 - cos(x) ^ 2

Cool. Start with Snell's law, but square both sides:

sin(beta) ^ 2 = (sin(alpha) ^ 2 ) /  (IOR ^ 2)

Now use the previous identity to replace sin with cos.

1 - cos(beta)^2 = (1 - cos(alpha) ^ 2) / (IOR ^ 2)

Rearrange a bit:

cos(beta)^2 = 1 - (1 - cos(alpha)^2) / (IOR^2)

And taking square root, gives us cos(beta) in terms of cos(alpha).

cos(beta) = Sqrt(1 - (1 - cos(alpha)^2) / (IOR^2))

Since we have cos(alpha) [ from the Edge_Blend node ] we now have the correct attenuation factor taking IOR into account.

...

You're a genious BB.  Surprisingly I was able to follow your logic after looking up Google for Snell's law.  Your step by step explanation really helps.  Thanks BB for including all the necessary steps to show us how you derived the final equation.  Usually when I look up a math equation on the web, the author who explains it states a beginning equation then quickly jumps to his final conclusion in just a few steps, skipping perhaps 10 crucial steps that would help someone like me understand what he's talking about. 



Sentinelle ( ) posted Fri, 25 June 2010 at 8:35 PM

Quote - For the curious, this is the part of my matmatic script that calculates the value to plug into transparency.

cosA = EdgeBlend(1, 0, 1).asNumber() + .00001

fx = cosA ** 2
gx = 1 - (1 - fx) / (IOR ** 2)
b = opacity
a = density
factor = 1 / Sqrt((1 - b) * gx + b * fx)

y3 = 2 * a - a * a
transValue = 1 - (1 - y3 * b) ** factor

Cool.  Thanks for showing us the matmatic formulas.  I have downloaded your second material set.  Now if I could just figure out which among the 68 nodes plus belong to above matmatic formulas...
 



RobynsVeil ( ) posted Fri, 25 June 2010 at 8:47 PM

Quote - Cool.  Thanks for showing us the matmatic formulas.  I have downloaded your second material set.  Now if I could just figure out which among the 68 nodes plus belong to above matmatic formulas...

Short answer: you probably won't. Matmatic is an incredible tool in that it optimises Poser node creation based on the formulas... IOW, it's not a one-to-one relationship, i.e., "this function generates that node".
I did try that once, and was set straight. Unequivocally. :biggrin:

The best thing to do is try to understand the logic behind the math - which is what you're doing - and not worry about what nodes are created: it's going to be node soup, anyway.

On a side note, Matmatic provides about the very best shader copyright protection out there, since without the script no one can reverse-engineer the nodes to recreate the formulas that generated them. Well, I say no-one, but I'm sure someone from the planet Brainiac might be able to nut out something, but believe me, as Bagginsbill's scripts go, you'd have to have pretty much his intellectual horsepower to even get close to sorting out what made what.

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 Fri, 25 June 2010 at 9:19 PM

LOL. Actually I can't even decode my own materials. The material room's visual "language" just doesn't work for complex concepts, IMO. I know that math takes practice, but the language of mathematics is incredibly concise, whereas the language of nodes is not. For me, conciseness is a big deal. As well, the nodes are not arranged at all, except in order of first use in the shader tree, which makes it a mess to sort out what feeds what.


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 Fri, 25 June 2010 at 9:24 PM

Also, we mustn't forget the power of encapsulation, one of the basic tenets of modern software development. Encapsulation used to be called "data hiding", but it's much more than that now. It means to exclude the details, so much so that they are actually cannot be viewed anymore.

For example, you understand this:

ior = PM(1.54, "IOR")
s.Reflection_Value = Fresnel(ior)

will generate a bunch of nodes. (15 if I recall correctly). Were you to look at those nodes (the details) you'd have quite a time of understanding that it was a Fresnel reflection effect.

But the script fragment is utterly clear.


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 Fri, 25 June 2010 at 11:12 PM · edited Fri, 25 June 2010 at 11:12 PM

I meant to type TrueFresnel in the last post. Oh well. Fresnel, of course, is a node - a crappy one I never use anymore.


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)


Sentinelle ( ) posted Sat, 03 July 2010 at 4:42 PM

Quote - > Quote - Cool.  Thanks for showing us the matmatic formulas.  I have downloaded your second material set.  Now if I could just figure out which among the 68 nodes plus belong to above matmatic formulas...

Short answer: you probably won't. Matmatic is an incredible tool in that it optimises Poser node creation based on the formulas... IOW, it's not a one-to-one relationship, i.e., "this function generates that node".
...

You're right Robynsveil.  My brains were fried after two hours of staring at BB's nodes...



Sentinelle ( ) posted Sat, 03 July 2010 at 4:57 PM

Quote -
Also, we mustn't forget the power of encapsulation, one of the basic tenets of modern software development. Encapsulation used to be called "data hiding", but it's much more than that now. It means to exclude the details, so much so that they are actually cannot be viewed anymore. For example, you understand this:

ior = PM(1.54, "IOR")
s.Reflection_Value = Fresnel(ior)

will generate a bunch of nodes. (15 if I recall correctly). Were you to look at those nodes (the details) you'd have quite a time of understanding that it was a Fresnel reflection effect.

But the script fragment is utterly clear.

Quote - I meant to type TrueFresnel in the last post. Oh well. Fresnel, of course, is a node - a crappy one I never use anymore.

I haven't given up yet although my brains are pretty much fried as a result of staring at your VSS skin shader nodes and your nylon material nodes...I need a break, but I'll be back.



RobynsVeil ( ) posted Sat, 03 July 2010 at 11:03 PM

"I haven't given up yet although my brains are pretty much fried as a result of staring at ..."

I know the feeling, Hawarren. I realised eventually that all I was looking at was node soup, and that no amount of staring was going to produce a texture recipe.

In another thread Acadia asks HOW to know to use this node or that node to produce the desired effect. This was a burning question in my mind as well. Whilst there IS some documentation on the Anisotropic node or EdgeBlend node, and we know much more NOW than we did about that incredibly magical Blender node (thanks to Bagginsbill), effectively using them in a sentence is still a grey area for me. I can reasonably predict what will happen with certain nodes... but combining their action? grey area. How grey? Charcoal.

We were looking at procedural hair texture for a while... and I sort-of got caught up in a testing spree of Anisotropic and fractalSum and some other stuff but I didn't take this as far as BB would have because when I reach that impasse, I sort-of gave it up, whereas he would have presevered.

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 Wed, 14 July 2010 at 8:23 AM

file_455991.txt

Hello again. Now that I have published matmatic 1.1.0, I can share the nylon shader script I used. Sorry it isn't commented - the tricky math bits probably need some explanation. Feel free to ask for clarification or advice on how to do something different.


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)


Sentinelle ( ) posted Sat, 24 July 2010 at 12:46 PM

Quote - Hello again. Now that I have published matmatic 1.1.0, I can share the nylon shader script I used. Sorry it isn't commented - the tricky math bits probably need some explanation. Feel free to ask for clarification or advice on how to do something different.

I can't believe I missed this post last week.  Thanks so much BB.  Will download the mm1 file and try it out.



Sentinelle ( ) posted Sat, 24 July 2010 at 1:00 PM

Quote - "I haven't given up yet although my brains are pretty much fried as a result of staring at ..."

I know the feeling, Hawarren. I realised eventually that all I was looking at was node soup, and that no amount of staring was going to produce a texture recipe.

In another thread Acadia asks HOW to know to use this node or that node to produce the desired effect. This was a burning question in my mind as well. Whilst there IS some documentation on the Anisotropic node or EdgeBlend node, and we know much more NOW than we did about that incredibly magical Blender node (thanks to Bagginsbill), effectively using them in a sentence is still a grey area for me. I can reasonably predict what will happen with certain nodes... but combining their action? grey area. How grey? Charcoal.

We were looking at procedural hair texture for a while... and I sort-of got caught up in a testing spree of Anisotropic and fractalSum and some other stuff but I didn't take this as far as BB would have because when I reach that impasse, I sort-of gave it up, whereas he would have presevered.

Thanks for the links Robynsveil.  BB made it look so easy.  He's a rare genius who has mastered the "art" of applying math and physics to art.
 



Anthanasius ( ) posted Sun, 10 October 2010 at 12:03 PM

file_460155.jpg

For those who are interested, i've done this shader to apply it like second skin

Génération mobiles Le Forum / Le Site

 


Anthanasius ( ) posted Sun, 10 October 2010 at 12:03 PM

file_460156.jpg

A close up

Génération mobiles Le Forum / Le Site

 


Anthanasius ( ) posted Sun, 10 October 2010 at 12:06 PM · edited Sun, 10 October 2010 at 12:08 PM

file_460157.txt

The shader ( made manually, matmatic make me out of the nose ! ), it dont have GC i use Ppro.

Rename it by removing the ".txt" and put it in your material library.

You just have to select a skin map and play with the options.

Glitter is not really ready and need more work.

Génération mobiles Le Forum / Le Site

 


Latexluv ( ) posted Sun, 10 October 2010 at 4:33 PM

Looks fantastic!

"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

 

 


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.