Spec and Shiny

That blurriness in that image isn’t confined to the geometry so you would have to use a post effect for that. As for adding it to the engine (whatever you mean exactly), pass over some code and we can test it and add it if its good. I’d suggest using shader nodes for that but they are not in the stable releases yet.

@Ogli said: Who is the right person to talk to? Who will commit this change, who decides if it will be made or not?
I guess that would be @Momoko_Fan or me. Considering the fact that we are "just about to release " (never been so close), for now we won't make any change to the lighting shader. It's very widely used and we don't want to break user code.

But, as Normen said, this will be done through shader nodes, one will be able to “plug in” features into the existing lighting pipeline.
But I get your point, actually, I’m not really satisfied with our lighting model, and i’d like to make something better for the future.
Something that would make artists and developers happy :wink:

<cite>@nehon said:</cite> Considering the fact that we are "just about to release " (never been so close), for now we won't make any change to the lighting shader. But, as Normen said, this will be done through shader nodes, one will be able to "plug in" features into the existing lighting pipeline.
Oh, I totally understand this. Make a stable release, and maybe I'm good enough at jME-speak for the next version. (Means, I'm not ready to help much just now). The plugin system sounds interesting.

Adding gloss maps in the alpha channel of the spec map like discussed above:
Yes, it is very simple to make, and artists use gloss maps, sometimes.
Just it would be good to consider this for some future version.
It might not be that much of a killer feature though :wink: so it can propably wait.

<cite>@normen said:</cite> That blurriness in that image isn't confined to the geometry so you would have to use a post effect for that. As for adding it to the engine (whatever you mean exactly), pass over some code and we can test it and add it if its good. I'd suggest using shader nodes for that but they are not in the stable releases yet.
Puh, how can I explain this better... I will try it: - see the image above as a texture (square shaped texture) - the texture contains six versions of a cube map, so it's really an atlas - cube maps are used for reflective materials - reflective materials are almost the same like specular materials - they reflect the environment (and hence all light sources, like the sun etc.) - for specular maps you have a shiny exponent (or gloss map, see discussion above) - the gloss map defines how sharp the reflections / specular highlights are - the six versions are six versions of differently sharp..blurry cubemaps - depending on the gloss map, the reflective material choses one of these cubemaps - it might even interpolate between two of these cubemaps for inbetween gloss values

I know, for me it sounds simple, but like you said:
Maybe I should write some shaders that show what I mean.
Currently I’m more occupied with game assets, few coding sessions lately.
Currently I’m studying jME3 all the general features to get a grasp of what’s there now.
So, excuse me if, for now, I just dropped these ideas here (the first one is easy, the second one is more complex).
:slight_smile:

I don’t think it would be necessary to add a new map for that but I’m looking forward to your code.

Hi

I don’t suppose this got implemented did it?

FWIW, the alpha-channel option would suit me fine.

I don’t think it was discussed how the gloss (shininess) parameter would/should be mapped to an unsigned byte. Shininess values well in excess of 255 are supported (and in my experience with JME, are required) for very shiny/wet materials.

Thanks

You may be misunderstanding what the shininess values are doing… presuming you are meaning the current material parameter. It only controls the relative size of the specular and not any kind of intensity. The usable range is actually smaller than will fit in a byte as I recall.

Hi

I know what it does and that it is unrelated to brightness/intensity :wink:

There is no (imposed) usable limit, and this material, for example

is using shininess = 850 to get a wet look (I occasionally use higher).

Barney

Hello barney,
what tool did you use to render this cobble stone floor?

Did you know that there is physically based rendering (PBR) which plays with such things as roughness/shininess?
Actually when this thread was made, jME people did not know about this upcoming AAA feature.
Currently, the core dev @nehon is working on PBR for jME.

Hi

We can create it even without PBR
You can create it with setting “Shininess” in “Lighting.j3m” material (in blender it takes values from 1 to 511. [for Phong material] ) and by adding a Normal map (and to get even more you can use Displacement map (Tessellation) .
This is a scene in JME 3.1 : Bump map + Displace map + Shininess = 50

Pretty Wet, isn’t it ? :stuck_out_tongue:

1 Like

Hi. It was rendered with JME3 (using steep parallax, specular map, normal map, fixed shininess = 850).

I don’t know anything about PBR, just resding a little about it, and though it sounds interesting, it doesn’t sound like a solution to having varying roughness on a single material, as in a gloss map.

Anyhow, I’ve implemented this now … there are only 3 files modified (Lighting.j3md, Lighting.frag, SPLighting.frag), and the changes are small.

The mapping from byte to shininess parameter is linear from 0 to 127 (mapped to range 0 to 64), and adds a cubic term for values 128 to 255, such that 255 maps to shininess 1024.

I’m happy of course to contribute these changes, if one of the core devs would be happy to approve and apply them?

Barney

1 Like

Well, nowhere near as wet as the example I posted with shininess 850! I would say your material looks like it rained 30 minutes ago, mine like it is still raining:) The point I was making is that high shininess values (>511) are perfectly valid from an artistic viewpoint.

1 Like

I’ve done quite a lot more reading about PBR (physically based rendering) now. It seems that gloss maps (or roughness maps, which are just inverted gloss maps) are extremely important in PBR, roughness being probably the single most important model input.

Another key point about shininess(/roughness) in PBR is that for realism you need to obey conservation of energy (i.e. cannot have more light emanating from a surface than falls on it), and an essential part of this is that the specular brightness must be lower where the shininess is lower.

This is something I had already independently observed from my experiments with using gloss maps in JME(!) So I had already added an option to modify specular brightness based on the gloss map - I was kinda doing PBR already :wink: (though I didn’t know I was, and the specular brightness modification I’m using is ad hoc, not from any actual theory of lighting).

Barney

In PBR you don’t have such problem because the shininess is computed by the shader if you use metal/rough pipeline and it will always obey to energy conservation, the case is different if you use specular/gloss pipeline.

Well, I was talking about changes in the shader - my shader changes modify specular brightness downwards where roughness is higher.

But I think you mean “specular brightness” where you say “shininess” above? Shininess is not computed in PBR as I understand it. It is the same as roughness (well… it is 1 - roughness if you transform them to [0, 1] range), a core input to the lighting model.

Barney

Ok, i probably misunderstood your post then.

Yes

In traditional Phong model rendering, it’s just the thickness/thinness of the lobe of reflection.
Seems to be the same in PBR - defines how widespread or focussed the reflected light will be.
Only difference is that PBR uses that energy preservation computation whereas the Phong model relies on the artist who sets the lights and the material parameters to “estimate” that energy preservation (or to deliberately generate “unlikely” effects).
I always found it weird that jME only had one float value for shininess and did not support a texture for shininess by default - it appeared unnatural to me that you couldn’t control such an important aspect of the Phong model per texel but only for the whole object.

You mean a specular map? JME has that.

    // Specular/gloss map
    Texture2D SpecularMap

Actually specular intensity and shininess are two different things.

As of jME 3.2 (master branch), there’s support for shininess map since PBR got merged.

3 Likes

No, we’re talking about gloss (roughness) maps. My offer to contribute my code stands!

Just noticed Momoko_Fan’s comment, seems it is now supported in 3.2. Great, and thanks.