Category: Graphics
Making Color From Alpha, Hue, Saturation and Brightness
November 22, 2011 00:00
I find myself wanting to do this sometimes, so here's a bit of code (I'm sure I stole this code from somewhere else);
public static Color ColorFromAhsb(int a, float h, float s, float b) {
if (0 > a || 255 < a) {
throw new ArgumentOutOfRangeException("a");
}
if (0f > h || ...
Read postRBSP Tree for Lightmap packing
October 19, 2008 00:00
For fun, and for the purpose of making a batch texture that can store characters for fonts, I have created a little tree based off this tutorial by BlackPawn. Basically, the idea here is to partition the original rectangle in such ...
Read post2D in OpenGL
October 11, 2008 00:00
After some experimentation, I have finally come to a point where I have written some code that does scaling, rotation and alpha on images that I want to display on the screen. Although the concept of drawing 2D in OpenGL is fairly easy to grasp, in that everything is the same except you don't deal w...
Read postVertex Buffer Objects
September 16, 2008 00:00
In my last post I mentioned that if you wanted to draw a large number of things on a screen, you need VBOs. Well, honestly at the time, I only knew what it was but never touched it before. VBOs are Vertex Buffer Objects, in other words, boxes in the GPU to store vertices, their colors, normals and a...
Read postPlaying with GLSL
August 31, 2008 00:00
After puzzling some time over the tutorials in Lighthouse3D, I finally learned how to prepare a GLSL shader and use it in an OpenGL render. In the beginning I thought a shader could be used on a particular set of vertices and fragments. However...
Read post