lighting of imported meshes

Blitz3D Forums/Blitz3D Programming/lighting of imported meshes

Slomas(Posted 2010) [#1]
I usually try to figure these problems out myself but
I've tried a ton of trial and error here and have to admit defeat!

When I import .3ds models from modelling programs- they never light properly in Blitz.

I understand that each rectangular surface is comprized of two triangles- But when lit, each triangle reflects light differently withing each 'panel'- one dark/ one light etc making the shape of the overall object ugly/confused.

The effect is clear when using flat shading as an entityFX-

The geometrix samples light properly, but anything I have imported has this same problem-

and help here MUCH appreciated!


Thanks- Steve


Yasha(Posted 2010) [#2]
The 3DS file format doesn't store normals information, only smoothing groups, so if you want your mesh to be lit correctly, you'll have to either use a different file format (B3D format does contain normals information, for one), or update the normals manually once the mesh is loaded. This function also seems to do a pretty good job if you set the threshold angle correctly, as long as simple normals are what you want.


Slomas(Posted 2010) [#3]
Yasha-

Beautiful! the function works like a charm- my models were way too complex to fix manually.

many thanks!