Mar
26
2009
0

My father… was a programmer… and a fiend…

Stencil BufferRecently I’ve been working on some functionality on one of my own games. The main problem I’ve been having is gDEBugger is no longer in the Beta stage for the Mac, and so my temporary license has run out. At some point I do plan to buy a license, but for the moment I’m limited to my own OpenGL debugging.

So I got inspiration to make a shader to render my stencil buffer for easier debugging. It works like this, after reading the stencil from my Frame Buffer Object (FBO), I render it to a fullscreen quad. During the Fragment Shader process, I read the pixel from the stencil texture, separating a single component (I choose red), I then use this to sample a pixel from a 1D texture (256 pixels wide since the stencil is 8bit, each with a unique colour).

Depth BufferThere are other applications I found for this, such as rendering the depth buffer as well, usually the depth buffer is practically white, and make it difficult to see objects far away. Of course, using many colours to do this, make it almost impossible to understand it. And because its a 1D 256 pixel texture, it doesn’t show the full range of depths since the depth buffer I’m using is 24bit.

It does demonstrate however how the depth buffer gets less accurate the further away an object is. the colours get further and further apart. This can be remedied by increase the number of bits a depth has, or reducing the difference between the near and far plane. Or you could do multiple renders (back to front) rendering the different distant objects, clearing the depth buffer after each render.

Though that is a little overkill. I do love the effect of the stencil buffer shader on the depth buffer though, reminds me of Commodore 64 crashes.

Written by Kaluriel in: Code, Courage, Programming | Tags: ,
Mar
23
2009
0

iPhone 3.0

iPhone TetheringApple recently released the iPhone SDK for 3.0, which for developers means that they can get an early release for version 3.0 of the OS (though it is possible to get ahold of the OS without being a developer through shady means). One great thing about this, someone browsing around the new iPhone OS found tethering, a much wanted feature of iPhone since its first release.

And so as usual, a fake upgrade was made, which enables it. I’ve already gave it a whirl myself, and it works great. However, I haven’t ran it for extensive periods since there is nothing in my O2 contract about tethering, which means O2 could charge me for using it. I wonder if there is a way I could get it added in…

I look forward to the actual release of tethering. There are still many other great features being introduced in the iPhone OS 3.0 for me to play around with, and I don’t really need tethering at the moment, everywhere down here seems to have WiFi close by. Maybe I should get a WiFi detector instead.

Written by Kaluriel in: General | Tags: ,
Mar
23
2009
0

Memory Leaks

On the way home tonight I came up with a method of memory leak detection. The problem with memory leak detection, is if you have objects still active, your list of unallocated memory can be quite big, and if its a small leak, it can take a long time to track down. So as well as storing the filename and line number, I thought, why not store the “this” pointer for objects.

Now when allocation happens again on the same line number and filename, if there is an allocation for the current “this” object matching these, then allocation is happening again on the same object.

There is a problem with this however, loops that allocate will flag as reallocation without deallocation. These can be ignored though if care is taken with the objects that are doing this.

Written by Kaluriel in: Code, Programming | Tags: ,
Mar
17
2009
0

gDEBugger

gDEBuggerI’ve recently been taking part in beta testing the new gDEBugger for MacOSX. A fantastic program that for those who have used GPAD when developing for the PS3, or PIX when developing for the XBox360 will find familiar.

It gives details information about bottlenecks in your rendering, things that may be wrong, state changes that weren’t necessary, etc. And another useful thing, it allows you to view your textures, their mip maps, your frame buffers, and more importantly, depth and stencil buffers.

Today the license I was given expired since it is now out of beta and available to buy, though they were kind enough to give me a promotional code that would give me 15% off when I purchase.

I recommend it to any OpenGL developer, its helped improve my own game engine by showing me flaws in what I was doing.

Written by Kaluriel in: Code, Programming | Tags: ,
Mar
11
2009
0

Maya, Textures and Bloom

Stencil and BloomI recently finished my COLLADA to Geometry converter (Donatello). Now I can export a scene from Maya and convert its geometry as well as create a scene file (the scene file contains a list of geometry files to load, how many instances, and their transformation matrix in the world). There is a bug though, the way I created the ground, when triangulation is happening, the normals appear to get broken and cause different shades on the ground.

I also created a program to convert images into a texture which contains information about its width, height and depth, as well as create mipmaps. It doesn’t at the moment support compression, I’m starting to think maybe I should use dds files since I recently found out that they can be used with OpenGL (if you have a DirectX header). For now though, it works, and so I’ll keep using my own format.

I’ve also been modifying my bloom algorithm, this one seems to work a lot better with my scene. I’ve noticed my messing around also gives a great refraction effect (see the red area).

Written by Kaluriel in: Code, Programming | Tags: ,
Mar
04
2009
0

Hueco Mundo and Burritos

Hueco Mundo MovitationalToday I’m one step closer to being old, I setup a pension. Next year I’ll be 1/4 of 100 year old, which is quite an achievement to last this long, especially with the amount of cars that I’ve nearly been hit by when crossing the road without looking. I’ve survived a burst appendix with three days of septicemia, and I have yet to break a bone in my body, kudos to me :D.

Not enjoying Fallout 3 that much, it was fun taking on Super Mutant Behemoth, and now I have the Fat Man, I think it was called that, a mini nuke gun. But I don’t seem to be any better off than when I just let Vault 101, however I did get a quest to allow me to set off the nuclear bomb inside the town of Megaton, which I might do after I finish all quests there. Still I’m going to play this til the end, then probably sell it on if I haven’t fell in love with it by then.

I’ve been recently working on using OpenGL with Cocoa, rather than using GLUT to do everything, better to learn how Mac OSX works rather than rely on a flawed framework. There is a great lack of any tutorials, or demos of this, everyone just seems to use GLUT, so I’ll probably popup a few vidoes and a tutorial, my YouTube account doesn’t get used for much, so it’ll be a nice change.

Stars' RestI also recently went back to Wrath of the Lich King, my friend Pete gave me access to the Beta when they were testing it and I enjoyed the Death Knight stuff, and recently I got a 10 day free trial, so I bought the expansion and I’ve been playing it. Its quite fun, I think its just a change of scenery, I actually spent ingame gold giving my character a haircuit so I wasn’t using the sameone I have been since the game started.

Unfortunately, the gameplay is still the same, with what I saw of the Death Knight stuff when playing in the Beta, I hoped for more. One thing that annoys me alot is the fact that Daralan is flying, and you need to have been there once to get the FP. Two more levels…

Written by Kaluriel in: General | Tags: , , ,
Mar
02
2009
0

Fallout 3 and Sonic

Tails hanging out on a PS3 dev test kit

Working late this weekend (and watching the new episode of Skins :D), I decided to finally get Fallout 3, people keep telling me how great it is, and basically put it up on a pedestal. Not a big mistake, but I’m not really enjoying it, I died a few times at the beginning since I couldn’t figure out the equipping system for weapons, I thought it was just the shoulder buttons like in the tutorial when I’m a kid, but apparently not. I have to say though, I did like the VATS system.

Its early days yet, I’ve only just got out of the vault, I think I might go back and change my choices now that I know how things work a bit more, and make some more money for when I reach Megaton by stealing more stuff.

All was not lost though, I found a Sonic teddy in game that when I bought it came with a free mini Tails (who I recently discovered has ! for eyes). Childish I know, but it personalizes my desk at work. And whilst at work I found a great 2D version of Team Fortress 2, called Gang Garrison. Hopefully I’ll get a few games out of that at work with Mashed as well.

Kate called me the other day and told me I had been tagged in a picture from school, and here it is, though I’m sure that isn’t me, apparently everyone else thinks it is. Maybe it is, my memory is not what it use to be about then, all corrupted and stuff. I’m behind Pete, Don and Kate.School

As mentioned in the caption above, we’re finally on the PS3, which I’m starting to like more and more for developing with, despite a few problems I’ve had with crashing it.

I also starting play Dead Rising again recently, though I stopped when I remember how annoying survivors are. I think I might just play through and get stories, screw the survivors, let them die with their own stupidity, always relying on me to save them when they have a baseball bat or a shotgun in their hand. OOoo, just remember as well, Mass Effect 2 trailor, looks like Sheppherd is dead :O

YouTube Preview Image
Written by Kaluriel in: General | Tags: ,

Theme: TheBuckmaker.com Blog Themes | The best Webhosting Plans, Eigenes Internet Radio