Lighting quality on Obj models
Lighting quality on Obj models
Is it possible to set the smoothing angle for materials so that the light reflections are less triangulated?
Re: Lighting quality on Obj models
Well, the normals are under your control. To get sharp edges, you would have needed to duplicate the vertices? So now you should average the normals at each vertex.
Re: Lighting quality on Obj models
Okay, the problem is that the light reflections are angular and match up to the triangles in the model.
I don´t want to increase the number of triangles in the model, but have the lighting smoothed across the surface.
Would that be best done programmatically, or via settings in the materials or model?
I don´t want to increase the number of triangles in the model, but have the lighting smoothed across the surface.
Would that be best done programmatically, or via settings in the materials or model?
Re: Lighting quality on Obj models
You need a shader to get per-pixel lighting. But your normals also need to be good for that to work.
Re: Lighting quality on Obj models
Okay thanks! Is there an example of a per-pixel shader for Irrlich? You mean the normals in the model have to be good?
-
XenoZergNid
- Posts: 17
- Joined: Sun Oct 13, 2013 1:52 am
Re: Lighting quality on Obj models
I havn't done it before but:
http://irrlicht.sourceforge.net/docu/example011.html
seems to be what your looking for.
http://irrlicht.sourceforge.net/docu/example011.html
seems to be what your looking for.
Re: Lighting quality on Obj models
Thanks, but that example is for bumping I think...
Re: Lighting quality on Obj models
I guess I should try the per pixel shader in XEffects, that should do it!
Re: Lighting quality on Obj models
Seems there is no pixel shader in Xeffects 1.3, at least I can´t find it.
The problem I have with Irrlicht´s default shader is the jagged edges of the light-to-shadow at the boundary region of the light.
This is noticeable on circling lights, where the range of the light does not quite cover the entire model.
Otherwise the lighting looks good and smooth, the problem is the light boundary area.
The problem I have with Irrlicht´s default shader is the jagged edges of the light-to-shadow at the boundary region of the light.
This is noticeable on circling lights, where the range of the light does not quite cover the entire model.
Otherwise the lighting looks good and smooth, the problem is the light boundary area.
Re: Lighting quality on Obj models
The XEffects shaders are in the .cpp file.
Re: Lighting quality on Obj models
I´ll take a look, cheers! Just saw that there are some in the Shaders folder too.
Re: Lighting quality on Obj models
XEffects draws everything to a texture that it then displays across the screen on a quad, that´s going to hit the FTP for complex scenes.
I guess Irrlicht just needs a good multi-lightsource per pixel shader but then that won´t manage shadows... without some complication.
Image here: http://www.sendspace.com/file/wuc2y3 (tried to post this as an image... is there a place images can be posted?)
This image shows what happens when a light with radius smaller than the model, crosses over the model, the extremity of the light is not a continuous line, but follows the borders of the mesh triangles, so I guess that's vertex lighting, would that be right?
I guess Irrlicht just needs a good multi-lightsource per pixel shader but then that won´t manage shadows... without some complication.
Image here: http://www.sendspace.com/file/wuc2y3 (tried to post this as an image... is there a place images can be posted?)
This image shows what happens when a light with radius smaller than the model, crosses over the model, the extremity of the light is not a continuous line, but follows the borders of the mesh triangles, so I guess that's vertex lighting, would that be right?
Re: Lighting quality on Obj models
Yes, that is vertex lighting.
Re: Lighting quality on Obj models
Yes, but also I´m getting the effect shown on this web page, which they say is due to bad normals! http://gamedev.stackexchange.com/questi ... ng-problem
Re: Lighting quality on Obj models
what are you using to create the models ? as i don't think its bad normals as such....

in the two models above the normals are handled "differently". In the right hand model there 3 separate vertices for each corner each vertex has the same position but a different normal. Where as the the left hand model has one vertex per corner with one normal as the average of the three normals in the right hand model. These models were created in 3ds max and max uses something called smoothing groups to vary how object are smoothed. Faces with Different smoothing groups will give hard edges, faces with the same smoothing groups will be smoothed across the edge by sharing normals. In addition the exporter you use has to be clever enough to create the model in such a way to work correctly in an engine such as irrlicht.

in the two models above the normals are handled "differently". In the right hand model there 3 separate vertices for each corner each vertex has the same position but a different normal. Where as the the left hand model has one vertex per corner with one normal as the average of the three normals in the right hand model. These models were created in 3ds max and max uses something called smoothing groups to vary how object are smoothed. Faces with Different smoothing groups will give hard edges, faces with the same smoothing groups will be smoothed across the edge by sharing normals. In addition the exporter you use has to be clever enough to create the model in such a way to work correctly in an engine such as irrlicht.