• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
behc

Box Projected Cubemap Environment Mapping

19 posts in this topic

This is lovely. I've toyed with this idea but was never brave enough to implement it. Nice job!
0

Share this post


Link to post
Share on other sites
That is really really pretty.

I cant wait to get home and check out the demo to see what kind of performance it gives
0

Share this post


Link to post
Share on other sites
Cool - I'm definitely interested in the details.

I'm guessing that it involves taking the position that the cube-map was rendered from into account when sampling it?

[EDIT]
To get your demo to run I had to download OpenAL - here is the installer for anyone else who needs it.

Is your demo using one cube-map for each "room" (4 cubes)?

Got to say I am very impressed if those reflections are done with a shared cube-map (shared between all objects/walls in a room) - they look as good as doing individual planar maps for each wall (except for when you go deliberately hunting for the artefacts at the edge-cases). For 100% reflective mirrors, the artefacts might be too much (for large mirrored areas, anyway), but for subtle glossy surfaces this is absolutely great!
If you don't publish your details I'm going to have to study your demo until I can reinvent it myself :P


[Edited by - Hodgman on April 20, 2010 8:26:12 PM]
0

Share this post


Link to post
Share on other sites
The ATi SDK had something similar a while back, they traced the reflection vector to a cube of a specific size and then downscaled the contact point to fit a cubemap lookup. Don't think they gave it any specific name though.

Works really nicely as a cheap alternative to calculating reflection images for each planar surface.

You can do the same for refraction too by the way :D
0

Share this post


Link to post
Share on other sites
The nvidia "mike" demo used some offsetting in the blured enviropment cubemap for better results of their radiosity emulation.

http://www.nzone.com/object/nzone_madmodmike_home.html

I think it might be the nearest thing I've seen to what you're doing.

But the demo looks qutie nice! :)
0

Share this post


Link to post
Share on other sites
I forgot to mention about OpenAL, this demo uses snapshot of my (always-)work-in-progress engine that normally goes with an installer, but in single-exe mode it doesn't install anything.

@Hodgman, you are correct, there are 4 cube-maps pre-rendered at somewhere near center of each room. Edge artifacts can't be eliminated because cube-map contains limited information about scene and using different AABB's size produces some discontinuities in projection.

@Exorcist, that Ati method sounds very much the same, I've searched current SDK (and that from 2006) and archives but I couldn't find anything similar. Do you remember year (or target hardware) of that demo? (Speaking of Ati, I remember "treasure chest" demo that comes with 8500 model, there was some magical vector passed as fourth component in their env-mapping code, but I don't think that's it)

@Krypt0n, that demo is nVidia only, I will try that at work tomorrow

To explain my (or Ati's :) ) technique I've prepared an image:

[img]http://www.behc.pl/stuff/graph1.png[/img]
where, S is sample point, and Bmin/max defines our AABB (these are 3 extra constants you have to provide). The key is to find PB. Fortunately when using AABB, this can be quickly solved (without digging into math) using this code:

[font="'Courier New"]float3 dir = WrlPos - CamPos;
float3 rdir = reflect(dir, WrlTexNorm);

//BPCEM
float3 nrdir = normalize(rdir);
float3 rbmax = (EnvBoxMax - WrlPos)/nrdir;
float3 rbmin = (EnvBoxMin - WrlPos)/nrdir;

float3 rbminmax = (nrdir>0.0f)?rbmax:rbmin;
float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);

float3 posonbox = WrlPos + nrdir*fa;
rdir = posonbox - EnvBoxPos;
//PBCEM end

float3 env = texCUBE(envMap, rdir);[/font]

of course using AABB is not the most convenient way, but most of the scenes (at least in architectural presentations) can be described/approximated as set of AABB. Or you can use more complex description at cost of additional instructions (OBB? half-spaces? distance-maps?)

//edit: fixing code box after forum upgrade
2

Share this post


Link to post
Share on other sites
That, my sir, is seriously cool. I´ll try to implement it and see how much it rocks :).
It could even be used for cheap GI, with a blurred cubemap (?). The first screen looks like color bleeding, due to the red wall reflecting on the other wall.
0

Share this post


Link to post
Share on other sites
Hello, sorry for bad english, please tell us more about how you mix the cube map, which maps in the scene elsi 30
0

Share this post


Link to post
Share on other sites
Lionhead recently published a paper having to do with how they did a semi realtime single bounce of GI. In it, for their irradiance probes, they stored the max distance each probe could "see" to before reaching an occluder to prevent light bleeding. It occurs to me that pretty much the same thing could be done for this.
0

Share this post


Link to post
Share on other sites
i just have a few questions to wrap this thing around my head:
- what is the green box??
- what is the blue box??
- i thought that env-mapping just needed a reflection vector and the cube-map and that is it, what does an AABB have to do with anything??

I still am a beginner so please help me get this thing
0

Share this post


Link to post
Share on other sites
Made me think of that : [url="http://developer.amd.com/media/gpu_assets/ShaderX_CubeEnvironmentMapCorrection.pdf"]http://developer.amd...pCorrection.pdf[/url]

You seem to apply the same idea to reflections while that was demonstrated for refraction.
0

Share this post


Link to post
Share on other sites
One day.. one day I hope to be as talented with this as you behc that is one seriously impressive demo; it's better than tech demo from a graphics card manufacturer!
0

Share this post


Link to post
Share on other sites
This appears quite similar to the localized cubemaps of Kevin Bjorke / Nvidia - e.g. [url="http://http.developer.nvidia.com/GPUGems/gpugems_ch19.html"]http://http.developer.nvidia.com/GPUGems/gpugems_ch19.html[/url] .

Still, very cool demo!
0

Share this post


Link to post
Share on other sites
Sorry for such late reply (for some reasons I have got no notifications that thread was active)

Many thanks for the links, looks like both nvidia and ati developed similar technique based on sphere. Idea is the same: apply some correction to reflection vector to account for finite environment. I choose box (instead of sphere) because it's more common to have environment built from boxes (especially in urban areas). Also I had more ALU instructions to spend :)

@VISQI - green box is just abstract represetation of cubemap, it's size doesn't matter, only position is important, blue box is a room (or some box approximation of environment visible in cubemap). Having only cubemap and reflection vector is enough, when you render cubemap every frame (from the center of every glossy object), AABB part improves quality when you use cubemaps pre-rendered from some fixed locations.
0

Share this post


Link to post
Share on other sites
It's very good![img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
0

Share this post


Link to post
Share on other sites
(•_•)
Classic enviroment mapping for planar surfaces is just...
( •_•)>??-?
(??_?)
... [u]plane[/u] wrong.
YEAAAAAAAAAAAAAAH!
0

Share this post


Link to post
Share on other sites
FYI, I downloaded your demo file, and my AntiVirus blocked it (it named the following trojan):

TR/Crypt.XPACK.Gen

Might be a red herring, but you might want to run a scan of your PC, just to be safe.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0