Tuesday 29 March 2011

Odd Lighting

I'm having a few peculiar results with the latest model I've created.  I think it is showing up a limitation with my HLSL shader code.  I changed the code a while back to improve performance but I might have inadvertently changed from per pixel to per vertex lighting.

I'm going to compare my code to a few samples.  The following are some reminder links just on the subject of HLSL lighting:


Note: The cause was due to normals interpolating round the corners at the bottom of the model.  I was not aware that if a face shares vertices with another face that this happened.  It does explain why most of my corners look rounded.  There is a modifier in Blender called 'Edge Split' which I used to fix the models.  This information was courtesy of @SigilXNA:

Note to self: Blender's Cube Projection or project from view, for UV Unwrap, is much easier to texture.  Create vertex groups for each side or section of the model and use Cube Projection to unwrap that group.

No comments: