Imported model keeps dark

Hello again :slight_smile:
Im going through the Beginner Tutorials and i tried to load a model from Fuse.
Everything works fine except that the model keeps dark even with added DirectionalLight…

The Ninja from jme3-testdata works fine :thinking:

Here is my imported model

And here is how it looks in the scene right now …

 Spatial ol = assetManager.loadModel("Models/Old_lady/old_lady.obj");
 ol.scale(0.05f, 0.05f, 0.05f);
 ol.rotate(0.0f, -3.0f, 0.0f);
 ol.setLocalTranslation(0.0f, -5.0f, 2.0f);
 rootNode.attachChild(ol);
 // must add a light to make the model visible !
 DirectionalLight sun = new DirectionalLight();
 sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
 rootNode.addLight(sun);

With the converted j3o model it’s the same.
Im not sure what to do ^^

The j3o that looked ok in the SDK when imported? That’s strange.

When importing it in the SDK, there is a way to generate a j3m (material file). That .j3m may provide some more clues.

Well thats what i have in the SDK

Maybe my setup is just wrong ?
I mean the model seems good to me and the j3o converter wants the texture files in the same folder so i guess it’s right ? :thinking:

Thats the whole code i have

Are there any warnings printed to the console when you open the j3o in your application?

I haven’t used the SDK in probably 10 years but I know there used to be a way to generate the j3m files for the materials… either during the import process or from the j3o itself. These would have the material parameters (colors, textures, etc.) in it and would make it easier to confirm what’s really happening.

Hopefully someone more familiar with the SDK can chime in.

The code looks ok to me at a glance.

1 Like

I used the “Import Model” Button in the SDK now but still the same result :expressionless:

I dont get it why the model is looking good in the SceneComposer but didnt get any light in the Scene :man_shrugging:
I mean im new to jMonkey so i guess its normal thjat i have no clue but it seems strange to me :joy:

Here is the Link to the model im using

If you are using PBR (which it appears that you are) then you also need to add a LightProbe to your scene in order to simulate the indirect lighting

But I think there is also another issue going on at the same time, considering the fact that your model still renders entirely black even with a Directional Light.

I agree that it is probably a material issue that will require using the SDK to generate material files so you can inspect them:

To generate a material in the SDK, you just need to select a Geometry and then go to the properties panel on the right and find this drop down where you can select “generate j3m file” :

I circled 4 key areas in the SDK to highlight the important things to note:

  1. on the far right, you can see where the “generate j3m file” option should show up when you have selected a Geoemtry
  2. On the bottom left, I circled the geometry that I have selected. It is important that you have selected the geometry (not the parent nodes) in order for the generate material option to show up.
  3. At the top of the scene editor, I circled the button for turning on the DirectionaLight as well as the button for applying a LightProbe. For PBR to render properly, you want to use both a directional light and a light probe to simulate direct and indirect light, and you will notice some subtle (or not so subtle) rendering issues if either one is missing or configured improperly.

So once you’ve generated a .j3m material, it will show up in the material/generated folder, and then you can open it and copy/paste the text back here. Then we should be able to spot what is wrong with the material file.

3 Likes

Alright so i created all materials.
Here is my Body Material Source

This is the Editor

1 Like

So it looks like I was incorrect to assume that the model is using PBRLighting.j3md

It looks like you are using the older Lighting.j3md shader, which I personally have not used in a while.

(I would reccommend PBRLighting for most projects, since pbr is capable of producing better visual results and gives you more control over your lighting and materials, but it is ultimately your choice which shader to use for your project)

But after looking at your current material file, I do see that your AmbientColor has a value of
0.0 0.0 0.0 1.0 (black) which would be effectively turning off the ambient light. I am not certain if that would be affecting the DrectionalLight though, its been a while since I looked at the shader code for Lighting.j3md.

But I would still try giving the AmbientColor a value of 1.0 1.0 1.0 1.0 and see if that fixes it.

1 Like

Well i was just following the Beginner Tutorials and simply tried out the Asset section with my own model, that’s all i wanted :joy:

So i changed Ambient Color and tried Diffuse

But the result is still the same :thinking:

I need to go to bed now, its 02:42 here but thx alot for your help :raised_hands:
Maybe i can figure it out later :v:

1 Like

I DO use lighting all the time and rarely use PBR. What you are trying to do SHOULD be easy. So rest assured you do not need to switch to fancier materials or anything.

A black ambient is also totally fine.

The weirdest part to me is that it works in the scene explorer but not in the application.

As long as you have a white directional light and a properly setup material then things should work. I guess unless you have some code somewhere that is corrupting the ColorRGBA.White “constant”.

You could try explicitly giving your DirectionalLight a color “just in case” it either requires that for some reason or your ColorRGBA.White has somehow turned black.

…

BTW, you can post code directly in the forum instead of taking screen shots of it:

I think i will make a new project and try it again. Maybe something is just not working properly in the background :man_shrugging:

But first i will try the ColorRGBA tip :+1:

Seems like it has something to do with the material setup.
I switched from Lighning to ColoredTexture and then back to Lightning and now the whole texture is broken but the hands get some results :thinking:

and thats what i get in SceneComposer now

Alright the normal maps are broken !
Deleting them fixes it. I guess i have to flip the normal maps when i export them from Fuse.

Ok seems like the Engine don like the Normal Maps from Fuse.

Also make sure you generate tangents.

Normal maps don’t work unless the mesh has a tangent buffer.

1 Like

Just curious, would you mind posting what the normal map looks like?

You can download the model im using with all Texture Maps here

Ah, thank you. I missed that you’d already posted it.