LWJGL Shadow Mapping - Helper Class?

Whenever I’m reading tutorials about advanced topics in OpenGL, I always wonder… why didn’t they just create a class which encapsulates the functionality, and all you have to do is call some setters, and then specific methods during different times of rendering?

Call me lazy, but when all I want is code to plugin, and all I get are dozens of tutorials that repeat the same thing and all have code examples that are written specifically for their scenario and not a generic one it drives me bonkers! Something that hasn’t really changed doesn’t need umpteen tutorials! how about a class which does all the heavy lifting =P. I just want to be able to pass a few parameters in (camera direction, up, right, etc) and have it do all the work.

So… now that I’m done ranting, does anyone have a class like this they use for shadow mapping and LWJGL?

Thats why we use game engines. If you don’t feel like feeling with the low level stuff, find an engine and use it. OpenGL is obviously a low level library, people use it for different reasons. Some for games, some for modeling etc… They can’t just have a one class fits all sort of solution. Its not going to happen because thats not why opengl exists.

Yep; don’t expect a [icode]HelperClass.createCoolShadowsForMyGame()[/icode] function. :wink:

JMonkeyEngine has some shadow mapping, though I’m not sure how well it will perform on mobile. Mobile and WebGL usually need some much different treatment; such as depth packing in the shader. Though now depth textures should be supported in some browsers, such as Google Canary.

Game engines require you to use more than just the piece of functionality you want.

Given there are only so many variables that need to be set for rendering shadows, there can be one class fits all sort of solution. (it doesn’t even need to fit all, just most cases).

Awww come on, why not?

I heard it’s as easy as glEnable(LIGHTING_AND_SHADOWING);

No. You can’t have a one class that fits all or only some because thats not how OpenGL was built. You cant say some people want pixel perfect shadows and thats what we are going to do. Some people might want different shadow types, and then they’ll have to make their own class. See how this works? People have different ideas. The only reason Java2D can get away with this is because its regarded as a very specific library. You can do this with it, but you cant get more in depth with it. OpenGL allows you to get down to the very core of graphics and do what you want with it. Why would the OpenGL team make something that restricts you to one way of using it? OpenGL is used for so many different things that they just wont do it. glEnable is used for the fixed function pipeline, and doesn’t let you change anything about how it works. Is that how you want OpenGL to be, then go find a game engine.