Shadow Mapping Need Help!!

Ok so i’ve held out as long as i could, I need help. I am trying to make a simple shadow mapping shader. I’ve seen quite a few, but they are way over done for what i need. Also i cant get most of them to work in the newer blender builds.

I found this file a few days ago, and i basically re wrote it. I seem to have gotten the shadows to work, but the shadow acne is bigger than what i’m seeing in all the images online. I just need to tone them down a little, everything else seems fine.

Question 1: Why are the fringe patterns so thick? Seems like there is a problem i’m not aware of (using a 512 img size. and making it bigger doesnt change the pattern)

Question 2: How would u make this in perspective view?


my file


reference example


shadowGLSL3.4.blend (597 KB)

well dunno much about shadows except that i always got problems with it aswell, but compared to your 2 pictures:
pic 2, has the bias option to low.
pic 2, uses another hemi lamp to make shadows lighter.

pic 1 uses 1.0 normal maps? set it at .5 and see if that helps but probably an additional hemi lamp to light up the scene a bit would help

I need it for a level i made that has a custom shader. There is no lights, its custom made i"ll add the material color , but i’d like to solve this. it seems wrong. I 'm noticing the fringes are way fat id like to bring the closer. Was reading about texture.filters() i think it has something to do with it.

Credit to HG1, Youle, A Dog for the base work and giving me an understanding of how its done. couldnt have done this file without there wisdom.

dang. this is killing me. I cant figure it out. I’m sure someone knows. bumpy bump.

What’s the original script? With the original I might be able to compare it to yours, maybe rewrite it a bit or do something to help you out.

Nice Job getting this working, I’ll look at it and try and figure out how to fix this.

Why you want to render your own shadowmap? You can also use blenders shadowmaps:
There are also shader examples.

Thanks, had no idea that was available.