the stupidest way to get pixel shadows but...

Blitz3D Forums/Blitz3D Programming/the stupidest way to get pixel shadows but...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

10 seconds loading is a long time if you can prerender t and include the image in the distribution.

I love this kind of raytracing since it makes everything soooo very easy. don't care about normals etc. simply darken a pixel. Unfortunately this is dead slow. It may be used to create nonlinear renders, but for games design it's just too slow. I even made a test and replaced the linepick with a renderworld using a 2nd camera with a viewport of 1*1 pixels and believe it or not, it was almost as fast as the linepick (about 90%). You also may use some soft linepick replacements, I guess there is something in the archives, it may or may not be faster.
There are some possibilities to optimize your code (eg. no pivot required, just use a linepick from the picked coords to the lightsource), but even then it's still way too slow.

There are some other possibilities we have figured out over time, and believe me, a lot of people used to hack for hours to find something fast.

The thing that seems to be the fastest is to position a camera at the lights position, color all shadowcasters grey, hide the shadow receiver, take a render and use this render as a lightmap.

In this example:
http://www.blitzbasic.com/codearcs/codearcs.php?code=332
I get about 200 FPS with my crappy machine. It may not be useful for multiple light sources and/or large scenes, but I guess it would look very nice with some kind of wrestling or tekken style game.