my problem is terrain changing color to bright green when light probe is generated and ONLY when texture painting was done. (third video is issue)
in HALF of videos time is generating light probe
No texture painting done, light probe WAS loaded(ok) (here is use alphamap green for one texture): 2019 01 23 13 30 49 - YouTube
Texture painting done, no light probe loaded (ok) (here is use alphamap black for no texture): 2019 01 23 13 24 35 - YouTube
Texture painting done, light probe WAS loaded (issue) (here is use alphamap black for no texture): 2019 01 23 13 27 05 - YouTube
the only changes between videos was alphamap / loading probe / doing texture change.
Even when i use black alphamap and one time paint all map, then light probe issue appear too.
(any texture paint lead to problem)
to do texture change im using SDK files (with removed sdk related code, just to use in game):
as see in third video, light probe generate proper texture, after second generation texture also have green ground
The default terrain material shouldn’t even be affected by light probes. There was such a bug some time ago though, so what jme version are you using? Also make sure you have gamma correction enabled.
here can see its definetly about lightProbe. when i set 20 meters distance, nothing other is affected.
but why this happen only if i just paint terrain? its really odd. like some trash memory in some objects/classes. Even if it would be Texture class or something about this, then terrain is not PBR so why affected by it.
and this is what i receive if i paint All map single time (single paintTexture method usage)
The light probe auto generates an environment map and uses it for reflection, so when you generate your light probe you should only supply the things you want to reflect.
You should be able to supply it with a child node instead of the whole root node to stop it reflecting the ground.
I should also note that if you don’t use gamma correction, things will probably appear “washed out” or overly white - a bit like a tv with brightness too high. The blacks will appear as though they are dark grey and vibrancy will be lost.
Not the filter. As @jayfella said, I fixed my issue by checking the checkbox for gamma correction in the display settings popup. I also had some issue with PBR when I didn’t have gamma correction enabled in later projects, so might just want to leave gamma correction enabled in order to avoid future problems.
Watched the videos and what is going on seems quite strange. Almost if the probe renderer got a different looking material for the terrain. What material definition/shader is your terrain using and how are you painting the terrain from black to the dirt textured color?
It’s most likely a race condition (hence the random behaviour) since the light probe is threaded, its uncertain when it takes its “snapshot” of the scene to generate its env map.
You can alleviate this by either adding your terrain on the completed event of the lightprobe or just not giving the lightprobe the terrain to begin with.
not sure what is the issue, but certainly there is some.
Anyway i made workarround, you suggested before to add lightProbe to other node, but before i tried and moved all to objectNode thats why it was not working for me. When i move just lightprobe itself and not touch makeProbe method node, then its fine.
public void updateLightProbe(Vector3f vector) {
environmentCamera.setPosition(vector);
final LightProbe lastLightProbe = lightProbe;
lightProbe = LightProbeFactory.makeProbe(environmentCamera, rootNode, new JobProgressAdapter<LightProbe>() {
@Override
public void done(LightProbe result) {
Node tex = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(result.getPrefilteredEnvMap(), assetManager);
if(lastLightProbe != null){
objectsNode.removeLight(lastLightProbe);
}
((BoundingSphere) lightProbe.getBounds()).setRadius(100);
objectsNode.addLight(lightProbe);
}
});
}
Anyway IMO issue still exist, because light source should not change its “bright/color” when texturing terrain and when light probe is in same node as terrain.
@nehon do you maybe know why Painting on terrain make light probe light change its light? (when painting all terrain with one texture give same result in texture like using just alphamap with one color - and both cases are different in probe light)
in short, each paint(even if no change in texture itself) change lightprobe intensity/color