[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] shadow demo



cool!  It's so good that you fixed it in 5 minutes.  Must have been
processing in the back of your head :)  I love it when that happens.

Have you done rendering to texture for increased shadow map
resolution?  That would really give it a nice quality boost.

ps.  if you wanted to include references/credits for shadows, the code
I posted last has a list of urls at the top, including a link to the
original article some of the code came from.



On Mon, Sep 15, 2008 at 10:31 AM, Ian Mallett <geometrian@xxxxxxxxx> wrote:
> The algorithm is the same--shadow mapping.
>
> What have I changed?  Hard to say.  Here's what happened:
> -Since beginning PyOpenGL programming nearly two years ago, I always wanted
> to make something using shadows.  When I first started, I was still
> unfamiliar with Python, though I had been doing stuff with PyGame for a
> while.  For a month or so, making shadows was way beyond me (I was
> struggling with gl windows and other random stuff)--which is not to say I
> didn't try.  Naturally, nothing really came of it.
> -Skipping ahead a year or so, but still about a year ago, I FINALLY got a
> PyOpenGL shadow demo, but it didn't work because it used PyOpenGL for the
> matrix multiplication, and that was broken for some reason.
> -After that was sorted out, I had a working demo, which I refined down to a
> module about 1/3 the size of the original which could be tacked onto
> anything.  It worked brilliantly--as long as you were using the objects
> which came with the demo (the purple triangular thing and the green
> landscape).  I tried my objects--a cube and a randomly generated terrain,
> but they didn't work.
> -I couldn't figure out why, and for a long time, the project sat, annoying
> me.  This must have been several months.  Throughout all this, I had been
> trying to make shadows in one way or another using various code--the final
> count is 26 attempts at shadowing!
> -Yesterday, I tried fixing it again, and within five minutes had isolated
> the problem to the object texture code.  As my objects were being drawn, the
> texture was disabled via a misplaced glDisable() call.  Turns out
> GL_COLOR_MATERIAL works even if GL_TEXTURE_2D is enabled, so the call wasn't
> necessary and it was breaking shadows because shadows use a depth texture.
> Stupid errors like that annoy me.  From there, I emailed everyone here and
> it was only a matter of a few hours to release 'OpenGL Library'.
>
> Ian
>
>