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:
That’s a PBR material and you need to add a light probe for metallic/roughness to work properly.
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.
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);
Like, I don’t know if the removeLight() is specifically necessary but I always cut-paste it so I wouldn’t know for sure.
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
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?
Some people don’t like chocolate, either. I haven’t run the SDK in 6+ years.
June 7, 2020, 5:04pm
This is the part that my code lets you avoid:
//loadModel("Models/gltf/BrainStem/BrainStem.gltf", new Vector3f(0, -1, 0), 1f); //loadModel("Models/gltf/Jaime/Jaime.gltf", new Vector3f(0, -1, 0), 1f); // loadModel("Models/gltf/GiantWorm/GiantWorm.gltf", new Vector3f(0, -1, 0), 1f); //loadModel("Models/gltf/RiggedFigure/WalkingLady.gltf", new Vector3f(0, -0.f, 0), 1f); //loadModel("Models/gltf/Monster/Monster.gltf", Vector3f.ZERO, 0.03f); // loadModel("Models/gltf/corset/Corset.gltf", new Vector3f(0, -1, 0), 20f); // loadModel("Models/gltf/boxInter/BoxInterleaved.gltf", new Vector3f(0, 0, 0), 1f); probeNode.attachChild(assets.get(0)); // setMorphTarget(morphIndex); ChaseCameraAppState chaseCam = new ChaseCameraAppState(); chaseCam.setTarget(probeNode); getStateManager().attach(chaseCam); chaseCam.setInvertHorizontalAxis(true); chaseCam.setInvertVerticalAxis(true); chaseCam.setZoomSpeed(0.5f); chaseCam.setMinVerticalRotation(-FastMath.HALF_PI);
…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.
Thanks a lot guys!
It looks much better now and I have learned something new…
June 8, 2020, 8:11pm
Not sure you mean for floor material to look metallic but check out metalness and dielectric in the docks.
June 8, 2020, 10:22pm
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.
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