The most understated game engine

Gamekit is fully compatible with Blender, runs on Windows, Mac, Linux, iOS and Android, and uses a completely non restrictive license so you are free to sale your game without worrying about copyright issues.

Chances are, you’ve never heard of Gamekit.

Despite a simple website, and a whole bunch of confused users who want to try gamekit but don’t know how, gamekit is pretty darn functional already. Within half an hour, you can make a simple 3D game that compiles and runs on an iPhone. It also supports shaders, physics, animation and lua scripting. If you a looking to replace the Blender game engine with something lighter, faster and more modern, take a look at this game engine.

Sure the documentation is a little sparse, but as more artists start using this engine, hopefully we’ll see more literature on the topic.

Realtime GPU accelerated raytracer

I discovered a lot of mind-blowing technologies this week. First I test-drove Ian’s OpenCL fluid particle implementation by pushing 1 million physically-accurate fluid particles around in realtime. Then I  ran across this jaw-droppingly detailed 3D map. And now, thanks to Brecht’s latest work on the Cycles rendering engine for Blender, I am doing raytracing on the GPU in realtime.

Above is a rendering of my ubiquitous BMW.  The total rendering time to get to this quality is less than 40 seconds. (Compare to over 3 minutes using the old Blender renderer) Even more impressive, is that the rendering takes place in the 3d viewport directly, in a progressive fashion.  So one can edit the scene while the rendering refines itself.

No more F12, rendering just went realtime Yo.

Jaw-dropping online 3D Map

“Any sufficiently advanced technology is indistinguishable from magic.”

 

Paul Debevec published his seminal work on image based modelling in 1997, just over 14 years ago. By taking multiple images of an object from different angles, he was able to reconstruct the 3D geometry of the bell tower at  UC Berkeley.  Programmatically generating 3D models from 2D images!  It was so revolutionary at the time that the sfx team behind the Matrix movie worked with Paul to use this exact technique in the film.

Pretty impressive eh?  Now imagine going this for an entire campus, or an entire city, or the entire world.  Without human intervention. At 10cm resolution.

This is what C3 Technology and Nokia came up with, and it runs inside a web browser.

A better writer might be able to describe to you the magnitude of what you are witnessing, but I am truly at a loss at conveying the significance of this to the future of mapping.  Click on the image to see the demo for yourself.  You’ll need to install a plugin, but it’s well worth the trouble.  Someone less technically might not fully appreciate the complexity of what’s going on behind the scene, and as someone who only knows enough to be dangerous, I am still not convinced technology like this even exists today.

Wow.

Some more shader experiments

After seeing Ian’s latest update on his awesome particles system, I am shifting the focus of my own project a bit, moving away from the goal of making an entire particles engine in the shader to something more attainable: use GLSL shaders for what they are designed for: making visual effects.  Below is attempt at making some abstract art using pure code.  The base shape is a simple plane.

You might notice that some of the shader code looks strange, that’s because I am trying to keep things simple by forcing myself to use the latest version of OpenGL Shading Language available on my computer hardware, so for a Geforce 8, that’s OpenGL 3.3 | GLSL 3.3.

#version 120
#vertex shader

in vec4 vertex;
uniform float timer;

void main() {
vec4 v = vertex;
v.z = sin(timer+v.y+v.x)*0.5+v.z;
v.x = sin(timer*10.0+v.y+v.y)*0.2+v.x;
gl_Position = gl_ModelViewProjectionMatrix * v;
}

#==========================

#version 330
#geometry shader

layout(triangles) in;
layout(triangle_strip) out;
out vec2 texCoord;

#define radius 0.01
#define layer 1

void main() {
//for(int i = 0; i < gl_in.length(); i++) { // avoid duplicate draw

for (int j=0; j<layer; j++){

vec4 p = gl_in[0].gl_Position;

texCoord = vec2(1.0,1.0);
gl_Position = vec4(p.r+radius, p.g+radius+j*0.05, p.b, p.a);
EmitVertex();

texCoord = vec2(0.0,1.0);
gl_Position = vec4(p.r-radius, p.g+radius+j*0.05, p.b, p.a);
EmitVertex();

texCoord = vec2(1.0,0.0);
gl_Position = vec4(p.r+radius, p.g-radius+j*0.05, p.b, p.a);
EmitVertex();

texCoord = vec2(0.0,0.0);
gl_Position = vec4(p.r-radius, p.g-radius+j*0.05, p.b, p.a);
EmitVertex();

EndPrimitive();
}
//}
}

#========================================

#version 330
#fragment shader
in vec2 texCoord;
out vec4 outColor;

uniform sampler2D col;
uniform float emit, alpha;

void main(void) {

// load color texture
vec4 color;
color = texture2D(col, texCoord);

// apply material panel values
color.rgb *= emit;
color.a *= alpha;

outColor = color;
}

 

The first section, the vertex shader, is executed for each vertex of the geometry, it is here that I apply the deformation to form the base shape of the particle systems.  The resulting coordinates is projected from modelspace onto viewspace.  This is important, because it saves the next step from becoming overly complex!  The geometry that follows is able to do per-primitive operations on the vertex, here I take each vertex from the previous stage(which is already projected into viewspace), and ‘expand’ that into a billboard by creating a quad for each point.  The quad naturally faces the camera, since everything is already in viewspace.  The final stage of the pipeline is the fragment shader, which applies a texture onto the quad.

One blatant oversight of this approach is that it does not take into account the viewport aspect ratio, thus the generated particles will only look square on a 1:1 canvas.  None unity aspect-ratio will stretch the billboard.

As you can see, the code is very short, but being GLSL, the program is executed on the graphic hardware, which is highly tuned for this type of computation.  Freeing the CPU to do other things.

Multi-language support in Blender

Dalai Felinto had been working on teaching the old Blender Game Engine some new tricks.

With this patch, the Game Engine can use the native  Blender ‘text’ object type in the game, this means you can reuse the same text object inside the Game Engine, without having to fiddle with custom bitmap textures.  Further more, the text engine is now thoroughly Unicode aware, with the right font, you can make Blender talk in any language you want(as shown above).

Oh and in case you are wondering how get that Sony CrossMedia Bar effect in Blender, click here.