Author Topic: correcting normals  (Read 1911 times)

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
correcting normals
« on: 27 May 2011, 06:40:19 »
what's wrong with the lighting in these models that Mr War posted?

Industaron Kestral jumpjet


When flying in one direction one the light is towards the camera, when flying in another its away.

You can speculate that the meshes are single sided but should be double-sided.  Except that the blender script always exports double-sided..

Yet I've seen the same when getting Martian tripods to turn around; and that can't be caused by sidedness can it?

Is it the models, or the export script, or the game?

If the models, how to correct it in blender?
« Last Edit: 27 May 2011, 06:45:15 by will »

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: correcting normals
« Reply #1 on: 27 May 2011, 07:07:05 »
If it's a pre-export problem:
In Blender, select the model, go into edit mode, select all faces, Ctrl Shift N to recalculate normals.  That should work most of the time.  If not, you can flip individual faces by selecting them in edit mode and using W, 0 to flip those faces.

If it's a post-export problem:
Open the model in G3dHack and switch the mesh to single-sided.  If it looks inside-out, then the normals are backwards, and you can use that program's face-flipping tool to correct this.

If it's anything else, then I'm stumped.

Mr War

  • Guest
Re: correcting normals
« Reply #2 on: 29 May 2011, 08:58:18 »
I use autonormals in blender already. Maybe it's not normals but a lamp problem? I never paid any attention to the lamp in blender, but now I see that the position of if does seem to affect the lighting of the exported g3d file. But then if I go back into blender, move the lamp and reexport there's no change.

How is lamp position used in glest?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: correcting normals
« Reply #3 on: 29 May 2011, 17:25:39 »
I use autonormals in blender already. Maybe it's not normals but a lamp problem? I never paid any attention to the lamp in blender, but now I see that the position of if does seem to affect the lighting of the exported g3d file. But then if I go back into blender, move the lamp and reexport there's no change.

How is lamp position used in glest?
The lamp is completely ignored. Glest supplies its own lights.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: correcting normals
« Reply #4 on: 30 May 2011, 00:45:52 »
I never paid any attention to the lamp in blender, but now I see that the position of if does seem to affect the lighting of the exported g3d file.
Are you using "full render" when baking textures?  If so, then the result would depend on the camera position.  Other than that, it shouldn't do anything at all.