Virtual Cubemapping demo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Virtual Cubemapping demo

Post 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
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
neoIxen
Posts: 13
Joined: Fri Mar 16, 2007 3:39 pm

Post by neoIxen »

I cannot open the zip-file with my 7zip :?
but it looks cool on that pic ^^
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post 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:
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post 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.
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Yes, it works. Nice job. Just that the physics updates too fast as i got a high framerate.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post 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!
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

looks nice.
just can not understand what it looks like and where to use it?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post 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.
TheQuestion = 2B || !2B
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post 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
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
conorkirk
Posts: 16
Joined: Mon Feb 05, 2007 11:47 pm

Post by conorkirk »

Source so I can compile for Mac OS X?
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post 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: ).
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post 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
TheQuestion = 2B || !2B
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

That is nice. But I think he pretty much asked for a textual description, not a visual demo.
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post 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.
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post 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.
Post Reply