Directional Light passing through model

Prefacing this by saying I’m not sure if this is a blender issue or a jme issue. It happens in blender and jme viewport. The model, when a directional light is added, looks like this:

Why is a directional from below directed straight up producing light on the inside of the tube, on the top surface? The same effect occurs putting the directional light in any direction

The material is straight from the material in blender–the model looks identical to my blender one. It’s a simple material–diffusemap, some shininess, usematerialcolors ticked on. And both blender (using blender internal render) and jme produce this effect. Blender’s cycles render doesn’t.

Anyone able to point me in the right direction? My artist is posting the same question on some Blender forums too, in case this isn’t a jme thing. You can probably tell me that too :slight_smile:

Lighting != shadow

The upper side of the inside of the cylinder is lit because the light is shining from that direction.

Okay, So I need to add shadows of some sort. However, none of the suggestions from http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:light_and_shadow do anything for the inside of the tube. The tube looks the same, regardless. I got it via the DirectionalLightShadowRenderer and adjusting the settings.

Also, since the adding of the PostProcessor effects have to be done in code, I shouldn’t expect to see any changes in the regular model scene explorer, right?

You can add a FilterPostProcessor by creating a Filter file and opening it, then pressing the “eye” button in the Scene window. Or you make an AppState and run that on the SDK Scene.

Doesn’t the filter file only work for certain filters? As far as I can tell, when I right click on my filter file to add a filter, no options for the directional light shadow filter, only the SSAO filter, which isn’t what I’m going for.

I shall try the other solution … after work today.

You can also load custom AppStates I think which may provide what you want.

How does one properly use the directional light in the scene from a loaded custom appstate? If I want to create the Directional Light in the AppState, it doesn’t seem to show up in the SceneExplorer (i.e. rootNode.addLight(sun) doesn’t do much). If I put the Directional Light in the ScenEexplorer, and try to get it in the code for the ShadowRenderer, I don’t know how to get the light, because rootNode.getChild can’t be cast to a DirectionalLight. I’ve tried getting the LightList, but I’m not sure if I’m doing it correctly, since I can’t print anything out.

Maybe I’m missing something on how to get/use the light for the filter/renderer?

Lights aren’t children. Children are Spatials. Lights are not Spatials… so yeah, logically, that approach would never work.

So, the list of lights is in the LightList. Since that is the light list. You were right about that.

What part of finding the directional light in the light list is confusing?

Well, then I guess. How do I print out the light list from the AppState, or is there some kind of debugger for it?

I sorta knew the Spatial Directional Light thing wouldn’t work :slight_smile:

Are you really asking how to iterate over a list and print it out? Making sure there isn’t some other constraint I’m not seeing before pointing you towards regular Java tutorials.

Oh no. Anything but that!

No, but really. I’m trying to load the custom app state into the SDK explorer, like THIS. I just don’t see a way to print stuff out. I’ve tried both println and logging, none of those print stuff.

I can assure you I understand how to print out the contents of the list. I just don’t know where that printed stuff…goes.

Did you look in the application log tab? I assume stuff goes there but I don’t really use the scene editor much so I don’t know.

The rootNode in the scene is not the node thats displayed in the SceneExplorer, the loaded model is displayed there, so if you add lights to the rootNode you’ll not see them in the SceneExplorer (and you also won’t save them in the model which might or might not be a good thing). So you’ll have to attach the lights to the model node (which is a child of the rootNode) to see (and edit/save) them in the SceneExplorer.

As or the logging, its not displayed anywhere unless your class is in the com.jme3 package, the log file is in the SDK settings folder (see troubleshooting section in the manual for its location).

@pspeed: Yeah, I checked the log tab. Nothing doing

@normen: That’s useful to know. That’s probably why I wasn’t seeing the light I attached to the rootNode in the scene.

Plus, since we are working on a mobile game, we figured that we should be baking the shadows rather than rendering them with post processor settings. However, I have a small question on that. We followed the wiki page on lightmaps via blender, and managed to get it work based via the ogre exporter. However, via the regular blender importer, the lightmap never seemed to work properly. The UV’s looked incorrect on the diffuse, and the lightmap just didn’t work. Any reason why that’s the case? Or rather, can any of you confirm that you can get it to work via both the ogre export and the blender import? Otherwise, I’d like to update the wiki to reflect that.