I want to import a simple level scene from blender, but the Blender importer does not support the “sun” light type from blender. So does anybody know how to setup Blender, so it will import a DirectionalLight in jme or something similar?
Also I wonder why the sun light does not get imported as a DirectionalLight? (Probably @Kaelthas has to answer this)
There are many approaches for night scenes.
You can add point lights (2 or 3) but it will decrease the performance.
Or you can bake lighting to lightmaps/emissionmaps and use it in some way with shaders.
Also, post filter will help you to create nightlight.
You should create different objects in your code for day and night levels - Just loading the model file and hope, that everything that’s different in those types of levels in encoded in your blend-file doesn’t make much sense.
You could create a class “Level” and subclasses “DayLevel”, “NightLevel” - Those will specify the blend file to load, add the lights, modify the sky texture etc. etc…
Model files should only contain model information (Performance reasons are an exception - e.g. baking lightmaps for a lot of static lights makes sense).
Just loading the model file and hope, that everything that's different in those types of levels in encoded in your blend-file doesn't make much sense.
Model files should only contain model information
Well I think it is well possible to use a blender file not as a model file but as a level file which contains all important information. For example I use empties with special names to tell the game where to spawn players etc. Therefore the level designer can just create everything in blender which is much nicer than having to change your code.
In this manner I also wanted to configure the lighting in blender, though I think this is not possible However, I’m going to workaround this with a level xml file which will probably contain a description of the level, the path to it’s blender file and the lightning configuration in the finished game…
Anyway, my original question was not about day and night levels, but about importing lights from blender:
I’ve also looked at the code from the blender importer, and I see no reason why “sun” is not mapped to “DirectionalLight”. It just prints a warning message and does nothing. Also the “Hemi” light type creates a “Directional Light”, but it is not configured in any way (color and direction are not set). I don’t know why this is the case, probably the different light types aren’t just that important.
Yes, as all our documentation states, you can only expect meshes and uv maps to import. Anything else doesn’t make sense as the differences in how applications achieve the different effects are too vast and most of these are not meant for live rendering. Even (or especially) light sources are affected by that because the propagation of the light is dependent on the implementation which is mostly raytrace-based in 3d editors.