dim3 Forum

Full Version: Lighting direction wrong.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am having trouble with lights highlighting my objects from the wrong direction.
[Image: Dim3_Lighting_Bug_by_DownshiftDX.png]
[Image: Dim3_Lighting_Bug_Part_2_by_DownshiftDX.png]

(Yay for Comcast's FTP servers being down atm...good thing I remembered my DeviantArt account I never use..)

Anyway, I have been playing with settings, searching on here, moving the light everywhere, and I cannot figure out why the highlighting is coming from the side when the light is lined up in front of the small sphere.

Running on the 2.2 release.
Are the normals right?
Try checking them, they are the purple lines that stick out in animator when they are turned on. They should all point outwards. If not, reset them Wink. (they help lighting)

Also, the more polygons the more detailed the lighting Wink. Not that you need alot, I'm just explaining.
Thanks for the response CCCCC.

I use the normals view all the time in Wings and in the Animator so they are nothing new to me. (I also program a bit in BlitzMax and the MiniB3D engine and used to use DarkBasicPro on my PC before switching to the Mac full time so there isn't much here I haven't seen in one form or another.) I have tried resetting them and inverting the normals. With them inverted, the angle of incidence for the light was reversed on the object (obviously) and the direction was still wrong. Seems to be happening on every object though even the ones I didn't create.

If you notice in the second picture the hammer is between the light and the player viewpoint. . . shouldn't the back of the hammer be dark? Instead, on the right edge of the hammer handle you can see the dark side starting to wrap around. to the front edge. It all seems very inconsistent to me.

I have a model of an Anime style female that I have been putting a lot of work into in Wings and wanted to see her rendered in an engine. Right now her mesh is around 7000 polys and the lighting on her was so bizarre that I then tried a cube and a sphere to double check it wasn't a high poly count thing.

Also, Wings seems to shade objects by calculating light by the normal of the face instead of per vertex. I try to work mostly in quads as everybody suggests and the lighting there is much more smooth than in Dim3. (Dim3 shows a lot of the edges of the tris on the model with lighting turned on.) It is also very smooth on the same model when imported into BlitzMax/MiniB3D projects. Can I import a mesh and have it retain its quads or will everything be triangulated by the Animator? Is there a per face lighting instead of per vertex mode?
There are different lighting modes, I forget which right now. Is ambient lighting turned on?
The ambient light is the default for a new map. Black color with 0.75 drop off.

I think I will look around for some more information on lighting types and modes. I would think that the default lighting mode would make sense and work as expected.

Edit:

Several hours later and after making a new test map, recalculating the normals on my models, and re-preparing them (not sure what this does but it sounded good.) everything appears to work decently on the new map.

Still doesn't work on the original map shown above. I guess I will watch out for it and if it pops up again then I will try to find some decent repro steps.
It's the diffuse lighting that's the problem. There are some places where it can be a little flaky (most notably in weapons as they are actually draw in 2D space and the normals aren't always translated perfectly as the lighting is in 3D.)

I'm working on these, though I'm not sure what's up with your problem.

[>] Brian
I thought the weapons were now drawn in 3d space? Because my muzzle flashes stick through the enemies! Sad
ccccc Wrote:I thought the weapons were now drawn in 3d space? Because my muzzle flashes stick through the enemies! Sad

Whoops, I meant that they aren't drawn in rotated 3D space. They are drawn in 3D space, just without the rotation so they always face forward. This is what messed up the diffuse lighting sometimes.

You'll need to increase the hit box around your player to avoid this or shrink the weapons down.

[>] Brian
Reference URL's