Monday, May 13, 2013

Oculus Rift


So Friday 2 weeks ago my Oculus Rift finally arrived! yay!
And the next day I left on a pre-planned vacation for two weeks .. (very bad timing)
So I did the unthinkable .. I took my old laptop + Oculus Rift with me and tried it out while on vacation (wife did not approve)

It's pretty cool.

I let several people try it and they all had a 'wow' moment when they first put it on. Most of them weren't even gamers ..

This makes me feel like this is going to be the next big thing ..


My impressions:
  • It's really responsive. 
  • Resolution is lower than I'd like and the screen door effect is a little distracting 
  • I seem to have a couple of dead pixels (fortunately not in the center but near the edges) 
  • I'm noticing some tiny distortions when I move my head in the Tuscany demo, which is probably because the software distortion part is an approximation.
  • For some reason the unrealistic-ness of the colors in the Tuscany demo is more apparent on my rift than on my monitor. Not sure if this has to do with the quality of the display in the rift vs my monitor.
  • It definitely feels really immersive, makes you feel like you're really there..
  • I tried some things that are supposed to be sure ways to get motion sickness, fortunately I seem to be immune to it.
  • I did notice that turning the view with my mouse/gamepad makes me a little bit dizzy, but only during the turning. I tweaked the turning speed in unity (made it slower) and that made the dizziness disappear .. The HL2 beta Oculus Rift seems to handle this well by easing your way into a turn instead of making your virtual body turn at full speed right away.
  • Mouse & keyboard doesn't seem to work very well with the rift ..
    You're constantly looking for your keyboard ... blind typing still requires you to know exactly where your keyboard is apparently ..
  • Bought a gamepad for the rift, now I understand why everyone was using it... much easier to use blindly ... still want to try the razor hydra with it .. I get the impression the hydra is perfect for VR
  • There seemed to be a strange blur when you move your head (in the Tuscany demo) .. but it's not there when you rotate using the mouse/gamepad ? I didn't notice it in HL2 / TF2 .. in fact either the blur was removed in the later version of the SDK (software after all?) or I simply stopped noticing.
  • It's a bit annoying that it's set up as another monitor (which is understandable) which either forces you to mirror a screen (which is not a bad thing) or stumble in the dark while you try to start a game on your rift 'monitor' (and you can only see a portion of the screen in your rift so you're constantly looking for your mouse cursor). Unfortunately you can only mirror your primary desktop monitor (I have 3 monitors). And since your monitor is bound to have a higher resolution than you Oculus this all makes things kind of awkward at times. (Some Oculus Rift demos don't start full screen so don't change the resolution, which you all have to do manually every time)
  • Also they did a surprisingly good job at hiding the need for positional tracking (although sometimes you can still tell)


Friday, February 22, 2013

Voxel world update

Just showing my streaming voxel world experiment. I've been working on this off and on for about a year or so while I'm not working on the project that will actually pay the bills (which I can't actually talk about right now). These are some videos that I recorded some time ago ..



The voxel experiments that I wrote about before where written in C#, this one in C++ so I could have more low level control. Transparency is sorted at the block level. Still need to implement inner block sorted transparency (which can be pre-sorted, mostly, just need to implement it).

Physics is also done at the block level, still need to implement sub-block physics. Fluid physics still needs to be implemented (so you can swim) and air physics definitely still needs a lot of tweaking! Also lighting is calculated on the fly, lighting is not cached on disk yet.

There's also a small mip-mapping bug in this video (which has already been fixed) where tiles that belong to each other (glass and glass borders) aren't processed together so their transparency is slightly different at different mips.

And yeah next time I'll record a movie I'll get a bandicam license first :)

Monday, December 3, 2012

Funny bug II

Playing with my voxel world thingy again ...


.. and had another funny bug

Wednesday, November 7, 2012

Funny bug

When changing the file format in the executable, re-created the data files incorrectly ..
oops! :)

Wednesday, September 12, 2012

Programming languages

Yesterday night, trying to sleep, I was thinking about next generation programming languages and how it would be nice to have a language that combined all kinds of features from C#, D, Intel Cilk, C++, support for both composition and inheritance architectures etc. etc.

Of course this magical new language would solve every single problem and bring about world peace. It wouldn't have garbage collection, but would require the user to manage memory manually like in C++, and wouldn't be managed to be able to get every bit of performance out of your computer. 

So this made me wonder, suppose you'd have this language and you'd have this standard library included with it like .Net does (but maybe a little more sparse) how would you handle situations like SomeContainer.ToArray()?

If you don't have garbage collection, and you allocate memory in this 'ToArray' method then the user would be responsible for freeing it later on. So this made me think is there a clever way to communicate this to the programmer beyond mere documentation?
This is what I came up with (syntax is just an example):
class SomeClass
{
  public allocator SomeOtherClass* MyMethod() 
    { return new SomeOtherClass(); }
}

void SomeOtherMethod()
{
  SomeOtherClass* myInstance = new SomeClassInstance.MyMethod();
  // ..
  delete myInstance;
}

The idea is that every method that returns allocated memory (which hasn't been stored somewhere else) MUST flag that method as an allocator. Then when an allocator method is used you MUST use the new keyword in front of it.

The advantage is that in the scope of 'SomeOtherMethod' you can clearly see that SomeClassInstance.MyMethod allocates memory and that the programmer is responsible to free this memory eventually. 

When a method isn't an allocator but still returns a pointer then the programmer can assume that this pointer doesn't need to be deleted and will be managed by some other piece of code somewhere else.

An additional advantage to this is that it should make it easier for the compiler to automatically detect certain types of memory leaks. The beauty about this is that it works hierarchically .. if a function calls an allocator and returns it's pointer it will need to be marked as an allocator as well (unless it stores the pointer somewhere).

Thursday, July 5, 2012

Day/Night cycle

Continuing with my little experiment this morning I added sky lighting and a simple day / night cycle.

Day time

Night time
The whole sky lighting part more or less piggy back rides on the torch lighting code. I just needed to add support for storing a height-map for each x/z chunk coordinate which is then used to determine whether a block is fully sky lit or not, and then smooth it out over distance over all the blocks that aren't lit.

Tuesday, July 3, 2012

Minecraft lighting

A long time ago I mentioned that I made a simple Minecraft renderer which I basically hadn't touched since then. This morning I didn't have much to do so I played around with it a bit and fixed both the lighting and a bug with the transparency sorting.



I managed to simplify the code a lot and speed things up at the same time, so I'm happy with the results. Right now it's possible to add torches (hard coded, but can just as easily be replaced with any kind of block) and remove blocks.