Page 1 of 1

Bad shadows with dynamic light

Posted: Tue Nov 13, 2007 10:43 pm
by TeTine
Hello!
I'm new to the irrlicht engine and I'm trying to make some test setup with some mesh I modeled with blender
I managed to import the model using .x files but when I try to use dynamic lights, the shadows look weird and I don't know why :/ (it seems that the light sometimes colors vertices and sometimes not?)
[img=http://img151.imageshack.us/img151/9414/testirrlichtbp6.th.jpg]
I think it might have something to do with the export because when I try to use the dwarf.x file, it works fine
If someone can answer me... I'll resume searching for the solution now
thanks in advance :)

Posted: Thu Nov 15, 2007 3:35 pm
by TeTine
Well, obviously i won't get answers so I'll post my own conclusions:
It seems that I made a mistake and thought that shadows should look different, but to obtain cool shadows, one can't use the simple shadows drawn on the mesh by dynamic lights, because they all look like this.
I didn't want to use the shadowscenenode but it is obviously the only way (even if it doesn't work when I try to paste it from the example).

Posted: Thu Nov 15, 2007 3:48 pm
by JP
It looks from your picture that it could just be a limitation of per vertex lighting, which is what you're using.

In blender it probably does per pixel lighting which will look great. You can do this in irrlicht with shaders, so that might solve your problem.

The lights don't cast shadows, they just shade the object according to the light and direction of the vertex normals.

Posted: Thu Nov 15, 2007 4:07 pm
by TeTine
Actually I tried to have my own model look like the dwarf in the demo specialFX (which does not use per pixel lighting i think), but it looked weird.
So I copy-pasted the material values from the dwarf to my model in the x file and obtain something similar (of course)
I think that there are lots of things about real time I don't know and that's why I didn't understand the results at first.

Anyway thanks for the help ^^

Posted: Thu Nov 15, 2007 6:33 pm
by omaremad
You require ambient lighting, (blender is per vertex lights with default non black ambient component).

Posted: Fri Nov 16, 2007 12:03 pm
by TeTine
yes I think one of the lines I changed in the x file is the ambient light specs
I just used a slightly different value to have ambient light but keep a little bit of vertex light shadows, I think it's a good compromise.