[SOLVED] Big Color Difference When Rendering a Model In JME

Hi Guys,
When I’m rendering models in JME they look totally different in color comparing to the originals rendered in sketchfab.com (see below sample video).
I guess it has something to do with lights but I’m not sure what needs to be done. I want to achieve the same results or close enough.

What do you think?

The test model was downloaded from:

Thank you.

1 Like

That’s a PBR material and you need to add a light probe for metallic/roughness to work properly.

1 Like

And if you want to find a similar environment texture for your probe, it looks like the sketchfab view is using some type of ship environment texture:

How do I add this “light probe”? it is in the documentation? I’m using regular “sun” light

Light probes are generated from an environment. There’s one in JME test data called defaultprobe or you can generate one yourself using LightProbeFactory.

I’m on my phone and I can’t provide code because my screen is cracked and it randomly goes nuts. Not to mention the discourse editor being terrible on mobile.

1 Like

You can find some prebuilt default light probes here:

I find that there is a special juggling that has to happen for a general scene… but it could be just lore I’ve picked up. I don’t know if it’s the only way but it’s the one that I use:

        Spatial probeHolder = assetManager.loadModel("Probes/Sky_Cloudy.j3o");
        LightProbe probe = (LightProbe)probeHolder.getLocalLightList().get(0);
        probe.setPosition(Vector3f.ZERO);
        probeHolder.removeLight(probe);
        rootNode.addLight(probe);

Like, I don’t know if the removeLight() is specifically necessary but I always cut-paste it so I wouldn’t know for sure. :slight_smile:

Edit: and Nehon was nice enough to create thumbnail images for those when he added them to Spix… can see them here to preview: Spix/proto/src/main/resources/probeThumbs at MaterialEditor · Simsilica/Spix · GitHub

3 Likes

Sdk editor, right-click to add optical probe. . . Don’t do scene scenery work in code, write scene layout in code, light is not a good workflow. .

I’m not using the SDK at all…
Why adding light in code is not good?

It’s fine.

Some people don’t like chocolate, either. I haven’t run the SDK in 6+ years.

1 Like

This is the part that my code lets you avoid:

…with my code you can get PBR ambient light even for stuff added directly to the root node. Convenient when your scene code is stretched across app states.

It’s OK. I just give a suggestion. It’s like making models should be done in modeling tools instead of using code. It doesn’t matter if you really like to use code for all processes. I’m just making a suggestion.

1 Like

Thanks a lot guys!
It looks much better now and I have learned something new…

3 Likes

Great job.

Not sure you mean for floor material to look metallic but check out metalness and dielectric in the docks.

https://wiki.jmonkeyengine.org/jme3/advanced/pbr_part1.html

1 Like

I think he got it from sketchfab that way. The original was strange, too, and I assume he didn’t make it but just downloaded it. Could be wrong, though.

1 Like

Yes. Downloaded and used it as is. BTW I think the model itself doesn’t appear like the original some parts of it are in the wrong place but this is for another thread