I'm Jon Olick. I make shiny things. I simplify.


I presented Sparse Voxel Octrees at Siggraph 2008.

Wednesday, August 11, 2010

Surviving 32-bit

32-bit 2GB limitations has reared its ugly limitation head on me more often recently than I would like.

2GB limitations sounds all nice and dandy for a console, but on the PC you have double copies of all your data in both RAM and VRAM. It sucks. Granted VRAM is windowed, but that single extra copy can eat up a lot of space. High end video cards have 1.5GB of VRAM in it for example. If you had a double copy of all that data in RAM, then you should have less than 512mb for your game. That being said I'm using up nowhere near 1.5GB of VRAM, but the thought that in a couple years that I could is troubling.

So naturally, the first angle I attacked is don't let D3D manage the resources in video/main memory. IE, do it manually yourself and store the copies on disk, not in RAM. That worked out great, except in the cases where you actually can't do that cause you need the RAM copies around. Which unfortunately is more often than I would like. In that case you can sometimes compress the data while its not in immediate use. (Its also worth noting that if you go the route of manual resource management you may need to pay attention to LRU resources and flush them to disk if a VRAM allocation fails.)

One thing that did help though was that on Win7/Vista 64-bit you can enable /LARGEADDRESSAWARE and are then able to use the entire 4GB of address space. Which is awesome. Except that some parts of D3D9 are not really made to work with that very well. One of the problems arises with D3DXHANDLE. Negative numbers are handles, and positive numbers are pointers to strings. This just doesn't work with >2GB address space. You can hack around it by detecting when the D3DXHANDLE is actually a string and not a handle and then copying that string to a store of addresses which are under 2GB. So far this has worked out. However, the looming threat that external libraries might do these tricks in other places is a bit scary.

Its disturbing that they are selling Win 7/Vista 32-bit copies. Are they crazy? Get rid of 32-bit! don't keep it around! This was obviously not an engineering decision and had much more to do with business. Somewhere there is an engineer at Microsoft who told them it was a bad idea. I feel your pain. This is really going to cause problems in a couple years for everybody. Having to support a 2GB address space is hell if your memory constrained, and in a few years we will all be memory constrained when making PC games.

Something else to keep an eye on:
Its typical to use default parameters when using CreateThread, however this is bad when you have lots of threads. A game usually has a stack size of multiple megabytes these days. Each CreateThread called with default parameters will have an address space reservation of the same size as the executable's main thread. It adds up.

Friday, July 30, 2010

So fun, its better than Starcraft 2

Step 1) Find a web-cam video of a celebrity on youtube.com
Step 2) Download the video with Keep Vid
Step 3) Convert the video to MPG with Pazera
Step 4) Use Virtual Dub to cut out a looping section of the video
Step 5) Download Many Cam and set it up with that video you made. (It will make a virtual web-camera with that video looping in it)
Step 6) Head over to Chat Roulette and point it to your many cam.
Step 7) Watch the hilarity of people's reactions. Priceless

Most people figure out pretty quick that its fake. Like when the video doesn't react to them and especially if the loop isn't perfect. Still lots of fun while your waiting for SC2 to install.... and it does take a looooong time to install.

PS. I'm still looking for a good Arnold Schwarzenegger and Chuck Norris video. Comment with your favorite source videos. A good example one is Jessica Alba.

Other probably funny ones:
Klingons
Woody from Toy Story 3
Gatekeeper? No clue, but its funny
MRirian
Jonas Brothers

Monday, July 26, 2010

DXT compression aware UV unwrapping

When compressing DXT textures you usually compress the whole texture at a time. The goal in recent research areas (http://www.sjbrown.co.uk/squish/ for example) has been how to choose the end-points of the color line. There is a limit to this research area and some configurations of colors will still produce bad results, even using brute force methods to search the entire problem space.

There are some cases however where texture compression quality can be improved even further (which typically appear on sharp color discontinuities for example).

What if you had more data than just the input image?
Such as in the case of a UV unwrapped model. You can also input/output the triangle mesh that goes along with it. This will allow you to move pieces of the texture around to get better texture compression quality.

For example, a UV unwrapped model on the texture is built up of "islands" of triangle meshes. These islands are disconnected from each other and can move around freely.

As such, we can adjust the location of the islands in the texture, moving them 1 to 3 pixels to the right and 1 to 3 pixels down to see if the texture compression for those blocks improved.

Because they can move freely, we can also re-order and re-orient them in order to take better advantage of color coherency between island borders, as well as to line up the sharp color discontinuities with DXT block borders.

Its also technically possible to warp the islands's meshes themselves to line up the texture problem areas better with the DXT blocks.

Friday, July 23, 2010

What would you use gigabit internet for?

I just got upgraded to a new 50Mbps Docsis 3 internet connection. Its just awesome....

This brought up an old question for me. With google building a gigabit fiber to the home internet connection, what would you or could you saturate that bandwidth with? As in what applications could possibly use it all up with nothing to spare?

1) Cloud/cluster computing
This one's a bit obvious I think. Computing clusters require massive bandwidth with very fast response times.
2) Direct Brain Communication
Having nano machines communicate with all the cells in the brain would require some pretty hefty bandwidth. This sounds crazy and probably is, but you never know I suppose what crazy things the future might hold around the corner.
Blogspot = blogging
Twitter = micro blogging
? = nano blogging (via direct brain communication?)
3) ?

Any ideas on what could saturate a gigabit internet connection?

Friday, July 16, 2010

Additional info for +1% dropped calls with the iPhone 4

One of the big key points Jobs hit home again and again, was that its about 1 more phone call dropped per hundred. So how is it that this is such a big issue that people are experiencing if its clearly not a big issue.

Quite possibly lefties.

People who are left handed and making phone calls with the iPhone 4 will have greater signal loss than people who are right handed.

7% to 10% of the population is left handed.

If 7-10% of those dropped calls are from lefties, and that 1% additional dropped calls is from those lefties, then 1 out of 7 to 1 out of 10 of every left handed iPhone 4 user has experienced the problem.

They would also experience it more regularly. Which is why its such a big issue.

Friday, July 2, 2010