2d Shadows (OpenGL)

BlitzMax Forums/BlitzMax Module Tweaks/2d Shadows (OpenGL)

klepto2(Posted 2005) [#1]
With the help of some people in the German Forum I have written a small 2d Shadow Module.

It is based on OpenGL so it doesn't work with DirectX.

It is very easy to use.

The light system is adapted from FredBorgs perPixel Lightning System.

Content:
- Circular or N-Shaped ShadowCaster
- Lights with different Color and Range
- Each Caster or Light can be moved
- N-Shaped Casters could also rotate

The module plus small Sample can be downloaded here:

http://www.blitz-pasting.net/index.php?content=bp_showupload&id=317

And a scrennie:



Currently I try to implement SoftShadows. If someone could help me with this please post it here.

Thx


tonyg(Posted 2005) [#2]
That is VERY VERY good.
I guess you've seen this...
Dynamic 2D soft shadows


klepto2(Posted 2005) [#3]
Yes, I already know this article.
Unfortunatly this system is based on the Zbuffer, so I dont know how to implement this exactly.


tonyg(Posted 2005) [#4]
I can't admit to understanding that article completely but, for the soft shadows, he's using textures.


klepto2(Posted 2005) [#5]
Sorry, I have read it again, and your right. I will try to implement it.

Thx.


tonyg(Posted 2005) [#6]
Is there a way to draw the lights so they 'override' the shadow? At the moment I can have a light in shadow.


GW(Posted 2005) [#7]
Im only getting 1 fps for this, is that normal?


tonyg(Posted 2005) [#8]
I was getting 175+ on 9800pro.
Do you have problems with other OGL programs?


klepto2(Posted 2005) [#9]
@GW: Unfortunatly some cards doesn't support the Accu Buffer.
I will try to find other ways to solve this problem.

@TonyG: This Module is on a very early stage so I will build some more things in, like Spotlights and also Overriding of the Shadow.


GW(Posted 2005) [#10]
I have a ti4200. it plays doom at decent framerates. So its just me?


TartanTangerine (was Indiepath)(Posted 2005) [#11]
This should be pretty simple to convert to DirectX, you could even add a soft shadow texture to the projected polygons using my DrawTexturedPoly command for directX.

If I find the time I might have a got at this.