I load a 3ds mesh file, add light scene node with gouraud shading, everything works fine. But the scene doesn't look as what I'm expecting. shades are not smooth and looks faceted. I think more advanced shading algorithms could help. But for instance is there a way to overcome this?
Look at the tree front. One triangle is completely dark, tha adjacent is fully luminous.
Gouraud shading
you can smoothen the normal in your 3d modeling software before exporting.
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
Strange! I used Blender 2.43 to export my 3ds mesh to .obj model. It works when lighting is off, but when I set EMF_LIGHTING flag to be true, All my models change color, greens become orange or gray, oranges become green. except for some leaves on trees which retain their green color, everything change color. Its's not the case with 3ds model. What has gone wrong?
And I think smoothing normals is a good feature to have. I found this in one of game programming websites:
And I think smoothing normals is a good feature to have. I found this in one of game programming websites:
Well, if you find the normal to a triangle, you are finding a "Face Normal".
If you give OpenGL a face normal for lighting, it will make your object look really flat and not very round. If we find the normal for each vertex, it makes the smooth lighting look. This also covers up blocky looking objects and they appear to have more polygons than they do. Basically, what you do is first calculate the face normals, then you take the average of all the normals around each vertex. It's just averaging. That way you get a better approximation for that vertex.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Maybe the obj file has some more elements exported, e.g. the diffuse lighting color value. But don't know for sure, I'd need the .obj and .mtl files.
For smoothing groups: We do have these things implemented for all other file formats. Just 3ds does not have it, because it's a complicated file format which requires lots of work to have such things implemented. And there are far better formats which deserve more work on them. So Irrlicht in general can cope with per vertex normals without problems.
For smoothing groups: We do have these things implemented for all other file formats. Just 3ds does not have it, because it's a complicated file format which requires lots of work to have such things implemented. And there are far better formats which deserve more work on them. So Irrlicht in general can cope with per vertex normals without problems.
The lighting of my project "Stunt Marble Racers" got way better by just exporting the marbles as .obj instead of .3ds, so I guess (as said before) that's the way to go.
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
hybrid wrote:Maybe the obj file has some more elements exported, e.g. the diffuse lighting color value. But don't know for sure, I'd need the .obj and .mtl files.
Thanks hybrid
I think the graphic is proprietary; however I took some objects and exported them to “.Obj” as well as “.3ds”. This time I couldn’t reproduce that color mismatch phenomenon. Instead this time everything is dark, even when I set the ambient light. Here I have uploaded all the necessary files needed to run a sample test.