Page 1 of 4

Virtual Cubemapping demo

Posted: Sun Feb 17, 2008 3:43 am
by BlindSide
Image

From ReadMe:
This required no modifications to Irrlicht. It works by storing all 6 cube faces on a single texture (I did this by using 6 viewports and rendering a screenquad with the texture applied to each viewport), then transforming the final texcoords to read from the correct face based on a texture index. I then projected this cubemap from a 3d position and multiplied it with the diffuse map of all the objects in the scene.

The method used here is good because it allows you to easily load a cubemap from 6 seperate textures, then blast it onto an RTT and you're away. Even if the textures are of different sizes, too big, too small, or of different aspect ratios they will be resized to fit into their respective area inside the cubemap texture (Using absolute positioning).

When you first start the demo, the default Irrlicht skybox is projected from the position of the FPS camera. After you shoot a cube it will follow that cube until you shoot another one. The physics here is provided by Bullet, its currently configured to be fast & fun, so the physics simulation should run pretty fast at the expense of accuracy.

Keys:
-----
WASD (Or arrows) to move.
Press space to shoot a cube.
R to display/hide cubemap texture on screen.
Click here to download it

Posted: Sun Feb 17, 2008 12:32 pm
by neoIxen
I cannot open the zip-file with my 7zip :?
but it looks cool on that pic ^^

Posted: Sun Feb 17, 2008 1:02 pm
by Virion
At first I thought you just made the whole room transparent so that can see the skybox outside. :lol: But when i move outside the room, IT'S NOT! There is no skybox outside. Nice Blindside. :wink:

Posted: Sun Feb 17, 2008 2:16 pm
by sio2
IIRC When using a texture atlas you need to allow for texture filtering when specifying texture coordinates. Otherwise it's possible that filtering may include areas that are not part of the sub-texture.

Posted: Sun Feb 17, 2008 2:51 pm
by jingquan
Yes, it works. Nice job. Just that the physics updates too fast as i got a high framerate.

Posted: Sun Feb 17, 2008 6:38 pm
by Nadro
I can't run this demo... I have problems with Your DirectX apps BlindSide (with this demo and the latest XEffects in DX mode) OpenGL apps work without problems :) This is maybe cause by my drivers for HD2600 for AGP:P But demo on screenshot looks very good:) Good work BlindSide!

Posted: Sun Feb 17, 2008 8:46 pm
by greenya
looks nice.
just can not understand what it looks like and where to use it?

Posted: Sun Feb 17, 2008 9:08 pm
by Halifax
greenya wrote:looks nice.
just can not understand what it looks like and where to use it?
Well if I recall Epic Games uses it for a pretty advanced technique in its games to simulate the dynamic lighting in an environment. If you have ever seen that tech demo for UE3 where the light is moved through the hallways, and they say the engine dynamically blurs between a high-def cubemap and low-def cubemap.

Posted: Sun Feb 17, 2008 11:51 pm
by BlindSide
Virion wrote:At first I thought you just made the whole room transparent so that can see the skybox outside. :lol: But when i move outside the room, IT'S NOT! There is no skybox outside. Nice Blindside. :wink:
Did you try shooting a cube?
Nadro wrote:I can't run this demo... I have problems with Your DirectX apps BlindSide (with this demo and the latest XEffects in DX mode) OpenGL apps work without problems :) This is maybe cause by my drivers for HD2600 for AGP:P But demo on screenshot looks very good:) Good work BlindSide!
This is an OpenGL app. What kind of problem happens? Does it crash? I would really appreciate any info regarding this. Thanks.
IIRC When using a texture atlas you need to allow for texture filtering when specifying texture coordinates. Otherwise it's possible that filtering may include areas that are not part of the sub-texture.
Yeah it took alot of tweaking to get rid of the edge artifacts. In the end some aggressive clamping worked.

Please note: On ATI cards this demo runs a 512x512 texture because ATI cards seem to have poor framebuffer support (Or atleast my 200M does :P ). Nvidia cards run at a full 1024x1536 (Giving 512x512 for each face of the cubemap.).

@jingquan:
Yeah the physics seems to be frame dependant even though I'm passing it a delta time. I figured I'd leave it as-is since this is more of a graphical demo. I was thinking of including SSAO in this one but I figured that the two effects working together may confuse people.

@Everyone:
Yes I plan to use this technique to create point-lit shadowmaps.

Cheers

Posted: Mon Feb 18, 2008 5:54 am
by conorkirk
Source so I can compile for Mac OS X?

Posted: Mon Feb 18, 2008 7:32 pm
by Vsk
Sorry for my ignorance but what this is used for?
The light explanation I don undertand it, could anyone elaborate that more.
Anyway it looks good (as much as I undertand it :wink: ).

Posted: Mon Feb 18, 2008 9:27 pm
by Halifax
Check this for the cubemapping light example(Unreal Engine 3 tech demo)(start at 1:05 for the example):

http://www.gametrailers.com/player/usermovies/9091.html

Posted: Mon Feb 18, 2008 9:38 pm
by Dorth
That is nice. But I think he pretty much asked for a textual description, not a visual demo.

Posted: Tue Feb 19, 2008 1:28 am
by jingquan
Vsk wrote:Sorry for my ignorance but what this is used for?
The light explanation I don undertand it, could anyone elaborate that more.
Anyway it looks good (as much as I undertand it :wink: ).
It can simulate reflection from the environment around your object for realism. But the main purpose for this is to create 360degrees dynamic shadows for a point light.

Posted: Thu Feb 21, 2008 3:13 pm
by Vsk
jingquan wrote:
Vsk wrote:Sorry for my ignorance but what this is used for?
The light explanation I don undertand it, could anyone elaborate that more.
Anyway it looks good (as much as I undertand it :wink: ).
It can simulate reflection from the environment around your object for realism. But the main purpose for this is to create 360degrees dynamic shadows for a point light.
I have seen the video, but I don't undertand what is the diference with the actual blind side shadow mapping.
The shadow are 360 and work for dinamic lights.