Tuesday, November 13, 2012

JavaFX Field Validation

This post won't be about OpenGL, it will be about JavaFX. I'm currently writing a tool in JavaFX and wanted to give the user visual feedback about the validity of fields (mainly TextFields). I came across this post but while it achieves what I had in mind, it is pretty verbose and you would have to define everything over again for multiple fields.

I wanted to do a more generic version of what I had read and this is how it is used:


Valid Textfield


Textfield with warning


Textfield with error

Monday, March 19, 2012

JOGL Part 3 - Shadow Volumes

Next: Shadow Maps

This section will be about one of the shadow techniques I've used in my project: Shadow Volumes. This method was mostly popularized by id Softwares Carmack and Doom 3. While it has pretty much vanished from todays engines (unreal engine 3 still supports them, maybe others), it's a perfect example on how shadows can add to the atmosphere.

First some moving pictures:


Sunday, August 7, 2011

JOGL Part 2 - The Deferred Renderer

In this part I will write about the deferred renderer I use and how I configured it. But first things first: what is deferred rendering? It's an alternative to the "standard" forward rendering method. When I first used OpenGL I (and I think many others) used this very simple method:

foreach Object o
  render Object o with all lights
 end
 
Simple Forward Rendering

Every object gets drawn with a shader that handles every light source in the scene. A major drawback of this method is that its very hard to handle large amounts of different lights (point-, spot-, ..., directional lights). The shader will soon have a loop around many "ifs" to determine the correct light formula. That's not very optimal. It gets even more complicated when shadows are added to the scene.

One way to simplify this is to use a multi-pass method. Objects will be drawn multiple times with different shaders and lights. This could look something like this:

foreach Object o
   foreach Light l
    if o is in lightradius of l
     render Object o with Light l
    end
   end
  end
  
Iterating over objects
foreach Light l
  foreach Object o in lightradius of l
   render Object o with Light l
  end
 end
  
Iterating over lights

This method simplifies the shader management. You can have different shaders for different light sources. But there are still drawbacks. Both methods use a nested loop for lights and objects - if one light or object is added to the scene, everything has to be drawn again.

Deferred rendering separates the drawing and lighting of objects into two passes. First the objects are drawn into an off-screen buffer. Then this buffer is lit to achieve the final scene. In code terms, it's something along those lines:

Monday, July 25, 2011

JOGL Part 1 - Introduction

This is the first post about the project I've done at an OpenGL course at my university. The course was about "OpenGL with Java" and used the JOGL library to interact with OpenGL from the Java side. Why Java? Why not. Today even JavaScript is able to interact with OpenGL.
Here you can see the final result:

Saturday, July 23, 2011

Getting Started

And now I go where everyone has gone before... the Internet! To write about stuff which hopefully interests some people.
Who am I? A German student currently on my way to achieve my Masters Degree in Computer Science. What will this blog be about? Everything related to my developing experiences. The first posts will be about an OpenGL project I did a while ago and all the techniques I used in there.

Stay Tuned!