PCF Soft Shadows in the BGE

From my blog post here: http://mogurijin.wordpress.com/2010/08/14/pfc-soft-shadows-in-the-bge/

Last night I had decided that I wanted to take a look at what it would take to get some better looking shadows in the BGE. After doing some reading on soft shadows, I implemented PCF soft shadows in the BGE. Here are my results:

PCF Soft Shadows in the BGE
Currently the only user control over the soft shadows is the sample size which is controlled by the softness value. The number of samples is hard coded to 16 (4×4).


looking good:RocknRoll:

I’ve heard of PCF (Percentage Closer Filtering) soft-shadows, but never PFC.

Is that some new method?

Looking good.
Would that work on planes with alpha textures for example? Or the shadow would take the shape of the solid plane?

Wow, amazing how much spare project time you’ve been finding even with your ongoing GSoC project.:eek:

Your work with custom shaders and other things will push the BGE’s graphical capabilities over that of some commercial engines (especially combined with the OpenCL particles project)

You’ve been investing a lot of time improving the BGE’s graphical capabilities, do you plan on working to improve the speed of the BGE’s current renderer as well?

Thanks for pointing that out. I guess I should have double checked the name before posting it every where. :stuck_out_tongue:

It does the same thing as current shadows, it just samples it to make them nicer.

@Ace Dragon
This was a one night break from GSoC. :slight_smile:
As far as speed goes, I want to tackle 2D Filters after my GSoC project is done.

Thanks for the feedback.


Do you have a patch for this? I would like to test it on an ATI card with OSX drivers.


cool, will check it out once there is a windows build available =)

Very good moguri, you are one the best! with your implementations BGE is getting better and better, thanks to care about!
Im very happy that some few guys like you are making this nice things possible.

can somebody make build please???

Any chance of a Linux build (or sources)?

wow it looks cool, Im not sure how to execute the script if any one could help me with that. Do I have to use the actual python program or blender?

:smiley: Looks awesome! I’m going to grab a copy! Argh! XD seems I was too hasty :stuck_out_tongue: