Archive for July 29th, 2011

The marvelous world of shaders

Posted in Development on July 29th, 2011 by PeterW – 2 Comments

You might have noticed that OpenClonk’s model rendering code is able to provide nicely detailed graphics even when you zoom in. The landscape however looks like this when zoomed:

Click me for full resolution!

This is because the landscape of Clonk is stored like a raster graphic – if one zooms in, it becomes blurry or pixelated.

If you look around in our forum from time to time, you might have noticed that PeterW has been playing around with a pixel shader to implement a scaling algorithm, namely the hq3x. The result of his work looks like this:

Click me for full resolution!

Notice that his shader not only scales the display of the landscape very nicely but also implements a simple lightning model similar to the lightning in Clonk Rage.

PeterW implemented the feature in the engine already. So to test this, just grab a recent development snapshot and enable the option “High resolution landscape” in the options. Should you encounter rendering problems, post it in the forum (with a screenshot)

By the way, the shader code can be found in Graphics.ocg/LandscapeShader.c, so each scenario can theoretically define it’s own shaders for awesome effects.