I need help with adding "full bright" to my first person game

So, I am trying to add a “full bright” system to my game. I have tried adding an ambient light and the sun light from the wiki, but I have a city model and random places are dark, so I need to remove shadows or have everywhere have light. A little like Minecraft full bright if you know what that is. I have looked all over online and there seems to be nothing. I am pretty new to Jmonkey so any help is welcome!

Minecraftstyle lighting is prebaked. I.e. it is calculated ahead of time (in minecrafts case whenever a block changes) and then its baked into the geometry itself. This is completely othogonal to adding light sources etc.

If your ambient light source isnt working it could just be a lack of a light probe, depending on what type of lighting you are using?

Both types of lighting work fine in jmonkey but its worth being sure which one you want.

If you literally want everything at 100% brightness thats also possible, just use the unshaded material; no shadows no light. But that is not minecraft style lighting and will look very flat (and probably not very good)

Welcome :wink:

Ye, minecraft use little different system as i know, it is “flood light”. JME blocky engines/games use it as i know.

Well we do not see Code and do not see result, so cant tell.

I can only tell it works for me. Maybe you use PBR model without probe or maybe you put ambient light incorrectly. Without more information, cant tell. If possible, please provide more information.

You can try adding a light probe to the scene:

EnvironmentCamera envCam = new EnvironmentCamera();
stateManager.attach(envCam);
...
envCam.setPosition(new Vector3f(0f, 0f, 0f));
envCam.setBackGroundColor(ColorRGBA.White);
LightProbeFactory.makeProbe(envCam, rootNode, new JobProgressAdapter<>() {
    @Override
    public void done(LightProbe result) {
        result.getArea().setRadius(100f);
        rootNode.addLight(result);
    }
});

Or you can use a prebuilt probe (thumbnails), which will be much faster than rendering one at runtime.

PBR materials require the presence of a light probe in order to incorporate ambient light. If you are using PBR, that would be why the ambient light seemed to have no effect when you added it.

Another solution is to use Unshaded.j3md (no lighting) or Lighting.j3md (lighting, but less control).

2 Likes

Here are some screenshots of the city. I will try adding a light probe next

If you want minecraft style lighting. I do it, I altered the shader to support a “TexCoord8” variable and inside the vertex buffer I load the predefine basic ambient lighting, 0 (no light) - 15 (white). Then inside the shader grab that variable and adjust the color brightness of the texture. Then I allow it to continue with the shader so torches, sun light and etc. can also adjust the lighting on the texture.

I have a ton of torches, like minecraft. So I use this to prevent limitations of using hundreds of torches on the dungeons.

I then just update them when needed.

But again, it is minecraft style lighting. You want to need that style.

Ok thank you

but i still do not see how its related to Minecraft lighting.

What i see is normal Scene model, without any Voxels(blocks)

About model, if you use PBR, it will be black without lightprobe, but DirectionalLight should lit it even without probe as i remember. AmbientLight not since it just adjust intensity for PBR models.

So i would like to ask What material are this Black Buildings?

3 Likes

I have the entire model as 1 gltf file exported from blender. I don’t know if this is a problem or not as I am very new to Jmonkey. I was trying to get it like the format that the beginners guides show the town as, but I could not figure that out. I do not have the model assigned to a material. I forgot to add at the start, I tried assigning it an unshaded material but that did nothing. As for the Minecraft lighting, I was just using that as an example of the kind of lighting I am hoping to get.

Edit:
Here is the code I am using for the terrain and lighting:
Terrain:

Spatial sceneModel = assetManager.loadModel("Scenes/City/city.gltf");
        sceneModel.setLocalScale(20f);
        CollisionShape sceneShape = CollisionShapeFactory.createMeshShape(sceneModel);
        RigidBodyControl landscape = new RigidBodyControl(sceneShape, 0);
        sceneModel.addControl(landscape);
        rootNode.attachChild(sceneModel);
        bulletAppState.getPhysicsSpace().add(landscape);

Lighting:

       DirectionalLight sun = new DirectionalLight();
        sun.setColor(ColorRGBA.White);
        sun.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
        rootNode.addLight(sun);

Then you didn’t do it correctly. Unfortunately, we have not been shown that code and so cannot correct it for you.

Changing the material would definitely change things.

Fact: PBR requires a light probe or it will look like donkey-poop.

Any conversation mentioning minecraft lighting, probably does not want PBR.

…so you will definitely want to figure out how to correctly switch materials.

Hint: it requires using a scene traverser over every Geometry and switching its material, potentially copying over material parameters in the process.

Edit: I’m also guessing that most readers here don’t know what “full bright” means.

1 Like

Hi, Even if you load model as single GLTF file, it still load Multiple Geometries per each Material in Blender.

And each Geometry can have different material in JME too, so you just need pick correct Geometry and change material.

Please note GLTF always load as PBR as i remember, so if you want setup different material type, you need override it manually or via SDK Scene Composer per Geometry and then resave .j3o.

If you load directly .gltf into game, then you need do it in code (search for corrent Geometry in Model)
https://wiki.jmonkeyengine.org/tutorials/scenegraph/assets/fallback/index.html

this link might help you understand what you got when load big model like this.

There is Scene and got many Geometries.