I made a sword using blender, and it seemed to turn out fine, the texture mapping stayed with it fine too.
My problem is that the shading looks terrible when i use a light with it
As you can see, it's like it only lights up individual faces. Will i be able to make this look nicer with a shader or something? Or will i have to subdivide all of my faces?
Thanks
Ugly shading
which model format are you using? the normal seems flat.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Try using the mesh manipulator (from smgr) to recalculate the mesh's normals, that could be part of the problem here.
Or it could be just the limitations of per vertex lighting when you have very few polys in which case you could sub-divide the polys or use per-pixel lighting (which is probably how blender lit it) by using a shader.
Or it could be just the limitations of per vertex lighting when you have very few polys in which case you could sub-divide the polys or use per-pixel lighting (which is probably how blender lit it) by using a shader.
I recalculated the normals like you said, and it seemed to do the trick.
It's flat shading as you can see, but a shader can soon fix that! Thankyou very much!
Oh yeah, the code:
It's flat shading as you can see, but a shader can soon fix that! Thankyou very much!
Oh yeah, the code:
Code: Select all
irr::scene::IAnimatedMesh* mesh = smgr->getMesh("../media/testSword/shortsword.x");
smgr->getMeshManipulator()->recalculateNormals(mesh);