Avoid Shadow Volumes Self-Shadowing?

Started by
3 comments, last by pangplast 20 years ago
Hi! I''m working on a new game and I''m setting stuff up again. I want to use the Volume Shadow technique for shadows. However I do not believe I want to generade my volumes from a model. I want to use a cube for the shadow and then blur it when drawing it to screen. My Problem is that the shadow cube shadows itself. Is there any way of solving this? I just want the shadow on the ground not on the model itself. By the way, is there any way of solving the problem of the inverted shadows when camera is inside a shadow volume? .Pangis
Screenshos of "Humanoid invasion": http://humanoid.vaultcity.org/
Advertisement
Solution to the selfshadowing problem : render the model AFTER the shadow pass (like this it will be OVER the shadow)
Solution to the camera problem : use the z-fail algorithm instead of the z-pass one
Hum.. Regarding the camera-inside-shadow problem. This means that I''ll somehow have to check if the camera actually is inside a volume, right?

Regarding the Draw-The-model-last solution. This is not an option since I don''t want to render that model that actually casts the shadow. A box is used for the shadow and another mesh is used as the real object. This is of course to reduce cpu usage.

Any other tricks to do this? Anyone knows why this is happenining is the first place? Whats the difference between the part of the volume that is a part of its "parent" model and the parts that are not? I don''t get why this is happening at all?

The same is happening with the Shadow Volume Sample in dx9 (The airoplane).

.Pangis
Screenshos of "Humanoid invasion": http://humanoid.vaultcity.org/
Hum.. me again... Just adding that the box is not shadowed. The shadow seems to draw itself when it is overlapped on the screen. I cant figure it out. I''ve tried playing around with the renderstates but with no luck.
Screenshos of "Humanoid invasion": http://humanoid.vaultcity.org/
Regarding the camera-inside-shadow problem : no, u don''t need to detect if your camera enters the shadow volume because the Z fail algo always produces correct results (wherever the camera is).

Regarding the Draw-The-model-last solution : your explanation is a bit confusing. I guess that atm u make your rendering like this :
1) render scene + model
2) render the shadow volume
3) render the shadow quad

As the model is rendered before the shadow quad, it gets sef-shadowed.. Try this instead :

1) render scene only
2) render the shadow volume
3) render the shadow quad
4) render the model

This topic is closed to new replies.

Advertisement