That is why

Posted By: amirmehrvarz

That is why - 01/05/13 20:17

hi
How can I solve this problem
http://s2.picofile.com/file/7609857739/jhgjhgjhgkjjl.jpg
.
Everything is abnormal
Light intensity Is too high
Fallen ShadowIt is so ugly
what i do ?? (for destroy shadow and light )
thanks
Posted By: Quad

Re: That is why - 01/05/13 21:13

use a model with better geometry and use a pixel shading for lights instead of vertex lighting.
Posted By: amirmehrvarz

Re: That is why - 01/06/13 13:13

what ?? I did not do much with med You tell me exactly what to do
thank you
Posted By: ratchet

Re: That is why - 01/06/13 20:11

3DGS is very complicated to have good lightening , and complicated to use.

First check in MED object properties :
Diffuse
Ambient
Specular
Then adjust Sun and Ambient properties of your Map.

They have a lot of influence if you don't use any shader.

I also would recommend you to use some shader, they are a good bunch ready to use.

So what you have to do is try and experiment.
Posted By: Superku

Re: That is why - 01/07/13 10:55

The issue with your model that causes the bad lighting is shared vertices between different faces/ groups of faces and thus interpolated normals.
I've made a simple tutorial for you how to fix this: http://www.superku.de/lighting_tut.jpg
Posted By: Shigen

Re: That is why - 01/11/13 12:02

I have the same problem and SuperKu's tip works very well. But since models can become very complex it is not always so easy to do and the number of vertices in the model would increase significantly. A simple cube would have 24 vertices instead of only 8.

So I have another question according this problem:
When are the surface normals computed? Are they already stored in the model, created when the model is loaded or before rendering a new frame? And is it possible to manipulate the normals?
Posted By: sivan

Re: That is why - 01/11/13 16:47

it is possible to manipulate normals runtime by the d3dvertex struct, see manual at ent_getvertex / ent_setvertex. e.g. I modify tree leaf normals runtime to be more realistic.
as I know, normals are stored in the mdl file. if you import e.g. an .fbx file to MED with custom normals, they are kept. but there is an option in MED somewhere to update normals, which calls (I think) the directx ComputeNormals (which is also available to be called runtime), that calculates the vertex normals as the average of the neighbouring 3 faces (hopefully I'm correct).
Posted By: Superku

Re: That is why - 01/11/13 18:09

I don't think that this will work as the lighting is based on vertex normals and not face normals. When you know manipulate a vertex's normal so that the shading on one side of the cube is correct/ flat, you will destroy the result when you try to fix it on another side that shares this vertex.
I could be wrong though to the point that it works with a different shading method but I'm not aware of something like that.
Posted By: lostclimate

Re: That is why - 01/11/13 20:03

Originally Posted By: ratchet
3DGS is very complicated to have good lightening , and complicated to use.

First check in MED object properties :
Diffuse
Ambient
Specular
Then adjust Sun and Ambient properties of your Map.

They have a lot of influence if you don't use any shader.

I also would recommend you to use some shader, they are a good bunch ready to use.

So what you have to do is try and experiment.


this has nothing to do with 3dgs at all. it has to do with the way 3d models are shaded in realtime in just about any engine. its the default dx shading pipeline, same thing with ogl.
© 2024 lite-C Forums