Jump to content
Sign in to follow this  
Kennylex Luckless

Specular Gloss PBR and the enviroment

Recommended Posts

I did download Substance Painter 2.0 (demo) to make Specular-Gloss materials for Second Life, the program produce a Diffuse map that is black where reflective or metallic colors are located so the colors from the specular map shall be visible, the material look great in Substance painter, but in Second Life the material look black in those areas, until you create a light source near, then you start to see the texture as you do in Substance Painter.

The same happen in Substance Painter if I select a black environment map that do not reflect anything, so not do I vonder is SL are missing environment maps and if it is possible for Linden Lab to make so the Windlight settings can have different environment maps?

It is hard to explain for me that has English as third language and not can all the technical terms, but I still hope some do understand what I'm talking about :-)

Share this post


Link to post
Share on other sites

As far as I know there are no uses for diffuse maps in SL. The texture pane takes SPECULAR (light reflecting) and NORMAL (bumps) maps.

 

I doubt that Linden Lab will change Windlight to support one program, but this is a resident forum so they don't typically read comments here execpt in the technical (server) areas.

 

You can make specular maps with Shader Map 2 or Crazy Bump and I believe there is a plug in for Photoshop that is free. Not all software makes things good for our world here.

Share this post


Link to post
Share on other sites

Well, the color map is called Diffuse map. It's what we apply as a texture to any surface since forever.
A specular map doesn't require any special programs, or plugins also. You can just paint/create them in any image editor just like you paint/create the diffuse color map. The spec map can be colored as well.

Same with the gloss map, nothing special with that, too. It will be encoded in grayscale only by the shader, so it doesn't need any colors.

The usual manual way to create these maps is to copy the layered Diffuse map, and edit each layer accordingly for its purposes. Inverting colors, lighten, darken, remove AO, lighten edges etc..

  • Like 1

Share this post


Link to post
Share on other sites

You might try reading the following wiki pages, which together try explain the SL advanced lighting rendering system...

Second_Life's_light_model_for_materials
Alpha_Modes_Do's_and_Don'ts
Material_Data

Then play around with a cube and a sphere using all the maps and settings to get a complete understanding of how they interact. There may be useful correspondences between maps generated by substance painter and those used by SL, despite the fact that they aren't exact equivalents. Sometimes you will have to invert of otherwise edit alpha channels separately, and maybe RGBs too.

I once spent several days trying to make a set of Blender cycles PBR renderer nodes to use a set of maps made for SL to give the identical effect in Blender as in SL. In the end I had to give up.

  • Like 1

Share this post


Link to post
Share on other sites

I am using Substance Designer to make materials that I am using in Blender but also in Second Life, Substance designer are made so it can make and export materials for the most common shaders, so I am not talking about make SL compatible with this program rather to get a feature that I see in this application and other games.

It will be hard for me to describe this in some few lines just for the complexity of the subject and for all seems has different ideas what materials are and how they shall work in Second Life, so I will only talk about what I can observe and what I miss in Second Life based on those observations.

Substance Designer 2 can work with pbr-spec-gloss to generate texture maps for programs that use Specular-Gloss like Second Life does, and you can use this program to make materials with OpenGL normals that look good in Second Life, but the problem come when you start to make specular or reflective/metallic objects.

When I make a metal object in Substance Designer that are 100 % reflective I can see an environment map reflected in the metal that give the metal that very good look, in Second Life when I turn up the “Environment” to 100 % the object just look black, like it has no environment whatsoever, even if I change the windlight it remain black with just different color tint near the hot spot.

If I now use a specular map in Substance Painter I can change the specular colors of the light reflecting back from the environment, but if I load a specular map onto the object in Second Life nothing happens, it still just look black for there is no light casted from the environment, like it lack a environment, it not before I make a light source in Second Life I start to see the specular colors.

So my question was if SL could get environment maps, like bitmaps that can make up the reflection in a object instead of the dark gredient that it look like SL has today.

When you test this you will see the specular colors as best if the glossiness is sat very low, between 1 and 5, just remember that 0 = disable gloss.

With the older Substance Painter that did use Metall-Rough to make material I did export textures for SL like this:

“Base color” as Diffuse map (no alpha)

“Converted Specular” as specular with “Roughness grayscale” as alpha.

“Converted Normal OpenGL” as normal map with “Metallic grayscale”. as alpha (exponent)


This did worked okay but still needed extra light sources in SL to be able to see the specular colors.

Share this post


Link to post
Share on other sites

I has read those pages, but I may be too stupid to understand them, or it is again so that something are missing or not correct. Like when the Wiki Do and don't say "Lower values (such as black) result in a “wider” specular highlight", but a black (100 %) color do disable the specular and shall be used on material that absorb light or in shadow areas that always shall remain dark, like on the inside of a hat the avatar shall use, the Do and Don´t articles also talk about environment but do not say that the SL environment (even in midday) do not bring out the specular colors:
“The specular map’s alpha has the ability to “mask” parts of the surface’s sky reflectance. This is especially important for materials where only parts of the surface may actually reflect the sky”

But as I did say so has Second Life no real environment map/sky that can be reflected, those parts will just look black or dark, it is just the “control over how much of the environment is reflected” when I can not see any reflected environment in Second Life that has made it hard for me to use any 3rd party program to create good materials for SL.

Btw, thank you for the links, even it sound like I think they are bad, it is things that has helped me alot and that all creators should read.

Share this post


Link to post
Share on other sites

I have to agree that those wiki pages are not as clear as they might be. Reading both your answers, I think some of your problems with the SL lighting is because of the differences in SL between specular reflection and the very simplified environmental lighting. I will try to explain how these seem to work, at least as far as I understand them.

Environmental reflection is very simplified. The environmental light map (in effect - I don't know if it exists as such at all) takes account only of the sun/moon and the sky. It ignores other light sources, and it ignores secondary reflections and shadowing. It's also very fuzzy. So it is completely incapable of providing the sort of reflection detail I think you are looking for from metallic surfaces. This is indeed a severe limitation on attempts to make things look metallic, or otherwise polished. Also, it is not affected at all by the proper specular parameters - not by the specular map, the "glossiness" (specular exponent). The colour is that of the incident light. The intensity is determined by the environmental map (the alpha channel of the specular map) multiplied by the environment parameter. The reflected light replaces the diffuse reflection to that extent. So with parameter 255 and white map (also 255), there is no diffuse reflection left. This should be a chrome-like effect, but because of the lacking detail, it is a very poor one.

The specular reflection is more like what one would expect. It's colour and intensity are controlled by the RGB channels of the specular map and/or the specular colour. The sharpness of the reflection (specular exponent, defining extent of scattering of light around the reflection angle) is controlled by the map in the alpha channel of the normal map, combined with the glossiness parameter. If these are black and/or zero, there is no specular reflection at all. Then at 1, there is a very widely scattered, but low intensity reflection, As the values increase, the reflection gets brighter, but restricted to narrower angles around the perfect reflection from light source to camera. Unlike the environmental reflection, the specular reflection is added to the diffuse reflection. It does not replace it.

People are often very unsatisfied with the results from the SL specular reflection, and your comment that you only see it with added local lighting is often repeated. However, I think these impressions are not the result of anything wrong with the reflections themselves, but rather problems with other aspects of the system.

First, there is no contribution at all to the specular reflection from what you would expect from an environmental light map and no secondary reflection. So what you get is only direct reflection from the sun or moon, which are effectively point sources. Unless you use very low settings for the "glossiness" this means there are very few surfaces where both sun and camera angles are near enough to give visible highlights, and the results are unrealistic. Local lights give more satisfactory effects simply by increasing the amount of specular highlights visible bacause you can set them to optimal angles. Also, because they are closer, they can illuminate an object over a wider range of angles.

Secondly, many objects in SL have perfectly sharp edges, legacy prims for simplicity and mesh because creators want to minimise geometry. A perfectly sharp corner is, of course, very unrealistic. It will never give any specular highlight at all. I think this is largely responsible for people's impression that SL specular reflection doesn't work  in sunlight. With mesh, this failing can be counteracted by using extra geometry and edited normals. You can find some examples in some of my recent posts which give realistic highlights in SL with no local lights. For legacy prims, the effect of extra geometry can be approximated with normal maps ( which can do the same for mesh too), although that is hard work. Simple rough normal maps highly repeated can also increase the amount of specular reflection visible from any particular camera angle.

Because the use of the alpha channels of the normal and specular maps in SL is non-standard, you usually have to use channel editing to get the right data in the right places when you generate the maps in other software. Only if the software allows exact specification of what data goes in what channel will iot be able to generate SL-compatible maps directly.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for a great answer, I start to think I am a bit to use to see Unity and other game engines that work well together with Substance Designer, and just hope that SL one day will get a better environment system (or what to call it), I also need to say that material made with Substance Designer do look good in Second Life if you use Metal-Roughness and tinker a bit with the export settings.



Share this post


Link to post
Share on other sites

The Second Life viewers utililize the Blinn/Phong lighting model to handle their scene rendering. You are trying to use Substance's Physical Based Rendering materials in SL's old material pipeline. You will need to tell the program to generate older maps for sl. Specifically Diffuse, Specular, and Normal maps. I only use Substance Painter for PBR texturing but when I needed to export to SL I had to setup a custom export option to accomplish this task. Here is a nice screenshot to show how that was accomplished.

Share this post


Link to post
Share on other sites

I read a good article on this recently. It explained where the alpha channel information is and what it effects.  I tried adding in photoshop but i noticed 3d coat had an output which included specular info in the alpha channel of the diffuse(texture)  here is a link to the article

http://nwn.blogs.com/nwn/2016/06/specular-maps-in-second-life-tutorial.html

 

Share this post


Link to post
Share on other sites
On 02 April 2016 at 10:54 PM, Kennylex Luckless said:

I did download Substance Painter 2.0 (demo) to make Specular-Gloss materials for Second Life, the program produce a Diffuse map that is black where reflective or metallic colors are located so the colors from the specular map shall be visible, the material look great in Substance painter, but in Second Life the material look black in those areas, until you create a light source near, then you start to see the texture as you do in Substance Painter.


 

Your problem is easy to explain...

Your assumption of how to create metallic surfaces is based on the way it was done in Poser 4 Pro Pack, over a dozen years ago by the artists at RuntimeDNA, namely a black diffuse with a 'metal' coloured reflection map. Problem is SL doesn't use custom reflection maps,

 

 

SL materials are closer to raytraced than that old old poser 3/poser 4 crud.

 

You have 4 parameters, first there's the specular map, simple enough, controls specular strength and colour, white =100%, black =0%, coloured = somewhere in between with a tint, this map is multiplied by the specular colour in the colour picker (spec param 4), the second parameter, 'spec'  is 'specular tightness', how tight the highlights are, default value of 51 is ideal for a black polythene garbage can, and thats about it. Parameter 4 is environmental reflection strength, determines the amount of prebuilt and unchangeable env reflection added to the surface. The correct way to do metals in SL materials is 1) the diffuse map/colour is the base appearance of your chosen metal, then 2) for the spec map/spec colour to contain a hint of the diffuse metallic colour.


 

Also, don't make your spec maps too dark, just remember the golden rule...   "Everything I learned about specular from RuntimeDNA/Daz3d/Poser 4/Daz Studio... Is completely wrong..."

 

Edited by Klytyna

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...