DotScene and lighting

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
sarge
Gnoblar
Posts: 22
Joined: Wed Dec 14, 2005 10:27 pm

DotScene and lighting

Post by sarge »

I originally created this thread in help, but the more investigation I did, it became apparent it belongs here.

I have an issue where any lights I add to my scene, the light does not fall properly on the static scene. The light works properly with any meshes I programatically add to the scene, but not the scene itself.

Here is what I posted in the help thread.

I have been experimenting all morning and found some additional information. I think something in my blender scene itself got currupted. I can reproduce the problem if I create a new basic scene, and add rotations in the dotscene export screen. But I still have the problem in my scene even without the rotations.

First, I created a new scene that was nothing more then three planes, each perpendicular to the other so it like one corner of a cube. The visible faces point inward.

I did a regular export (dotscene with no rotations) and the light worked fine when placed in the center of the three planes. The light source is the white dot in the center of the three planes. You can see the light falls on each plane equally.
Image

I did another exporting with a 90 degree rotations(RotZ = -90) and got this. As you can see in this one, the light isonly lighting up half of two of the planes.
Image

This is the problem I am having with my scene. Unfortunately I have this problem without any rotations. It took quite a long time to create it, and I the thought of starting from the beggining scares the hell out of me. But apparently something in my scene got currupted. If anyone has any ideas it will be greatly appreciated.

PS. It apears to me that when you export from blender, what is up and down in Blender does not end up being what is up and down in ogre. For instance, in Blender, if I hit numpad7, I will be looking down from the top at the floor of my scene. But if I hit ctrl1, then I am looking down at what is my floor from ogre. Is something perhaps wrong in my setup?
User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 15
Contact:

Post by metaldev »

what happens if you tesselate the planes more? does it still light improperly?

I did another exporting with a 90 degree rotations(RotZ = -90) and got this.
rotate what -90? the scene geo? the light? both?
sarge
Gnoblar
Posts: 22
Joined: Wed Dec 14, 2005 10:27 pm

Post by sarge »

metaldev wrote:what happens if you tesselate the planes more? does it still light improperly?

I did another exporting with a 90 degree rotations(RotZ = -90) and got this.
rotate what -90? the scene geo? the light? both?
I'm fairly new not sure what you mean by tesselate.

Exporting at -90, I meant when you are prompted with the DotScene exporter screen, at the bottom there is a place that you can put in a rotation for x y or z. I had added a -90 rotation in Z.
User avatar
metaldev
Orc Shaman
Posts: 761
Joined: Thu Mar 17, 2005 11:56 pm
Location: Boston
x 15
Contact:

Post by metaldev »

tesselation is how cut up the model is.

in other words, the planes could be made with any number of triangles (greater than 2). What happens when you cut it up more?
sarge
Gnoblar
Posts: 22
Joined: Wed Dec 14, 2005 10:27 pm

Post by sarge »

I figured it out!

It apears it was because I rotated my mesh in object mode while in blender.

If anyone gets a chance and just happens to verify this, please let me know. It is very repeatable for me.

What seems to have happened is this.

When I initially made the scene, I exported it, and loaded it using dotsceneoctree.

It was then that I noticed the scene was sideways. I guess Y is up in Ogre while in Blender it is Z that is up.

Anyway, when I saw this, I went back and rotated my scene to compensate. But instead of rotating it from Edit mode, I did it while in object mode.

Initially when I viewed my scene, I had the ambient lite on. So I couldn't see the problem. It wasn't until I added individual lights that it apeared.

Once I started trying to reproduce the problem with simple scenes, I noticed it only happened when I added some kind of rotation in the dotscene exporter. Rotations added in the xml exporter worked fine.

Somewhere in my experiments I accidentally rotated a scene that did not have this problem in object mode rather then edit mode, and that is when I realized it.

I was able to go back to my initial scene that had the problem, and rotate it back to the way I initially had it in object mode to fix the light problem. Then I went back and rotated it in edit mode to set it uprigt correctly.

Hopefully my pain here will help someone else who stumbles upon this.

Thanks
Post Reply