I modeled a car in Blender and now I am trying to use the model in JME3.
The model in blender:
I took a jme3 example from https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset and replaced ninja with my car model. The car model was exported from blender using ogrexml exporter.
The car rendered by JME3:
Why the shading of the car is not right in JME3? Color in JME3 looks pretty much flat. How can I make the car look the same in blender and JME3?
You’re using a terrible image host Could you please re-upload to imgur.com so we can have a better look at your images?
Please press the “help” button in the OgreXML exporter to see what features it supports, not all blender (static rendering) material options are available in OgreXML (live rendering).
I tried the help button of ogre exporter (http://www.ogre3d.org/tikiwiki/Blender+Exporter), but all I got was browser opening ogre help forum. I didn’t found any setting from exporter, which would make any difference to materials.
The yellow material of the car model is just blender basic material where I have only adjusted color (diffuse), not any other property.
What should I do in order to have better shaded car in JME3? Should I change material somehow in blender? Should I export the model differently?
Here are imgur links:
Well the basic difference I saw is that the jme3 one is without antialiasing and with a far lower resolution.
Try it again with antialiasing and a higher resolution.
I tried with antialiasing and higher resolution.
I can see shape of the car border, but details besides that are not really visible. All yellow areas are (almost) the same brightness, no shades.
Ah it’s the light setup then. The blender one has some shades , while the jme3 one has none.
So you should probably check how you create the light in the sample scene.
Are you using the lighting material?
It looks like you used the simple textured one, which works with no lighting…but does not use lightings.
Beside in your blender picture there are at least 2 or 3 lights, you’ll need to set up a similar scene to expect the same display
I did put the blender file and files produced by the exporter available at http://users.utu.fi/sampie/car/. Hope the files provide further information. I did not unfortunately understand the question about lighting material.
If you are willing to experiment, please use the files.
If the problem is about lights, what kind of code should I add to the JME3 example (https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset) to have a proper (good looking) light setup?
The example has one directional light. Now that I looked at the car in JME3, it is bright everywhere: front, back, top, bottom, sides all bright. There is no shadow side. That can’t be right.
I made simple sphere using same yellow material as the car. I exported it and rendered it using JME3.
Despite the fact that the scene in JME3 has only one directional light, the sphere looked the same from all angles (no shades):
Does anybody have an idea what could I try next?
I haven’t had any luck getting shading to work.
The ambient light of the yellow material is really high. Try lowering it.
A different topic:
You’re using quite an amount of materials on the car. Usually one tries to reduce the materials since each material will break up the model into separate “objects”. There also seems to be some dupes among the materials.
Thanks! That fixed the problem.
You need to use lit materials for the lights to do anything.
Material mat_lit = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);
mat_lit.setFloat(“m_Shininess”, 5f); // [0,128]
I’m not sure how you got it shaded if you didn’t actually use a material capable of being lit, but if you did than you can increase the m_Shininess to make the material more glossy.