JME 3 PBR problems

Recently I found some totally incorrect shading, while playing with JME 3 PBR.

So, here it is:

Specular is totally fancy…It seems to be incorrectly mapped:

Here is the same shot from Blender 3d PBR build:

Problems are also in diffuse shading:
Looks like Subsurf scattering shading :grin:

What can cause this type of problems?

Problems appear super clear while using studio HDR:

So many things…
It could help to have a test case.
Also I never used blender PBR as a reference, so there might discrepencies whatever you do.
I used unreal engine papers for the PBR shader and I use substance painter as a reference.
Note that there are plenty BRDFs you can use for PBR.
PBR is just a technique, it’s not as with phong lighting whereyou’ll have the same result everywhere. If blender doesn’t use the same brdf as we do, then it won’t look the same.
Also this wrong shading could very well be the same issue as the tangent issue and not related at all with the PBR shader.
What if you remove the normal map?

It is just a matter of testing :slight_smile:
To build PBR scene in blender less painful than building it in Ue4, unity or even substance…load model, load environment…you are done.

Nothing changes when I remove normal maps and live model as it is.

Light also have some wierd behaivour:

Looks like background instead of being infinitive has “limited coordinates”.

I have made testing scene. I dont really know will it be, or not, helpful but I belive there is all types of complex and simple models. HERE, IN DROPBOX

p.s. Blender PBR did really good job, it is looks really similar to Substance, even though blender uses only gloss workflow.

(cycles just for comparason)

JME unfortunetly faild, I can not create PBR test, because everything is black

But directional light working as predicted

Do you use gamma correction? How do you create your LightProbe?
I need to see your code, I can’t do much with pictures.

edit : also the limited area effect is probably because the radius of your light probe is too small, bump it up

You can checkout and run SSEditor with Debug

environmentCamera = new EnvironmentCamera(64, new Vector3f(0, 0, 0));
lightProbe = LightProbeFactory.makeProbe(getEnvironmentCamera(), rootNode, EMPTY_JOB_ADAPTER);

What about that ?

How can I change that radius?

the light probe has a boundig sphere as influence zone. This bounding sphere has a radius :

((BoundingSphere) lightProbe.getBounds()).setRadius(whatever);

Defautl radius is 1 wich is kind of small, reflection and diffuse is offset according to this radius. Set it to 100 and you should be able to haev something similar to substance witht his studio env map.

1 Like

It is works. Thanks. Why do you use the default radius is 1? Why don’t you provide API for change this?

Maybe it is because JME developers are not Caesar with Shiva hands :wink:
I mean, it is hard to do several tasks simultaneously if you are not Caesar. :smile:

But now, here we are pointing at this problem and they will fix it at any time when they are free.

Work in progress remember ?
Also at some point I want BoundingBoxes supported for LightProbe too, and the radius won’t have any meaning for a bounding box.
So the Api will aways be on the boundingVolume and not on the lightProbe directly.

EDIT : Though radius 1 is a bit low I agree :p.
The idea is that you are able to use several LightProbes in a scene with difference area of influence, and the shader will be able to fade between them. For now it only switch to the closest lightProbe, wich produce some flickering.

So just so I know. Do you have consistant lighting now?

WOW, it is awesome! Everything works perfectly, спасибо!


Kewl :wink:

btw how to set up custom exposure and gamma?

You can’t.
For exposure, I’ve been thinking about it, I’m tempted to control the exposure through the AmbientLight, even if it’s not related to the shading model. But it’s not implemented.

For gamma correction we use pure ogl hardware gamma correction, and there is no way to set custom gamma. However users can configure this on the hardware level throught vendor software for harware management.

Oh, I see. Thanks anyway :smiley:
So… I guess this case can be closed as “solved”, or leave it for next troubles and misunderstandings related to PBR in JME?

Isn’t controlling exposure implies using HDR? Then you can use ToneMapFilter to control the exposure.

Oh, I thought it was the exposure of the env map for lighting, not the resultign image exposure.

Huh, working, exposure, nice!