2 pssm shadow problems

Posted By: sivan

2 pssm shadow problems - 11/14/12 13:32

hi

I found 2 - as I know previously not mentioned - problems after started with pssm shadows:

1) I think I made my "fish shader", by adding 3 lines to animTree.fx, to have nicer tree leaves (and it really works well normally), the alphatest results in disappearing shadows in certain camera angles (if alphablend true it works without errors):
Code:
technique animTree
{
	pass 
		{
			ZWriteEnable 		= True;		
			AlphaTestEnable 	= True;
			AlphaBlendEnable 	= False;
		   
			VertexShader = compile vs_2_0 animTree_VS(); 
		}
}

is it possible to use it after the alpha support will be added in next update to pssm shadows or I need a pixel shader to be applied?

2) if I use mirrorWater.fx, shadows are clipped on very short and at a certain far distance. the close clipping is disturbing, the far one is not a big problem. if the same level is without water, everything is okay.
Posted By: jcl

Re: 2 pssm shadow problems - 11/15/12 09:31

I can not confirm the animTree problem here, maybe it's in combination with something else. Can you upload the project or send it to Support? We'll work over the PSSM shader for the next update anyway and will look into the matter.
Posted By: sivan

Re: 2 pssm shadow problems - 11/15/12 10:39

you are right, when I run a simple test level I see no errors...

both problems are appear only in my editor, but even beside removing all other shaders, so the reason must be something tricky...

thanks for checking it anyway.
Posted By: sivan

Re: 2 pssm shadow problems - 11/15/12 22:12

okay, I think I found the reason, the errors were not really my fault, the answers are within shadows.c in this part:

Code:
while(!level_ent) wait(1); 	// wait until the level is loaded
level_ent->flags |= SHADOW;	// enable shadow on level geometry
// calculate a minimum sun distance for placing the sun slightly outside the level
sun_angle.roll = 1.1*maxv(vec_length(level_ent->max_x),vec_length(level_ent->min_x));



1) I normally use a NULL level, initialize terrain settings when created (including set(my,SHADOW);), but run PSSM later, during test mode only. this error was caused by wrong terrain SHADOW settings, so the first lines could cause it.

2) this error emerged in case of high pssm_splitweight values, and was much worse in case of large levels. probably water entity also increased level size, and Sun distance is level size dependent. if I use a constant or as a better solution a clip_far dependent one, everything becomes fine.

I can upload a little demo if you are interested mainly because of case 2), but I think it is not essential.
Posted By: jcl

Re: 2 pssm shadow problems - 11/16/12 07:36

Ok, I think the problem seems clear - shadows are wrong when the loaded level has a wrong size, such as a NULL level.

Make sure to load a level with correct size when running PSSM. Otherwise there can be other problems too, for instance slow rendering due to a wrong ABT.

Posted By: sivan

Re: 2 pssm shadow problems - 11/16/12 09:06

okay, NULL level is more practical for development, but I can make a wmb at least of my ground and water terrain, thanks.
© 2024 lite-C Forums