And today we have big announcement promised before. On WGK 2011, National Conference on Computer Games Development held in GdaƄsk on 2-4 September we will present live demo of LvxTechdemo. Additionally, all player will take participate in Competition and the best gamers will win juicy prizes such as Lvx serial keys and promotional gadgets.

See you on WGK!

We have been silent for some time, but don’t worry! Development goes on and in fact we are about to release a playable demo. We’ll publish more info really soon. Meanwhile, I find this image pretty. It’s data structure called octree, used in UTE editor for some detailing operations.

In the Real World, everything is about photons. In fact, (almost) everything is a light source. It’s just a matter of emission and transmission of photons. For example, when metal wire inside a light bulb is hot enough, it glows. Then we have a glass layer that can be clear or frosted (each creates different effect). Then the light stream is capped by a case of some kind. The result photons are reflected by walls, ceiling and other objects in the room. All those factors allow different effect and/or subtle adjustments which are not possible in realtime GPU graphics.

We can categorize lights in CG graphics into several categories:

  • point light — a light cast by a single point in space that has no volume
  • sphere light — similiar to point light but the light have a volume (size), allowing penumbra effect
  • spot light — volume of light is cone instead of sphere (think of flashlight)
  • directional light — if the light source is far away enough (like the Sun visible on Earth), we can assume that all rays are parallel and attenuation is constant
  • area light — light cast not by a point, but by an area of some kind (for example rectangle-shaped ceiling light)

Modelling such lights is no real problems (however proper shadows are very difficult for some of them, especially area lights). However I’d like to focus on point and spot lights.

Point lights are the simple and very useful, however have several disadvantages: mostly that real-time shadows are expensive, but without shadows there is no occlusion of light (which is unlikely to happen IRL because there must be at least something that light is attached to). This can be however solved by using either shadows or light volumes. The simplest version of (virtual, as there is no material lightsource here) point light looks like this:

The light is visible on ceiling and floor. We can add additional effect if we use volumetric effect — it simulates foggy air being illuminated by the light itself. It’s even more visible if light is small:

Spot lights can be interesting as well. This is the simplest version of spot light.

We can add shadow:

And special gobo texture. This is useful for varying shape of spotlight.

We can of course combine it with shadow:

And add volumetric effect using light shafts:

And finally, all effects combined: spotlight with gobos, shadows and light shafts:

We can also use gobo for semitransparency effect. Here: spotlight with & without shadow:

Now adding gobo:

And some light shafts as well (they can be separated from gobos):

You can also watch video:

New screenshots

Posted February 8th, 2011 in Media | No Comments »

Next part of Lighting post series is coming soon. Meanwhile, you can take a look at two new screenshots in our Showcase:

When the light hits a surface, it bounces. This is a basic fact for all lighting computations. You must also remember that almost everything both receives and emits light. For example if you have colour-painted walls try taking a blank sheet of paper and putting it near a wall. You will notice that paper has caught your wall’s colour (it’s called colour bleeding). By the way, did you know that a sheet of paper in sunlight gives off more photons than a light bulb? (via @ID_AA_Carmack)

And some surfaces are glossy enough to reflect even more light than others. Yet exact nature of those reflections depend on micro-surface properties. Well-polished mirror will give you an exact specular (without distortions) reflection, but some kinds of wood will give you more blurry (diffuse) reflections. And there are other materials that need reflections to look well, for example different kinds of metal.

In 3D graphics we have 2 basic options for reflections and both of them have their pros and cons. First, we have planar reflections:

We can also perturb normals a little bit to highlight crevices in tiles:

Some time ago, planar reflections (without perturbations though) were rather cheap and many games used them for mirrors or floors. However in the realms of more and more complex shaders and Deferred Lighting, planar reflections became very expensive to render. If you want to reflect exact scene you’re looking at normally you need to do lighting, shadows, ambient occlusion and everything else twice — thus doubling amount of rendering work. And in graphically demanding games that is just impossible.

The second option is using cubemaps for environmental mapping. The idea is to take a cubemap from inside a scene and use it for reflections for all objects. This have several advantages over planar reflections: they may be cached — this of course won’t let you have dynamic reflections but drastically reduces CPU/GPU workload. Cubemaps can also be used for all kinds of objects and surfaces, while planar reflection requires additional rendering for every single flat surface we want to be reflective. So cubemapping is the only option for complex, curved objects.

Basic specular cubemapping may look like this:

And we can make if more diffuse (blurry):

But cube reflections are not perfect. They are very crude approximation and this can be visible if you have several objects of the same kind next to each other:

Due to the way that env-mapping works, reflections of each of those cars will look exactly the same:

For some objects/scenes this may be undesirable. However there is a solution for some specific cases. If you restrict reflections to box-shaped room, you may use some clever math to make reflections more accurate:

This looks much better and more exact. However, reflections in current rendering engines are quite complicated and not as powerful as you might wish they would have been. Raytracing (which is now possible in real-time) fixes this, allowing unlimited reflections and refractions. However raytracing doesn’t itself solve global illumination and — in my opinion — its cool reflections are not worth huge performance penalty (unless on massively parallel systems).

And by the way: I’ve also added first Youtube video. So if you can stand my terrible English, you can watch it here:

With this post I would like to start a mini-series about lighting in Lvx (and about lighting in games in general). Each post will cover a specific topic. The first is about ambient occlusion effects. Before we start, I want to notice that those screenshots do not represent actual Lvx game — they are test levels, using some external assets (like Portal textures) and their purpose is just to present some technology (and they are actually programmer’s art).

Creating realistic 3D graphics is hard, because lighting is a very complex process. On the one hand we have light sources (like Sun, lamp or flashlight) and on the other there are objects we wish to illuminate. Objects receive light and create shadows. But in reality it’s not that simple. For example, when you wake up in the morning and you have your blinds half open there is only a small gap that sun can enlighten your room through. But it’s not like the room is covered in total darkness like mines of Moria. Quite the opposite — blinds cast subtle shadow and the whole room is evenly illuminated.

In terms of 3D graphics, light that comes from some source and is stopped by solid objects is called direct lighting. If we had 2 solid boxes, red and white and illuminated it with direct sunlight it could look like this:

As you see, areas where light is blocked by a box are totally black. But the light doesn’t work like this. Instead, photons (light particles) bounce off every surface they hit, creating indirect lighting (which is also called global illumination). It could look like this:

However, modern computers are not able to handle such light interactions yet. Or I’d rather say: they can’t handle exact calculations needed for this. There are numerous approximations — and I’ll tell about them in some future.

But thanks to GPU computing power we actually can compute ambient occlusion. Ambient occlusion isn’t in fact about the light. Quite the opposite — it tells you how much some surface is blocked. For example flat wall would be not occluded, when flood under your bed would be almost completely occluded (that makes place under bed a perfect ecosystem for monsters). AO term looks like this:

As you can see, it’s not perfect. We’ve lost color bleeding (space between two boxes is no longer reddish) but shadows are quite similar to GI version. And those shadows are very important, because they provide you spatial clues about geometry.

And ambient occlusion can be successfully implemented in game. The first game to use AO was Crysis with its SSAO technique. However, the original implementation had various problems with quality. Then, in 2008 there was invented another effect called HBAO. It’s been used recently in Battlefield Bad Company 2. HBAO offers superior quality to any previous AO technique. This blog post is already quite long, so I’ll just post images with this effect on and off.

HBAO off:

HBAO on:

HBAO term only:

And finally high-res screenshot with HBAO and a lot of boxes:


HBAO applied to level with no lighting

More technology-related posts coming soon!

Introducing Lvx Techdemo

Posted January 23rd, 2011 in Press | No Comments »
LVX techdemo

Hello everyone. Today is a big date for us. We would like to share with you the progress of creating our indie game & engine. We have been developing this since 2009 and one of main reasons we have not completed it yet is having no feedback. At very beginning of the project, I thought that we should wait for a complete game or at least a playable demo before showing the project off. Now I can see that it was a mistake, as no indie project can exists without its community. But we want to learn from our mistakes. So, starting today, we will present you with a devblog of creating Lvx.

But what is Lvx actually? Well, it’s our upcoming PC FPS game featuring action, horror and mystery elements. We use custom engine and targeting all major PC platforms: Windows, Linux and Mac OSX. Our game features rich interactions, physics and as next-gen visual as we are able to provide.

For starters, there won’t be much info or medias about Lvx itself. We’ll start publishing some engine shots and articles first, and gradually switch to publishing game-related materials. So stay tuned and remember to subscribe to our news feed on RSS/Facebook/Twitter.