Skip to content

Java OpenGL engine with forward/deferred rendering, real-time shadows, and SSAO. Started as a 3rd semester project at Carl von Ossietzky Universität, Oldenburg for OpenGL mit Java. Continued in the 4th semester as part of the OpenGL Praktikum.

License

Notifications You must be signed in to change notification settings

AndreiBarsan/Yeti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Yeti Java OpenGL Engine

Summary

This engine is a personal project of mine, so it's not really recommended for serious projects (like for serious game development endeavors). I try to document it decently, so one might learn a couple of things from it. Or at least learn about what nasty hacks to avoid in the future.

Looking forward to any fork! :)

Renderer screenshot

Here's Yeti with a few Bioshock models loaded | (deferred renderer).

PlanetHeads screenshot

This is an example of a (very) simple platformer game showcasing the engine.

Deferred rendering screenshot

Another screenshot of the deferred renderer operating on a relatively large number of lights in a scene (39).

Running the thing

The project used to be quite easy to build. Now it's even easier, since it uses Maven.

  1. Clone repo.
  2. Load the project in Eclipse. It should figure out which jars to use thanks to pom.xml.
  3. Run either barsan.opengl.tools.DeferredTest or barsan.opengl.planetHeads.Game
  4. Note that Java 7 and OpenGL 3 are needed (the GL3bc profile, actually - which is why the project doesn't work on most Macs due to them only supporting either GL2 or GL3)
  5. If the game crashes, it's very likely because:
  • your video card doesn't support a certain feature;
  • your video card has stricter shader compilation rules and chokes on something;
  • in both cases, it would really help to open a ticket on the issue tracker here on GitHub!
  1. If it's runnig, congratulations, you got it going! Remember, pull requests are always welcome! :)

Of course, Eclipse isn't required to build the engine. You can javac it, no problem, you can use a different folder for the libs, and so on.

You can also open the project in IntelliJ and it should "just work". Running ./src/barsan/opengl/editor/App.java is a good starting point, and so is the DeferredTest scene.

Features

Among the most important features implemented so far are:

  • forward and deferred rendering (using stencil tests for light receiver culling)
  • basic Wavefront *.obj loading
  • vertex interpolation keyframe animations
  • phong lighting model (with directional, point and spot lights)
  • normal mapping
  • skyboxes and environment mapping
  • shadow mapping (for all light types - omnidirectional shadowmaps generated in a single pass using a geometry shader)
  • simple and axis-aligned billboarding
  • scene management
  • multipass rendering with post-processing support (right now used for FBO-based multisampling and a naive SSAO implementation)
  • simple 2D platformer physics

Miscellaneous things & philosophy

First and foremost, this is a learning experience. I am learning OpenGL as I'm writing this, so don't expect the engine to be in any way clean or optimized. Some things worth noting are the major roadblocks I've hit (and overcome!) while developing this project - for most of them, I've left some sort of "monument" in the source code, describing the nature of the problem and how I've fixed it. I find that by actually writing this down and then seeing it over and over again helps you remember common mistakes that you've made and thus helps you avoid them in the future.

I obviously don't recommend doing this in an actual serious project (that's what bug trackers are for!), but I like to use it in small personal projects.

The code is designed to fail as often as possible. And by that I mean that whenever it detects something that's wrong, it instantly crashes telling you what went wrong. It doesn't struggle to chug along at any cost. Again, for a professional project this might not be the right technique all of the time, and you'd probably want to have some sort of crash recovery system in some of the cases.

License

Yeti is licensed under the BSD 2-clause license.

Copyright (c) 2012-2013, Andrei Bârsan All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The JOGL source code is mostly licensed under the New BSD 2-clause license, however it contains other licensed material as well. See the jogl.LICENSE file for details.

About

Java OpenGL engine with forward/deferred rendering, real-time shadows, and SSAO. Started as a 3rd semester project at Carl von Ossietzky Universität, Oldenburg for OpenGL mit Java. Continued in the 4th semester as part of the OpenGL Praktikum.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published