Stratos: Punto de Encuentro de Desarrolladores

¡Bienvenido a Stratos!

Acceder

Foros





Shadow Glitches

Iniciado por auron, 06 de Febrero de 2006, 06:13:41 AM

« anterior - próximo »

auron

 Hey guys,

What do each of these lines do?

HShadowVolumes.AddToCache = true;
Haddd.Scene.Shadows.UsePCF = true;
Haddd.Scene.Shadows.Shadow_Bias = (value);


I'm testing out shadows now but I'm getting some rather strange graphical glitches when I set AddToCache to true. It causes the shadows of my moving objects to generate inaccurate flickering shadows. Other than that everything's fine.

Also, how do I set the maximum shadow range? because I found that if the object is too far away, the shadow doesn't reach my plane.

Haddd

 HShadowVolumes.AddToCache = true;

You know that shadow volumes are builded from the vertex and light position. If you move the light or the object, you must re-build the shadow volume.

When you set AddToCache=true, you tell the engine that stores every new shadow builded. This way, when the engine needs to build a new one, first take a look at the list.

The problem is that the engine compares the position this way:

       
static Vector3 VectorRounded(Vector3 v)
       {
           return new Vector3((float)Math.Round(v.X, 1), (float)Math.Round(v.Y, 1), (float)Math.Round(v.Z, 1));
       }


So, of course there are some problems with it. It's good for the example, but for some different cases it's not ....

Haddd.Scene.Shadows.UsePCF = true;

For shadowmapping, tells the engine that uses Percentage Close Filtering. But does not work for stencil.

Haddd.Scene.Shadows.Shadow_Bias = (value);

Not used. I must remove it.  :(

and for the shadow range, you should use the property:

meshobject.Mesh.ShadowVolume.ExtrusionConstant

(ole)  

auron

 Thanks a bunch haddd. :D

But one thing I noticed is that if the camera is underneath the shadow, the shadows become rather screwed up... Is there a way to get around this?

Cheers

Haddd

 You must set the Depth fail option ( DepthPass=false) , but we have problems with it. The object that makes shadows appears shadowed and it should not.  :(  I took a look a lot with it but i can not see the bug...

auron

 Yeah setting DepthPass to false creates some shadow gitches that can be seen pretty easily at certain angles.
I took a screenshot and the shadow near the middle is missing a whole piece.



But the "underneath" problem isn't there anymore.

Any idea why the shadow appears that way when DepthPass is set to false?

Haddd

 Nice volumetric light  :P

Shadows, shadows...I will take a deep look at the Depth fail algorithm.... O_O  

auron

 Thanks Haddd... :D

Another shadow problem I encountered...
Here's the scenario:

I created many glowing balls with a red light each attached to them.
I placed a directional light that rotates when I press a key so I can change the global light direction.
The problem is that at certain angles, the light attached to certain balls are "turned off".

Here's some screenshots:





Notice the balls on the top right. The light attached to them doesn't emit any light when my directional light is adjusted.
The third line of text on the top left corner is the current X angle of the directional light just in case you need to know.
Also I noticed that when I rotated the light, the X value isn't wrapped down to 0 after PI.

You think this might cause overflow problems in the future if the number gets too large?
Would it be better if you wrapped the angles?

EDIT:
I managed to resolve the issue by setting the directional light not to cast shadows.

Haddd

 Very nice image... :P  

auron

 Thanks! :D Expect more though! B)

Oh yeah, you think the angle wrapping is a good idea Haddd?
Bringing it down to 0 to PI.

Vicente

 Auron, don´t tell anyone, but I think you are giving them a good work ;) (I´m scared now to release the AI things :P). Greetings!

Vicente

auron

 Thanks a bunch Vicente... :D

That's encouraging.. I'm gonna try to model some stuff and put it in the game...

I'll need some ragdoll templates too so i'll try my hand at that when I get confident enough.

Haddd

 Solved the coplanar issues with depth fail. Please send me the scene and the code to test the directional lights problems.

auron

 Sorry I took so long... :( I'll send it to you right away... What email addy you want me to send it to?

Haddd


auron







Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.