• Register
Post news RSS Insight into my compressed room

How the Drag[en]gine compresses your texture and changes the way you look at windows.

Posted by on

Windows in games is a huge problem. They are always done by using a flat texture on facade meshes. This results in flat looking facades which break the credibility of the world. The Drag[en]gine provides an interesting solution to this problem to spice up your game world without adding extra geometry or making things complicated. But first things first...

Preloading CPU Mip-Map and Compression

Besides bug fixing tickets one topic has been texture preloading. Loading textures is one of the most time consuming processes and different drivers can yield vastly different results. The most simple solution is to upload a texture base level and let the driver compress and mip-map the texture while uploading. This happens synchronously and can take from a second up to a lot of seconds with large textures. Also the quality of drivers compressing texture varies a lot. One of the tasks had been to solve this speed and quality problem. The mip map calculation and texture compressing has been moved now into CPU land. While loading textures asynchronously they are now mip mapped and compressed on the CPU before being uploading synchronously to the GPU. The performance is totally something else. Previously loading the game world took up to half a minute on certain drivers. With the new loading routine the loading of the game world takes only a few seconds now. Furthermore texture compression quality is now stable and fast no matter what GPU and driver you are using.

Meanwhile in Zi...

In between I took also a couple of days off to tackle a proof of concept side project. I use this to test certain engine features I can not test with the main game project. In this case I took a stab on that Shield Liger model I had around. I create the project files from scratch and whipped up a first working prototype in a couple of days. While working well this showed me where I still have to apply changes before the first engine version is released and I found bugs I fixed I didn't come across in the main game project. Last but not least this gives a little off-topic video to look at: Youtu.be .

Wanna see my room?

No, I'm not going to end up like those wannabe game-devs filling up their news posts with totally irrelevant videos of their dog, bed room and weather outside just to rake in PR although there is nothing worthwhile to talk about to begin with. I'm talking about rooms behind flat walls.

As mentioned in the intro this update deals with the problem of flat windows. Some years ago I came across a nice article on the Internet of a clever guy who had a clever idea. For some strange reason I've not seen a single AAA game-dev picking up that idea although it's cooler than a polar bear in a freezer. In short he replaced the flat texture with a cube map. Taking that basic idea I wrapped up a working solution which is as simple to use as anything else in the Drag[en]gine.

For this purpose new texture properties had been added:

If you want the details have a look at the linked wiki pages. In short this allows to specify an environment map type cube map to simulate a fake room behind the flat window mesh the texture is applied to. The texture coordinates of the unwrapped window and environmentroom.size define the size and orientation of the room. The cube texture coordinates are calculated in a way the fake room appears under the right angle while looking at it from different angles. This gives the impression there is a room behind a window instead of a flat texture.

The video below gives an impression on how this looks like comparing the conventional flat window texture with the environment room texture on the same flat wall:

Fake rooms combine with other texture properties. They sort of replace the color texture property with a simulation of a rectangular room. Otherwise normal, reflectivity and roughness still work the same allowing to have window glass reflections while looking into the room. All this without touching shaders at all nor trying to get all tangled up with shader node systems.


The next tickets to work off are a bit more technical so the next news post most likely will take a bit longer since technical stuff doesn't show much with videos or images. The close goal is still the first engine release. Working off tickets is still coming along nicely.

AniCator - - 178 comments

The fake rooms look pretty neat though there still is a lot of distortion of the perspective visible which is maybe why a lot of developers avoided it.
I could be wrong because the distortion could be caused by the image itself and not the technology.
One thing that is for sure is that it adds a lot of depth to the room which is very impressive for being just a shader.

Reply Good karma Bad karma+3 votes
Dragonlord Author
Dragonlord - - 1,934 comments

It's due to the image used. I picked for testing an example light-probe image of an office room. The image has been taken with a sub-optimal orientation (ceiling lights not running parallel to the room) and the room does not have walls (which is why tables and chairs are where the wall is supposed to be). The optimal solution is to render an env-map from a Blender3D made room where the orientation is correct and walls exist where they should. Furthermore I've got an idea for an improvement which increase the depth perception. I'll talk about this later since for this I need a properly created room in Blender first. The test image here is not suitable for this.

Reply Good karma+1 vote
SPY-maps - - 2,905 comments

I have to be honest and didn't really notice any distortion AniCator. But even when it has a litttle bit of it, then i still prefer it a whole lot above that other one. Because that doesn't give any depth at all.

very nice!

Reply Good karma Bad karma+2 votes
SinKing - - 3,119 comments

That's a great idea! This technology is so convincing though that people will probably try for hours to get into one of those "rooms"! Beats bump-offset and all UDK can do by miles!

Reply Good karma Bad karma+1 vote
Dragonlord Author
Dragonlord - - 1,934 comments

Not only that. You can use these texture properties also on decals. So you can make pits and tunnels under or behind grates on floors and walls or caverns behind barred of wall segments to look more convincing. The possiblities are quite endless there.

Reply Good karma+4 votes
SinKing - - 3,119 comments

These are some great examples!

I'm just wondering how large you can make these "windows" and how well they hold up, resolutionwise. I've been thinking, instead of the usual parallax planes or mockup buildings in the distance, why not use this "window\" solution, instead.

With a good enough HDR cubemap, you could pretend, there is a starry sky overhead and a mountain ridge behind that mountain you start on. And then make the character walk towards the actually level without ever realizing he was standing right next to the border of the map.

This thing is so wild. it messes with my head. I would place a "window\" like that in the entrance of buildings that are very hard to model, e.g. cathedrals. Place a blocking volume in front of it to keep them from going in and make it plausible with some signs (e.g. "closed mass for Peruvian Priests only") Players would still get all the atmosphere and sounds and looks of it. They could meet their mark later, as he/she leaves the "private mass", and so on.

Man, the stuff you make opens up entirely new possibilities. It's great every time!

Reply Good karma Bad karma+1 vote
HeadClot - - 461 comments

I liked the Zoids Proof of Concept or ZPOC as you call it. :)

Really cannot wait for this game/Engine. :D

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.