Can't get gouraud shading on my model?
Can't get gouraud shading on my model?
I've been working on this for some time now, trying to figure out why I get flat shading on my models, but no luck. Also, if I don't add the material flag normal_map_solid or parallax, I only get a white sphere where shaded parts are totaly black.
I'm pretty new to irrlicht, so I'm sure there is something I'm missing here, but so far I haven't been able to figure out what causes this, since clearly I have gouraud shading enabled, right?
I'm using the irrWizard and used a snippet from the perpixel lighting example in irrlicht to load the model with normal map (though that is disabled now). I might add that when I have a normal/parallax map actually loaded, the flat shading will consume the whole model, making the wireframe much more distinguishable.
Any ideas on what is causing this? Here is the source code, it that would help. I load the scene in AppRunState.cpp in the loadSpaceScene(...) function (it's a little bit messy right now due to wip).
I am not sure, but maybe the problem is the building of tangents. Irrlicht modifies (it did earlier, don't know if it has been changed) the original normal in the process. Maybe it realigns the normal to the face normal and doing this will give all adjacent vertices of a face the same normal and the result will look as if flat shaded.
You can test this by not creating tangents.
You can test this by not creating tangents.
Thanks for the tip. Sadly it didn't work though. And without tangents I wouldn't be able to do bumpmapping either, so I would really like to have tangents calculated for the mesh.
I changed the createMeshWithTangents(...) to createMeshUniquePrimitives(...), and I ended up with a flat shaded, white sphere, equal to what I would have before if I didn't enable the normal_map_solid material flag.
I changed the createMeshWithTangents(...) to createMeshUniquePrimitives(...), and I ended up with a flat shaded, white sphere, equal to what I would have before if I didn't enable the normal_map_solid material flag.
Hey,
OK just so you know, I have compiled and run your source, the problem with everything being white is your light sources.
You are creating 2 lights and adding billboards, that are not shown in the code above, but the brightness of the lights is way too much, try changing it from 20000 to around 5000, and you will see better results.
I am not near my own machine right now, but I will look again later.
I noticed that you also used a 3DS model, not the earth .X model that come with irrlicht.
Has this been modifed and exported to 3DS, or is it a completley new model ??
OK just so you know, I have compiled and run your source, the problem with everything being white is your light sources.
You are creating 2 lights and adding billboards, that are not shown in the code above, but the brightness of the lights is way too much, try changing it from 20000 to around 5000, and you will see better results.
I am not near my own machine right now, but I will look again later.
I noticed that you also used a 3DS model, not the earth .X model that come with irrlicht.
Has this been modifed and exported to 3DS, or is it a completley new model ??
You scratch my back, I'll scratch yours.
Thanks a lot for taking your time trooper, the intensity of those lights were definately way too strong and was causing the planet to go totally white. So that solves that one problem.
The shading is still flat though. Here's an example with normal mapping turned off and no tangents calculated for the mesh:
And I'm using a totally new 3d mesh exported from 3d studio max. It's just a simple geosphere with a diffuse map. I have tried with the earth.x as well though, and as I commented in my previous post, testing it in the perpixel lighting example, the wireframe is visible in that example as well, same problem as I'm having as far as I can tell, though the parallax map covers it up very well.
The shading is still flat though. Here's an example with normal mapping turned off and no tangents calculated for the mesh:
And I'm using a totally new 3d mesh exported from 3d studio max. It's just a simple geosphere with a diffuse map. I have tried with the earth.x as well though, and as I commented in my previous post, testing it in the perpixel lighting example, the wireframe is visible in that example as well, same problem as I'm having as far as I can tell, though the parallax map covers it up very well.
Thanks guys. I did a retry at implementing the earth.x model and did a test with and without tangents, and the tangents definately screws up the smoothing. So I guess I'm flailing in the void trying to get normal mapping working nicely at this point, so I'll just continue without for the time being. Again, great to see the support of the community surrounding this engine.
Man, I'd hate to contradict hybrid, however...hybrid wrote:They are not supported, and using the tangent mesh conversion will destroy them anyway. So don't expect these to work. Only support for smoothing groups is in .x format yet.
isn't gouraud shading supported witht the *.obj?
I recall having nicely shaded round surfaces with *.obj
or am I missing something?
Join us in the Irrlicht chatroom:
[url]irc://irc.freenode.net/irrlicht[/url]
I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
[url]irc://irc.freenode.net/irrlicht[/url]
I love deadlines. I like the whooshing sound they make as they fly by. -D.Adams
If you look at the screenies from the .3ds model I used, it does look like both the shading and the smoothing-groups are out. If you look at the screenie I took using the .3ds running on the software driver, you can see how the smooth shading is working, while the smoothing-groups are not.
When I started using the .x model, the shading was smooth, but tangents screwed up the smoothing-groups.
This might just be a trick of the eye caused by the lack of smoothing-groups for the .3ds format though, refering to the first screenie in the topic, but I don't know.
When I started using the .x model, the shading was smooth, but tangents screwed up the smoothing-groups.
This might just be a trick of the eye caused by the lack of smoothing-groups for the .3ds format though, refering to the first screenie in the topic, but I don't know.