Wednesday, 17 October 2012

Shadow Volumes with LWJGL

 I've had a frustrating few days trying to get shadow volumes working in LWJGL, mostly through my inability to cope with math these days, but also the lack of resources available.

As always I came across lots of forum posting asking for help but few answers.

The main resource was: NeHe Lesson 27

There is a link to a LWJGL port down the bottom, but this doesn't work.

After some searching I came across some fixes by Fool Running in the LWJGL forums: Forum post

However this still didn't get it working, so a few hundred web pages and a lot of attempted fixes later I stumbled across a small change:

        Display.create();

Becomes:

        Display.create(new PixelFormat(8,8,8));

This is what is should look like in the end.


The fixed source can be found here:  http://www.flyingkakapo.co.nz/Code/Lesson27Fixed.java

And the rest of the required files (Some object text files) can be found at the bottom of the NeHe page, as past of the LWJGL zip.

If you have any trouble getting it going leave a comment here and I'll probably be of no use! :P

No comments:

Post a Comment