Shadow

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Haddock
Posts: 15
Joined: Tue Dec 16, 2003 7:19 pm

Shadow

Post by Haddock »

I'm using volumetric shadow casted by an animated character, and the shadow is rendered correctly on the environment, but unfortunatelly also on the character : the part of the character which is not facing to the light, is much darker than the same character without shadow (I hope my explanations are clears).
In the drawAll() method, if I change the order, by render first, normal objects except the character, then shadows and then the character, everything is correct, because the character is rendered after its shadow.
So, is there something I am doing wrong? Or do I have to declare my character as a transparent object (rendered after shadows) or do I have to rewrite drawAll() method, as I did ?
By the way, shadows are consuming a lot of CPU power, so I am about to implement a solution where I have two models for my character : one for the render, and one, a much lower level version of the first one, for the shadow.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Re: Shadow

Post by niko »

Haddock wrote: the part of the character which is not facing to the light, is much darker than the same character without shadow
Isn't this correct? I mean, if the character is selfshadowing, it getting darker again where shadows fall on it. A solution to disable selfshadowing is how you did it. Another would be to call the render()-Method directly from the Character Scene Node.
Haddock
Posts: 15
Joined: Tue Dec 16, 2003 7:19 pm

Post by Haddock »

To explain my issue properly, here is an example taken directly from the last Techdemo:

Without shadows
Image

With shadows
Image

You can notice on the second image that the character has some artifacts (on its right upper arm and rigth part of the body), because it is affected by the its own shadow, and because the character is rendered before its shadow.
I don't think this is a driver issue. If I'm not wrong, in order to calculate the shadow, the engine extrudes, opposed to the light, a volumetric shadow and everything that is inside this volume is shadowed. Unfortunatelly, a part of the character is in this volume, and then it is affected by the shadow.
julio

Post by julio »

and do we have the possibilty to have shadows with an alpha color ?
because in the demo the shadwos were not transparent but
in a solid black color !

is this a way to determine an alpha value for shadows ?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

The shadows in that last screenie look fairly transparent, unless work is really getting to me :D
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

Haddock, I am really really having a hard time seeing what you are talking about the second picture looks like a correctly rendered shadow to me.
julio

Post by julio »

yes in second picture the shadow is transparent on floor !
i 'm going to launch again the demo to see it !

i was persuaded the shadow was in a black solid color !
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Post by Tels »

Ugh! On Linux the techdemo looks radically different! The textures are grey-blue! The shadows are black. Mipmapping seems to be missing.

I'll uploaded a screenshot, is this normal for the OpenGL/Linux path on a Geforce3?

See second set of shots:

http://bloodgate.com/perl/irrlicht/techdemo.html

Best wishes,

Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Currently this is normal for linux, but I am working on it. :)
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

yeh man i thought that shadpw looked great...

Post by buhatkj »

i think it might be that he just want likes spot shadows on the ground, not truly dynamic shasows...
-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Post by Tels »

niko wrote:Currently this is normal for linux, but I am working on it. :)
Cool :o)
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
Post Reply