The Orb Game

22.11.2009 03:06 in apps, games, raytracing, compo

orbgame580.jpg

Few days ago there was a really cool Raytracing Compo. Rules were simple: 3 spheres only and you need to use raytracing. To be honest, the rules were my idea -- or to be more precise, my IRC joke. Joke that got real.

I've already had some experiences with raytracing and other cool effects, so I was wondering what kind of game could I make. Sure, every possible material and effect was available -- but this time my main concern was gameplay. I decided that eye-catching materials wouldn't add anything to gameplay and didn't use them (well, Krzysiek K. proved me horribly wrong, however he used multi-layered sphere -- very, very sneaky! -- check out his game, its awesome). In the end the game was made in great hurry, so it's not as fun as I wanted it to be (in fact I use PhysX just to roll ball...), however requires few minutes of "what is it all about" to win.

Few technical issues: it's GL 3.1, and almost runs on ATI Radeon. After lot of bugfixes executable starts but visuals are incorrect. I would be more than happy if a brave-enough Radeon-owner would spend some time and fix the code. With such knowledge I would probably also be able to fix deferred shading code. Other valuable points in code are "procedural" mip-mapping (because of bad aliasing with no AA or AA with uniform grid) and per-object texturing. In fact, please, do not post "The Orb Game Sources Reaction" on YouTube.

My simple raytracer is 10x faster than NVidia OptiX!

21.10.2009 05:20 in raytracing, 3D graphics

rt-dabroz.jpgrt-nvidia.jpg

It's frustrating. I coded this sample about month ago. But the very next day I've upgraded my system to 64-bit Windows 7 and my raytracer magically refused to work. Finally I've got some time to fix it and post.

Basically it's the same demo that NVidia's using to promote OptiX. First of all, you can run OptiX samples on GeForce cards (not only QuadroFX) by disabling video card name check (very sneaky, NVidia!). So did I. And NVidia sample was running at 3-4 FPS, but it needs a lot of frames to produce final results (it's simillar to progressive JPEG). On the other hand, my very simple raytracer coded in CUDA easily hits VSync (60 FPS) using higher resolution and instant multisampling. Sure, my raytraces is not pixel accurate with OptiX, but its a matter of setting lights, objects positions and other stuff. And why does OptiX perform so bad? I have no idea.

You will probably have a lot of problem running these demos (I have no luck with release builds). But if you have Visual Studio and CUDA SDK you have chances. x86 build runs fine on 32bit Windows XP. x64 build runs on 64-bit Windows 7 (and probably Vista). Visuals in x64 versions are somewhat different from image in my post, because I needed to backport some code.

PS. I love 7 driver model. NVidia drivers (191.07 in my case) are still very buggy (or rather unstable) when running CUDA code, and automatic driver restart is much better than total system crash.

PS2. I'll try to find some more time and finally post my OpenGL 3.2 multisample demo source code.