Troubles with BlenderImporter again

Hey Guys,

I am currently having strange issues with the BlenderImporter again.
If I import the .blend file without packed resource files, I get promted to manually locate the .jpgs
(SideNote: In that Explorer, “Filter .jpeg files” should also show Folders)
While this works in the Importer, the generated .j3o file is unshaded (white).
If I manually add .j3m Files and try to set the Diffuse-Map, I only get the “average” color but not the actual texture.
[What do I do wrong here?]

When I use packed resources, everything works except from a logical issue I have:
I use setColor(“Ambient”, ColorRGBA.White); on every Geometry to enlight everything by AmbientLight (Like having the game unshaded?).

If I do that, all Untextured Materials become white instead of the Diffuse Color they should have.
Unfortunately I can’t use getColor() to check if it’s black → Set to White. (As getColor does not exist)

I guess I tend to overcomplicate things:

I want (for now) an unshaded scene like you had in old games. Everything is lit. That way I don’t have to worry about the “dark side of the building”.

When having a Sun (DirectionalLight), only half of the scene is lit. Do you guys know how games like TheForest or such handle that? [Because Lighting is what makes an AAA Look, to some degree, so I should definately change that unshaded-way sometime].

I tried by only using Ambient Lighting but that leads me to some problems (setting the correct AmbientColor Value)

The other way I tried is using a few DirectionalLights but even though I turned off specularity in blender, I have that “white cones” that come from the light. The Reflection basically. Can I turn that off?

And I guess the proper way for unshaded Materials would be changing the Material Definition to Unshaded.j3md in the Material?

If you want ambient lighting then the best way is to use an ambient light. You will also want a directional light.

If you want to set your material’s ambient color then generate the j3m in the SDK and set the ambient material value. Or set it in code with a scene graph visitor.

If you want no lighting at all then use Unshaded, yeah… else if you use lighting then you will have lighting.

Well, I used to have a scene graph visitor to set the AmbientColor but it lead me to troubles as I can’t always set it to White (but instead different colors) and I’d have pretty much materials to generate aswell.

So what you say would be a directional light as sun and some ambient lighting to not have the backsides all-black? Does Mythruna do that aswell like that?

Yes, that’s what Mythruna does, basically. (I use my own materials but I use JMEs directional light and ambient light.)

And there is no way to read Colors out of the Material?
Like setColor(“Ambient”, getColor(“Diffuse”));

I’ll give that a try, thank you :slight_smile:

The proper way to import blend files is to keep the blend file in the assets folder and have the textures in the texture folder and apply them from there in blender. Then you right-click the blend file and select “convert to j3o”, the textures will be directly referenced from where they are.

Sure there is.

http://javadoc.jmonkeyengine.org/com/jme3/material/Material.html#getParam(java.lang.String)

Javadoc is your friend. If it’s not one click away at all times… you might want to turn in your Java card at the door. :slight_smile:

I only had a look at .getColor() which was non existant :blush:
So I guess I need (ColorRGB)(s.getParam().getValue()) ?

How much DirectionalLights do you have in Mythruna? (I can’t get Lighting to look good :stuck_out_tongue: ) only one which moves with the sun and the rest is ambient lit?

@normen: Never tried that, as I don’t have them in the asset folder, but I definately will

I have one directional light that moves with the sun and one ambient light.

1 Like