Game Development Community

Ugly lighting

by Jacob Dankovchik · in Torque Game Engine Advanced · 01/15/2005 (3:27 pm) · 55 replies

Perhaps this was mentioned before, perhaps not, and it may have been noticed already, but i tohught i'd mention it here to make sure. I found this a while back but decided to post about it now. It seems the lighting on models is terribly ugly and rough, looks far worse then TGE. I just tested this in the Dojo demo, seeing how it was the most recent version i got ahold of and its still there.
For this demo of it i used a flat white image for the skin and metal. I also used that flat white image to make a normal map with no detail, just solid flat-face color. I also tested with no normal map and get the same thing, just with a bit less contrast in it.

here is a pic: img74.exs.cx/img74/4550/light8.jpg
And here is a video i recorded. Sorry its a bit low res though. Hope you can open it. I compressed with a 5.1.1 DivX codec, so thats what you'll need to see it.
www.planetgargoyle.com/dm/light.avi

I've also noticed severe lighting issues with my models exported from Blender. They look fine until i apply a normal map, then all hell breaks loose. Not sure if this is the Blender exporter, TSE, or a mix of both though. I can post examples of that if you like.
Page «Previous 1 2 3 Last »
#1
01/15/2005 (5:58 pm)
This looks normal to me. What exactly are you expecting it to look like? By using a flat normal map image your gonna essentially get the effect of simple vertex lighting (same as with no normal map). Have you tried using the existing character normal map?

Also i believe only the sunlight effects the characters at the moment... so maybe this is what your not seeing?
#2
01/15/2005 (7:30 pm)
Hm.. I see. I was more under the impression TSE did per-pixel on its own. But all the same it seems to be causing more artifacts with the lighting then i've seen in TGE as well when i tried testing before.

I also considered the sun thing as well, but i decided to bring this up anyhow just to make sure.

Just tested with the default normal map and you cant really see the lines but its still very rough lighting, which is the main thing i was trying to show, prolly sohulda been more specific on that issue. Its hard to see in the video however cause its such poor quality. But like, the light doesnt vary. A part will be bright, then turns quite a bit darker, then ever more darker. Theres like, no fading or anything when say the player turns or something. Its very jagged in the shading.
#3
01/15/2005 (7:53 pm)
Brian will have to chime in now as i'm not the expert in this.

Per-pixel lighting is controlled by the normal map in TSE. If it's not there (or it's flat) you'll get the default vertex lighting effect.

I wonder if the non-gradual changes in some poly shading your seeing are an artifact of bad normals generated when blending between two keyframes.

Can you post a screenshot of the bad light you're seeing with the default character normal map on?
#4
01/15/2005 (8:21 pm)
Hm. Havin trouble gettin a decent shot, i'll try tomarrow cause im goin to bed soon. Mostly you see it in animation, certain faces that rapidly flicker between light and dark. You can try yourself if ya like. Just replace the diffuse maps of the orc and the metal with white squares. Then turn off the metal cubemaps and load the dojo demo and look as he dances. You can see it pretty good in the crotch area and in some spots on the arms.
#5
01/16/2005 (12:36 am)
The space orc model isn't perfect... What you have up there doesn't look like it has normal mapping turned on, though, so it's very difficult for the engine to give you any per-pixel effects. :)
#6
01/16/2005 (7:45 am)
Hm.. i see. I thought things worked a little bit different. Im sure things should work just fine then. But got any thoughts as far as models exported from blender go?
#7
01/16/2005 (1:09 pm)
Well, check them in the showtool pro. It might be that blender isn't exporting normals properly? (It's a good tool/exporter, but it isn't 100% yet, so it's worth checking that early on.)
#8
01/16/2005 (1:40 pm)
Can the show tool do normal maps? If so, how? Cause thats all that is causing a problem. The normals are all fine without a normal map, i've tested in TSE and in TGE and i just loaded into the show tool, all lighting is perfectly fine. But in TGE the second i apply the normal map, all hell breaks loose. The lighting becomes horribly hacked up all over, alot of the hacking of the light is around the skin seems too, which is odd. Like, right where the front of the skin ends and the back begins where it makes a seam on the uv's.
It does this regardless of the normal map and skin. I've tested this with a white skin and flat normal map like shown above and it still does it. Im a bit busy right now, need to finish some stuffs, then i'll get some pics up to show.
#9
01/16/2005 (3:14 pm)
Actually i guess the show tool can't do normal maps as it's based on TGE and not the new shader engine. I believe that Dave said ShowTool for TSE was a possibility at some point.
#10
01/16/2005 (3:53 pm)
K, here are the shots of the normal map issues im havin. The first is a front shot with no normal map. As ya can see, nice easy lighting, no problems.
www.planetgargoyle.com/dm/magoggood.jpg
These next 3 are with a flat normal map, no detail or anything, jsut generated off a white sheet. Seems to manage to mess alot of shit up though. :/ Also notice like i said about the uv joints in the arms, down the chest, legs, etc. You can see it suddenly change along the line of the uv seam. Oh, and its only applied to the body, i didn't apply anything to the head.

www.planetgargoyle.com/dm/magogbad1.jpgwww.planetgargoyle.com/dm/magogbad2.jpgwww.planetgargoyle.com/dm/magogbad3.jpg
Like i said, not sure if this is the exporter, TSE, or a mix of both. Im stumped on it. :/
#11
01/16/2005 (4:08 pm)
My uneducated guess.... could this be a texture space vs. model space normal map issue?
#12
01/16/2005 (5:12 pm)
What exactly do ya mean with that?
#13
01/16/2005 (5:32 pm)
Could you post the textures?
And the snippit of material code you used to define them?
#14
01/16/2005 (5:34 pm)
Also if you could take a screenshot of your UVMap that would help, those look like some nasty seams
#15
01/16/2005 (6:06 pm)
K. Although i can tell ya now, i know its nothin to do with the uv's or textures or this model specificly. We've tested several models from blender, each one doing the same thing, even some model that was only about 30 poly's, if that. But here it all is anyhow.
skin: www.planetgargoyle.com/dm/body.png

uv map: www.planetgargoyle.com/dm/bodyuv.png

and here is the material code:

datablock Material(magogbody)
{
baseTex[0] = "starter.fps/data/shapes/magog/magogbody";
bumpTex[0] = "starter.fps/data/shapes/magog/local";

};

Just the basics, the skin. Nothin more.
#16
01/16/2005 (7:40 pm)
A white normal map is not neutral. You need a grey normal map to simulate a flat surface, especially in the blue channel that determines the depth at each texel. Try again with a 50% grey image in each channel, I'm sure your seams will smooth out.

Also, I've had a problem with Blender exporting normals properly. I am not exactly sure of the problem, but the models seem to have the lighting normal pointed down (-y). Looking at my exported models in the TSTPro, moving the light completely under the model lights all polys, moving the light directly above no polys are lit. I have not dug into the code completely, but the exporter may be saying to use 'encoded normals' at the same time disabling them (or setting them all to zero as it appears on second glance). Someone more familiar with the exporter and lighting model may want to chime in with a more accurate description.

Jameson
#17
01/16/2005 (7:56 pm)
Actually the grey or white doesn't make any difference. I just tested it too to make sure, the normal map is the same color regardless. And sides, im sure this isn't the normal map as any normal map causes this problem.
#18
01/16/2005 (8:56 pm)
Sorry could you post the normal map too?

The reason I'm asking is because I'm trying to figure out where the kink is, as I see the normal maps on the walls in the back look fine.
#19
01/17/2005 (5:13 am)
K, here.. Although i've said several times already, the normal map doesn't matter. ANY normal map does this.
img142.exs.cx/img142/9476/local.png

Oh, one thing i did remember though. It does happen to change with the uv's. Doesn't get better, doesn't get worse, but the patches of light and dark move around. Like, we had the same model a while back that had a pretty different pattern to it. We then re-unwrapped it because it didn't have a very good unwrap job and that there came out. So it seems to de depended on how the uv's are mapped. But i know nothing is wrong with that model in particular.
#20
01/17/2005 (1:17 pm)
As several people have already posted, there are issues with exporting the normals with Blender. This affects everything from the standard gouraud shading to the per-texel bumpmapping.
Page «Previous 1 2 3 Last »