Jump to content

Specularity - sunlight vs. local light


You are about to reply to a thread that has been inactive for 3632 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I've been wondering why in SL sunlight and local light act differently on specular map. If there is specular map in object this is what happens:

• the sunlight does not wash out the colour in the diffuse map
• local light do wash out the colour in the diffuse map

Here is an example. The pants have diffuse map, normal map and gray scale specular map. The specular colour is set to white. The local light is white. In sunlight the diffuse reflection looks really nice, no washing out of the colour in the diffuse map. In local light the diffuse map's colour is almost totally washed out, the more so when the local light is very strong. So the end result is that any clothes which have specular map will look very bad in places where there are lots of local lights.

Specularity_sunlight vs local light.jpg

In further experiment, I changed the specular colour to red. It's not very good either. The specularity in sunlight gets dimmer and the specular colour changes the reflection colour to red also in the black belt part.

So, I wonder why the sunlight and local light are different concerning specular reflection?

  • Like 2
Link to comment
Share on other sites

This is kind of a painful issue in SL, I have encountered exaclty the same.

According to my understanding this is related to "power" of sunlight compared to local light in SL shader. The default sunlight is a directional light that emits rays only in one direction. Local lights are more like point lights and those emit rays in various angles. Well, of course SL does not have any raytraced real time shading.

What this all causes is that default sunlight does not give enough specular effect. And local light gives too much specular compared to sunlight. However, both give reasonably good amount of diffuse ...and that is what makes it so hard. The diffuse channel looks about same in local and sun light, but specular goes it's own way.


One somewhat easy way to get arount this is to use environmental reflection. But to avoid wet or too metallic look, the normal map specular map alpha channel should maybe have black-and-white version of the diffuse texture tweaked with curves or brightness. At least with metals this method helps to get more specular in sunlight. Cloth fabrics are not so easy....

  • Like 3
Link to comment
Share on other sites

It makes a difference how high the sun is in the sky.
I can't say how high it is from the picture you provide.

Try to lower it to morning or evening.

It can't be that you used one of those merchant recommended wind-light settings that makes no shadows at all?
In those settings there are no sunlight only ambient light coming from all directions and that could explain what you see.
With such a setting no glossiness is revealed

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

I tried couple of Windlight settings, the default and one another. Both cast shadows all right. The specular effect on the pants due to the sunlight was very evident as I rotated my avatar. I also set the day to different times, the specular reflection on the pants moved as the sun moved. The specularity with sunlight never gave that bad washed out colour effect what the local light did.

So the washing out the colours is a local light issue. One can check this easily by going walking about in a place where there are many local lights, like Tempura Island for example. Any clothes having specular map are totally ruined by various local lights in that place and similar ones.

Link to comment
Share on other sites

well im not sure i understand you well when you say you applied a white specular map. Is it a totally white one ?

If so, then why do you want that ? the more white you add the more you come closer to a glass effect. A fabric should be dark specular map. 

From this link : http://wiki.splashdamage.com/index.php/Specular_Maps : "The higher the value of a pixel (from black to white), the shinier the surface will appear in-game. Therefore, surfaces such as dry stone or cotton fabric would tend to have a very dark specular map, while surfaces like polished chrome or plastic would tend to have lighter specular maps."


(bold is mine). your pants is supposed to be closer to cotton fabric than to polished chrome.

Red wont do anything. 

For clothes you ll need black and white maps, but since its for fabrics, ull need a good amount of black (more than white)

As for example. i went to the link you gave in Tempura island. I made 2 snapshots, one in the hall at the arrival. and the other under a local light in the garden. 

The dress im wearing is one of those i create with normal and specular maps.. there is no difference with local light or without. I can assure you.

Snapshot_001.png

This is at the Hall at the Landpoint.

 

Snapshot2_001.png

this is in the garden under a ray of local light.

its same than under normal sunlight. 

The windlight setting was one of the [TOR] sunrise (i dont rem wich exactly).

But definitely my specular map is not white at all.

If you want, drop me an im inworld, i can give you a copy of one of my dresses with materials for you do the test yourself. I can show you how look my specular maps if you want.

Link to comment
Share on other sites


Trinity Yazimoto wrote:

well im not sure i understand you well when you say you applied a white specular map. Is it a totally white one ?

If so, then why do you want that ? the more white you add the more you come closer to a glass effect. A fabric should be dark specular map.

Oh no, the specular map is not plain white, it is made from the diffuse map, turned into gray scale image. It has dark and lighter areas. (I do know how properly made specular map should look like.)

For the pants, the specular map settings in the build menu are:

• Glossiness = 17

• Environment = 0

• Color = white

In sunlight the specular map gives very nice subtle specular shine in default Windlight, just what a soft cloth should have. But as you can see in my earlier picture, the local light has that very bad color washing out effect.

 


Trinity Yazimoto wrote:

 

As for example. i went to the link you gave in Tempura island. I made 2 snapshots, one in the hall at the arrival. and the other under a local light in the garden. 

The dress im wearing is one of those i create with normal and specular maps.. there is no difference with local light or without. I can assure you.

Snapshot_001.png


Looking at your picture it appears to me that you have very high glossiness value for the specular map, right? The shine looks like a shine from a metal surface, or silk, or plastic. I can have that same shineness effect on my pants - in sunlight and in local light - what you have on your dress when I turn the glossiness value a lot higher (around 100). But as the pants are not made of metal, nor silk, nor plastic, I keep the glossiness value low which gives the realistic subtle shine for cloth in sunlight.

I'm interested to know what happens with local lights to your dress if you turn the glossiness way down - to 17 for example? Do you start getting the color washing out effect too?

I can reduce the local light color washing effect by making the specular map a lot darker, but then the shine in sunlight is almost unnoticeable - depending on the Windlight settings.

Link to comment
Share on other sites

oh ok, as i suspected i misunderstood what you said about white map. It was looking really weird to me someone wants to make such map all white. So, sorry for my mistake.

so indeed, the glossiness is higher than 17. mine is around 50, not 100. Enough for making look my fabric as vinyl one under really shiny light, and looks silk under less shiny light. it really depend the windlight setting, the position of the sun and of course local lights. but i never experienced such problem than yours. At the very least, my fabrics can look with no shinyness at all, or will look like vinyl fabric. and if i adjust really well my WL they will look like silk or satin most of the time. So it can vary from silk till vinyl and this is what im looking for, so as long as it keeps in that range, its fine for me.

I think you are right, if i remember well, if i turn the glossiness under 50 it can turn white under local lights. 

So this is why i do my specular maps the most dark i can and i can keep the 50 for glossiness. Not all my dresses have this vinyl look, i have some really less shiny.

The more it will be dark the less you ll have shinyness.. and it can happen, i just add a normal map but not specular, if there is no purpose at all for any shinyness in RL.


Coby Foden wrote:


But as the pants are not made of metal, nor silk, nor plastic, I keep the glossiness value low which gives the realistic subtle shine for cloth in sunlight.

 

my suggestion would be the contrary. keep the glossiness around 50 but make your map the more dark possible and see what it gives.

Anyway, you cant control what setting ppl will use on their viewer, neither what WL and if they choose to hide or not the local lights. So the perfect solution that will work with all the possible configurations does not exist, im afraid :(

However, i would be really really glad to see more and more designers creating clothings with materials. Because, really, for photos, they are awesome.

Link to comment
Share on other sites

Hey again! Sorry If I am being so boring math-scientific in this specular issue, that is just the way I try to solve problems... :)

Personally I do not know much about math behind the specular calculations, but I tried to simplify the problem we are talking here. Maybe there is someone who could explain us what is happening here when specular glossiness is low (about below 50 as you both mentioned). ?

As far as I understand, the final color is achieved by adding specular map value to the diffuse map value. I think after diffuse color is tinted with scene lights. So if diffuse color is red <1.0, 0.0, 0.0> and specular map gives gray <0.5, 0.5, 0.5>, the result is pink kind of color <1.0, 0.5, 0.5>

Tho, I am not sure how the glossiness parameter affects this, because inworld a high glossiness will turn the result strongly towards white (or the light bulb color to be exact).

Then there is also specular color tint in SL specular settings. I guess this is multiplied with the specular. Tho I have no idea is it multiplied with specular texture or with the final effect...

I made some extremely simplified tests inworld with a sphere that has also a simple normal map. What I do not understand is that when specular glossiness is low, the default sunlight and a white local light give quite different result. I took a default SL lightning as a test environment, because I think majority of customers are using that.

When dealing with clothes, there is not much to do when trying to make things look good in every possible windlight setting. People wear their clothes just in any environment. But I think the problem that should be solved is the very strong local light effect on low glossiness specular - as mentioned earlier.

So, first image is a setup with diffuse red <1.0, 0.0, 0.0>, glossiness 15, pure white specular map. As a calculation red+white is white <1.0, 1.0, 1.0>. I understood that both local and sunlight should give same white specular. But they do not. Only local light gives the white specular. This is what I have been thinking practically as "sunlight does not have enough power on specular effect due to its directionality". Also mentioned this in earlier post.

Snapshot_003.png

In the second image specular is changed to exactly same color as diffuse. So the specular should be red, red+red is still red <1.0, 0.0, 0.0>. Now both sun and local light look same.

Snapshot_004.png

In the third image, specular is pink <1.0, 0.5, 0.5>. So specular reflection should be red+pink, that is still pink <1.0, 0.5, 0,5>. Well, local light gives pink specular, but sun light still stubbornly stays red.

Snapshot_002.png

Finally I added environment reflection, whitch I have been using in some metallic objects. This gives more bright specular in sunlight, whitch cannot be achieved using only glossiness. Well, this requires some spec map alpha channel tweaks to make it look good. But this last image is about what I would expect the first image would look like.

Snapshot_001.png

So..umh..yeah. Is it possible the sun color has something to do with this, or maybe the ambient color? Sun color is more like very dark blue if I check it from the environmental editor.

  • Like 1
Link to comment
Share on other sites


Trinity Yazimoto wrote:

oh ok, as i suspected i misunderstood what you said about white map. It was looking really weird to me someone wants to make such map all white. So, sorry for my mistake.

No problem at all Trinity.  :smileyhappy:


Trinity Yazimoto wrote:

I think you are right, if i remember well, if i turn the glossiness under 50 it can turn white under local lights. 

So this is why i do my specular maps the most dark i can and i can keep the 50 for glossiness. Not all my dresses have this vinyl look, i have some really less shiny.

The more it will be dark the less you ll have shinyness.. and it can happen, i just add a normal map but not specular, if there is no purpose at all for any shinyness in RL.

... keep the glossiness around 50 but make your map the more dark possible and see what it gives.

Yes, you're right. When the glossiness value is low then the local light's color washing out effect happens. Indeed one can reduce that color washing out effect to some degree by making the specular map darker. It has the bad side effect though that then the specularity in sunlight diminishes quite a lot.

 

What mystifies me still is that why local lights and sunlight are different concerning specularity. Local light acts like painting the specularity with white, sunlight does not paint the specularity with white. Strange.

Link to comment
Share on other sites


Jake Koronikov wrote:

Hey again! Sorry If I am being so boring math-scientific in this specular issue, that is just the way I try to solve problems...
:)

Thanks Jake, that was interesting experiment, not boring at all. :smileyhappy:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3632 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...