Problems with flatshading.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Flatlander
Posts: 9
Joined: Sun Feb 25, 2007 7:18 pm
Location: Finland
Contact:

Problems with flatshading.

Post by Flatlander »

Gouraud shading seems to work fine but I'm getting some weird results when trying to render flat shaded objects with EMF_LIGHTING on and EMF_GOURAUD_SHADING set to false.

Basically the problem is that all the polygons are either fully lit or completely dark, there are no gray areas. Ambient lighting doesn't have any effect. It seems that all surfaces that aren't over ~50% lighted are rendered completely black?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Sounds like you're drawing a scaled object without setting the EMF_NORMALIZE_NORMALS material flag
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Flatlander
Posts: 9
Joined: Sun Feb 25, 2007 7:18 pm
Location: Finland
Contact:

Post by Flatlander »

Nope, that's not it. I'll have to do some more testing; it feels like it would have something to do with normals but the problem is same with unscaled test cube and shouldn't ambient color have some effect anyway.
lulzfish
Posts: 34
Joined: Sat Aug 15, 2009 8:19 pm

Post by lulzfish »

Are you using a cube test or loading a mesh from a file?
Is the somber dream of the Grim Reaper a shade Darker Than Black?
Flatlander
Posts: 9
Joined: Sun Feb 25, 2007 7:18 pm
Location: Finland
Contact:

Post by Flatlander »

I have tried both with the test cube and several meshes in different formats.

I haven't used Irrlicht for a while but I think this still worked on my machine a few versions ago when I last tried.

Edit: I can post some test code and screenshots later when I get home.
Flatlander
Posts: 9
Joined: Sun Feb 25, 2007 7:18 pm
Location: Finland
Contact:

Post by Flatlander »

Okay, got it working. It was just a combination of screwed up normals and messed Blender imports :roll:
Post Reply