Browsed by
Category: Technical

Installing your new SSD

Installing your new SSD

Installing an SSD hard drive into my machine has to be the most transformative computing experience I’ve had since the introduction of Intel’s Core line of processors.

But there are important things to know about SSD and upgrading.  Sure, it’ll install just like any other hard drive, but they are not created the same way and need different tweaks on them.  Our operating systems are still geared and tuned for platter systems.  There has been many, many people tweaking and experimenting with a great number of setups.  Now, however, they are all starting to converge and say similar things.  Here’s a great link with most of the common details and techniques outlined:
http://www.sevenforums.com/tutorials/70822-ssd-tweaks-optimizations-windows-7-a.html
However, there are some important things I think are worth calling out:

  1. Your SSD has a finite lifespan based on how many times its *written* too – SSD’s only have the ability to write so many times to it’s memory cells before they degrade and fail.  Reading is free from this behavior.  This was much worse in the first generations of the drives – so buying used SSD’s means you’re buying a drive that has used more of it’s lifetime.  Buy used and older generation drives carefully (and at a big discount).   The most recent drives are not nearly as bad as first generation drives but your goal is still to *reduce* the amount of writing your drive.
    Don’t freak out though – Intel drives have 3 year warranties, use modern wear leveling algorithms, compression to avoid extra writes, have built-in block correction/replacement, and use modern processes so that you are now much more likely you’ll upgrade before a failure.  Still, using the drive as a constant write cache would be a bad idea. Most of the optimization strategies you read about are geared for the right balance of longevity and speed.
  2. Even ‘slower’ big SSD’s are faster than the fastest smaller ones.  While my Intel 180gb drive is in the top third of performance, it absolutely TROUNCES the perf of the fastest 64gb, and almost all the 120gb drives.  The bigger the drive, the faster it natively is.  Not sure why, but the specs show they are.
  3. Buy at minimum a 120gb drive – I recommend at least a 180gb.  You’ll find all kinds of folks that get Windows 7 installed in 30gb or under.  Yes, you can install Windows 7 on a 64gb drive.  But you won’t get much else on there and it requires lots of ‘fiddling’.  After years of doing this as a poor college student, I now hate fiddling.  I installed the OS with the swap file and most of the recommended settings along with all my core little helper apps (Winzip, Skype, PowerDVD, Office, Battlefield 3 (notoriously SLOW on level loading and big), and am just under 100gb before my final adjustments that should net me a bit more space.  I think that would completely fill a 120 as after formatting you only have a bit over 100gb.  I would have gone for a 256gb model, but they weren’t offering the nearly half-off super-discount on that one at the time. 🙂  If you buy anything under a 180gb you will probably have to ‘fiddle’ with it.  If you’re ok with that – knock yourself out.  It’s not worth $60 over 3+ years of ownership for me anymore.
  4. Plug the drive into one of the built-in Intel 6gb/Sata3 ports.  Some people report trouble/lowered perf with the ‘add on’ Marvell/AMD/etc SATA3 controller ports (if your MB has them).
  5. Upgrade to Win7.  Love or hate it, Windows 7 has lots of new tweaks and optimizations for SSD use.  If you use an older OS, you won’t get those optimizations, and at worse, maybe shortening the life of your drive.  What are those optimizations?  Things like using the page file linearly to minimize random writes, support for TRIM to combine writes/reads, etc.  Get the latest service packs + updates too.
  6. Install your OS from scratch on the new drive.  You can use a disk imaging tool to get things across, but it’s FAR better to re-install your OS from scratch.  Windows 7 has tweaks for SSD’s if the drive is detected during install that might not turn on if you just clone a drive.
    In addition, if you’re like me and have an original Win7 install CD, you can freely download a Win7+SP1 image instead which saves you at least 20-30 minutes of downloading and installing SP1 after the install.  You can find links to the unified packages below.  Simply pick the one that MATCHES the version you bought (or the serial number won’t work).  Yes, these are 100% legal because they are the 30-day trial versions that you unlock with your purchased serial number.
    http://www.w7forums.com/official-windows-7-sp1-iso-image-downloads-t12325.html

    http://msft.digitalrivercontent.net/win/X17-24395.iso   <-  Win7 Ultimate x64 (for me!)
  7. Use the SSD for OS and ‘core’ apps you use – put other programs and data on a platter drive.  Even the biggest SSD’s are not big enough to hold the hundreds of megabytes of stuff most of us have.  A good balance of minimizing writes and extracting speed a lot of people have worked out is to install the OS and apps you use daily on the SSD, then install everything else and data to the platter drive. This requires the annoyance of paying attention to what drive letter/path to install to when installing your apps – but you only have to do that once (thankfully).
    The bigger question is data.  People that do video editing/photoshop/etc generate tons of big files that results in lots of writes to the drive.  That can be huge slowdowns in their workflows, and prime candidates for using on the SSD.  But it also means lots of writing to big sections of the drive.  I would almost recommend a second SSD for that work so if it fails, you don’t end up with an unbootable machine.  Most people should be fine with keeping their data on the platters, but do as you need and keep good backups if you do use the primary drive for data too.
  8. Optimizations after OS install– after you install, here are some of the more common things you should do
    1. Install the SSD drive management software – these packages often have system tuners that automatically check that the OS is set up for optimal performance.  Run them.
    2. Update the firmware on your drive – check for firmware updates regularly.  The Intel management software actually does this checking for you.  Many bugs, perf problems, and issues can be solved by simply making sure your drive is updated to the latest firmware.  Be careful though, some updates require the re-formatting of the drive.
    3. Disable drive indexing – results in lots of background disk access/writes that are not really necessary on SSD’s
    4. Disable automatic defragging – drive defragmentation is ON by default and is 100% not needed by SSD’s which have no concern about physical location of data on the drive.  In fact, it does nothing but result in tons of extra writing that shortens the life of the drive.
    5. Page file – This is a swap space for active memory.  Some turn this completely off, or put it on another drive.  The current thought is that you should shrink this down to about 1-2gb if you have 8gb of ram (or more) and leave it on the SSD.
    6. Superfetch/prefetch/bootfetch – these result in extra writes to the drive, and really aren’t needed since SSD’s are so fast.  Consensus is turn them off and see if that’s ok for you.  If you see slowdowns, then turn them selectively back on.
    7. Log files – you can turn off some of the copious amounts of logging windows does (and turn it back on if you have troubles later)
    8. Enable Write caching – I bought a $50 UPS for cheap and then turned on write caching.  This lets the system use main memory to cache up reads/writes before committing to the drive.  Besides reducing writing – I saw a good 10-20% speed up from enabling this on my platter drives.
    9. Change the location of temp files for your OS – you can change the location of temporary file generation to a platter drive to help reduce writes, but it will likely slow down installs or anything else that generates temp files.  I’ve left mine on the SSD for now. We’ll see how that goes.
    10. Change the location of temp files for your browser – you can change the location of the copious temporary files generated by your browser too.  I have a unique technique I outline in my previous posting below.

So, those are some high-level tips.  Go to the link for detailed instructions and discussions for these steps.

I have an SSD in my laptop, and now one in my desktop.  The battery life improvements on my laptop were awesome.  The bootup, shudown, and app start time are nearly instantaneous on both – simply stunning.   It’s like using a brand new kind of machine.
I would recommend a SSD to anyone that wants to really improve their home PC/laptop experience.  It really is the wave of the future that is settling in the market now.  Once they get the capacities up to 1TB, keep up the great improvements in drive longevity, and get the prices down (all things that are happening with each new release) – there will be no reason to own platter drives beyond wanting huge, slow bit buckets.

Moving your browser cache to a ramdrive

Moving your browser cache to a ramdrive

So, memory is dirt cheap right now. Crazy considering the prices just 2 years ago. I started with 8GB in my machine, then upped it to 16GB.  The reality has been, sadly, that I haven’t really seen a speedup or perf improvement from that extra ram as I rarely seem to use over even 8gb of memory.  Think my max has been 12GB so far.  It’s not really wasted as Windows 7 Prefetch is populating it with programs in the background – but that’s not super- interesting now that I have an SSD drive.  However, I do want to save my SSD from lots of browser cache writes.  What if I told you that you could do that, speed up your browsing by about 20% AND keeping you more secure. How?  By moving the browsers cache to a ramdrive.

Benefits:

  • Speed – reports are anywhere from 20%-100% speedups
  • Privacy – When you shut down and the ramdrive goes away – your entire browsing cache and cookies are irrevocably erased unless you persist/restore it from a regular drive.  No tracking cookies or other nasty junk is left around.  No need to ‘safe delete’ files.
  • Security – I’ve also already seen where this method caught a pop-up virus because when I rebooted and the app tried to install itself during the bootup cycle, the payload that was in the cache was gone and I caught the installer’s error message.
  • As long as you’re mostly hibernating/waking and not rebooting, the cache stays active and in memory.
  • Free and automatic once set up with about 5 easy steps
  • Some browsers are building this method into the browser itself
  • If you want to persist the cache between reboots – you can with a simple checkbox select.

Downsides:

  • Unless you persist/restore the ramdrive to a regular drive, you have to rebuild the cache each time you reboot.  First browsing on a page requires the reload of all the data.
  • Could potentially slow down your entire system if you are running short of memory
  •  Requires an initial setup

So, how do you do it?  The detailed instructions are on the linked websites below, but I’ll summarize here in case those instructions go away.  This is for firefox, but works for all other browsers too.

  1. Download DataRam Ramdisk and install it.  Amazing little ramdrive program that works on x32 and x64 Windows systems all the way up and through Windows 7. Great GUI frontend, does everything you expect, super stable, restarts on boot automatically.
  2. Open the Ramdisk configuration utility after install:
    1. Select the Settings tab
      1. Set the size to anything from 500-1500mb
      2. Set the file system type to Fat32
      3. Check the Disk Label checkbox and make sure the drive name is ‘RAMDisk’
    2. Select the Load and Save tab (optional step if you want the cache to persist between boots)
      1. If you want the browser cache stored and reloaded when you shut down the machine, select ‘Save disk image on shutdown’ and ‘Load disk image on Startup’.  Make sure they point to the same image file.
      2. I don’t do either of these as I want my cache to go away.  Loading/Saving the state will also increase both your bootup and shutdown times.
  3. Open Firefox
    1. Type ‘about:config’ (no quotes) in the address bar
    2. Hit the ‘I’ll be careful’ button
    3. Right click – select New -> String
    4. Type ‘browser.cache.disk.parent_directory’ into the box and press OK
    5. Type the path of your BrowserCache directory using the drive letter of the Ramdrive i.e. ‘R:BrowserCache’
    6. Close all open Firefox tabs and windows
    7. Reopen Firefox, open any webpage, and see if there is a new directory called BrowserCache on your ramdrive.
  4. Fix the drive letter on reboot.  Ramdisk has an annoying feature.  On reboot, it’ll assign the Ramdrive whatever random drive letter is available.  Obviously, this breaks the cache directory assignment in Firefox.  You’d need to update Firefox each reboot to point to the right drive.  Totally unacceptable.  DataRam’s Ramdisk doesn’t allow you to specify the drive letter of the ramdisk.  Totally unacceptable.  But – you can get around this by having a script move the drive letter during bootup.
    1. Copy the below code, then use notepad or other text editor to save it in a file called C:RamdiskRename.bat
    2. Press Win + R (or find “Run” on start menu), a “Run” dialog will appear. Enter “gpedit.msc” and select the “gpedit” in Programs list.
    3. In the left pane, click “Local Computer Policy” -> “Windows Settings” -> “Scripts(Startup/Shutdown)”  then on the right side, click “Startup”
    4. In the pop-up dialog, On the “Scripts” tab, click “Add…” and add the “C:RamdiskRename.bat” to the list. Click “OK” to finish.

Thats it!  To test it, reboot your machine, and you should see the ramdisk always at R.  When you open the browser for the first time after a reboot, you should see the cache directory appear in that drive. Using the Chromium benchmarking tool, the original author found that page load times were reduced by around 20%.  Shutting down and restarting the browser is also a lot quicker.

Links:
http://downloadsquad.switched.com/2010/11/10/how-to-move-the-firefox-or-chrome-cache-to-a-ram-disk-and-speed/
http://www.zomeoff.com/fixing-the-drive-letter-for-your-ramdisk-a-simple-solution-to-dataram-ramdisk/

RamdiskRename.bat:
@echo off
:: Settings
SET _ramdisklabel=RAMDISK
SET _ramdiskletter=R:

:: Get ramdisk disk number in diskpart
echo list volume > %systemdrive%ListDrives.tmp
diskpart /s %systemdrive%ListDrives.tmp > %systemdrive%DriveList.tmp
FOR /F "tokens=2-4" %%a IN ('type %systemdrive%DriveList.tmp') DO @IF /I "%%c"=="%_ramdisklabel%" @set _ramdisknum=%%a

:: Create drive change script
echo. > %systemdrive%ChangeDrive.tmp
if DEFINED _ramdisknum (
echo select volume %_ramdisknum% >> %systemdrive%ChangeDrive.tmp
echo assign letter=%_ramdiskletter% >> %systemdrive%ChangeDrive.tmp
)

:: Run diskpart using the new script file
diskpart /s %systemdrive%ChangeDrive.tmp

:: Delete the script files
del /q /f %systemdrive%ListDrives.tmp
del /q /f %systemdrive%ChangeDrive.tmp
del /q /f %systemdrive%DriveList.tmp

exit /b 0

Loading an icon from a file (Win32)

Loading an icon from a file (Win32)

I’m always perturbed by how difficult it is to load an icon in Win32 at times.  So many HICON/HANDLE and whatnot special data members and folks on forums doing strange stuff.  Here’s a snippet of code that just loads a simple icon file and displays it as your executable icon.  I’m sure there is a more correct/newer/snazzier way to do this – but this works fine for me…

LPCTSTR iconPathName= L"../MyIcon.ico";
UINT icon_flags = LR_LOADFROMFILE | LR_DEFAULTSIZE;
HANDLE hIcon = LoadImage(hInstance, iconPathName, IMAGE_ICON, 0, 0, icon_flags);

// set up RegisterClass struct
wcex.style            = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc    = WndProc;
wcex.cbClsExtra        = 0;
wcex.cbWndExtra        = 0;
wcex.hInstance        = hInstance;
wcex.hIcon            = (HICON) hIcon;
wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName    = NULL;
wcex.lpszClassName    = m_AppTitle.c_str();

// register the window class
return RegisterClassEx(&wcex);

Sony MDR-V6 headphone replacement ear pads

Sony MDR-V6 headphone replacement ear pads

After 5+ years of using these continually award-winning $120 headphones, the covering on the ear pads we’re starting to flake off and leave little black flakes around.  A common problem.  At under $7/each – and designed for easy replacement – getting replacement earpads was considerably cheaper than getting a new set of headphones.  Finding replacement pads, however, was somewhat difficult.  People had 3rd party pads, but the last replacement set I bought previously didn’t last much more than a year.  I went to Sony’s store, but didn’t have much luck finding them on their parts site.  Anyway, jumped on chat and got the skinny:

https://servicesales.sel.sony.com/ecom/accessories/web/productSearch.do
Once you’re there, please choose any of the items below (remote, adapter, etc). Then it will lead you to a new page and on the upper right hand there is a search box in which you can enter a search by part number.  Enter the part number and on the drop down menu, please choose “part number”.

Sony part number: 211566803
MDR-V6 headphone replacement ear pads – 211566803

They’ll show up as super-generic: PAD, EAR, but should be what you need.  Or at least I hope, since I just ordered them. 🙂

Photoshop ctrl+shift+alt+~

Photoshop ctrl+shift+alt+~

More tidbits of findings that I’m saving on my page in case they can’t be found again.  In previous version of Photoshop, they had an awesome shortcut for selecting highlights:

ctrl+shift+alt+~

However, since CS4, that hasn’t worked. I have had a dickens of a time finding the new key as this selection operation isn’t available via the menus – so I didn’t even know what the operation was called so I could Google it.  Then I found this link that told me what the new combination is:

ctrl-alt-2

This is a super-handy shortcut for some of the operations I do when balancing the brightness in a photo without losing the shadows.  Now you know – and knowing is half the battle!

Skype crashing after about 5 seconds of call

Skype crashing after about 5 seconds of call

Lord I love things that make sense.

If you’re experiencing Skype crashing after about 5 seconds of audio, then try this:  It worked for me.

Find and delete the shared.xml file in the Skype data folder located here:
C:Users%username%AppDataRoamingSkype

How that does ANYTHING is beyond me, but it did work.

Why _CrtDumpMemoryLeaks can make you think you’re leaking memory – but you’re not

Why _CrtDumpMemoryLeaks can make you think you’re leaking memory – but you’re not

I just spent an hour or two tracking down the last 16-byte memory leak in a project that I was working on. What it turned out to be was actually something EXPLICITLY cited in the Microsoft reference manual as having been fixed.  Yet it turned out not to be.

I had finished instrumenting my program for CRT memory reporting. CRT memory leak reporting is normally very handy as it tells you exactly what lines of code are the source of the leak, how many bytes, and dumps the data that’s leaking. All it requires is that you instrument your headers as described here <http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx>

// this goes before ANY other includes in ALL your headers
#define _CRTDBG_MAP_ALLOC
#include <blah>
#include <blah>
...
 main()
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // tells leak detector to dump report at any program exit
    _CrtSetBreakAlloc(18); // set breakpoint on a specific allocation number
}

With all this done you can run the program and then see the results of the report in the Visual studio output window when the program exits:

Detected memory leaks!
Dumping objects ->
C:PROGRAM FILESVISUAL STUDIOMyProjectsleaktestleaktest.cpp(20) : {18}
normal block at 0x00780E80, 64 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.

If you use the _CrtSetBreakAlloc() with the allocation number ({18}in this case), when the program starts up in debug mode the debugger will automatically stop on that allocation. You can then look at the call stack and get a great idea of whats leaking and why. Overall, it’s very handy and helped me track down all my leaks.

Well, the problem was that I fixed all the leaks but 2 in my particular program.  I reduced the code down until I was down to just main() that dumped the memory report and exited.   The problem was that it STILL reported a leak! I added a fake leak, and the very first allocation (that was leaking) in the program had a higher allocation number than the allocations that were supposedly leaking.  This implied quite strongly that the leak is happening BEFORE I actually even get into the program. How is that possible?

Well, there are a few things that get allocated for you before your program starts. Fixed-sized arrays, (int array[10];) string literals, and static variables are all objects are allocated on the stack (as opposed to the heap) are usually allocated at load time. When I looked at all the static allocations in my program, I saw this:

class Bar
{
    ...
private:
    static std::string m_name;
    static std::string m_value;
}

Do you see any problem?  I didn’t – at first. The problem is that std::string is a STL object that has a constructor.  Statics are usually allocated at load time. Which means their constructors are likely being called during load time BEFORE the main() is hit. We assume that the corresponding destructors are called after main exits. Apparently, the CRT memory tracking starts right as the program starts but is supposed to ignore any CRT allocations (ones made by the standard C libraries).  Apparently these static allocations by STL objects are captured.  Since we report leaks BEFORE we hit the program exit, we haven’t actually hit those ‘hidden’ destructors for those static strings yet.  Those allocations are still reported as active – and hence ‘leaked’.  I only caught this because I’d initialized those strings with string literals.  The leak dumped the memory and I recognized the strings. So a good way to test if this is happening to you is set your object data to something unique and make sure those unique values appear in the leak report memory dump.

Yet another clue is that the value of an uninitialized string consists of a number that appears to be a memory address (while the addresses change each run, other allocations in that run have roughly the same addresses), and a bunch of zeros. This likely corresponds to a pointer to the character buffer, and an int that indicates size. This is further confirmed by the fact the leaks are 8 bytes each in x86 build, and 16 bytes on a x64 build. This corresponds to the sizeof(int)+sizeof(void*) sizes on the respective builds.

Solution:
The solution is to ignore what is (likely) a false report, or change the static std::string objects to non-static or static std::string* pointers. Then make an appropriate initializer/destructor that creates/destroys those string objects. This means the memory is allocated/deallocated on the heap in the scope of the program run. The other thing you do is file a bug with Microsoft and put a few comments on the documentation website that indicates the statics are still leaking and they haven’t really fixed it yet. 🙂

Links:
MS article about CRT memory debug operations that says this bug had been fixed (but it has not as of VS2012)

http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx

Siggraph 2011 Trip Report – Vancouver, BC

Siggraph 2011 Trip Report – Vancouver, BC

Summary: 
Very good trip, but not a huge ‘groundbreaking’ year of new technologies.

  • Courses were really good and had a lot of good information from top-notch game developers/houses.  Most of the courses included a review/update on ‘what is the current state of the art’ which is good for those who aren’t following those niches closely on a regular basis.
  • Voxels and voxel methods are kind of back in rage again – but for things like visibility, ambient occlusion, and AI pathfinding.
  • Lots of industry leaders questioning direction and disparate energies trying to figure out where the market and graphics are going.  API developers and HW vendors desperately trying to find out what the next platform of choice will be (laptop/mobile phone/pad/etc) so they can be positioned to capitalize on it when it becomes clear.  Nobody seems to know.
  • MLAA was the star tech of the show as far as people showing up with implementations and praise of it.
  • Many talks stressed that fact fast content creation and rapid artist pipelines are *the* driver of technologies and tools; and most coding/engine requirements are subservient to the needs of the content pipeline.
  • While the show floor was very much smaller than the California years, 3D printing and 3D capture was big.   You could get your face scanned at one booth and 3D print it at another one in just an hour or so.
  • Intel’s booth was really well attended with lots of interest in onloading techniques.  I had a number of good talks with developers – some of which wanted to know if we’d be bringing Larrabee back. J

 

Sunday:
Course
Destruction and Dynamics for Film and Game Production
This all afternoon session started with a great overview of current destruction techniques.  There was a great and thorough overview of the current ways to break up a mesh (Voronoi, Boolean, FEM convex decomposition, and tetrahedral creation), the methods and problems of collision detection after the breakup, and constraint solving.  The focus now is not so much on the math of the constraint solvers, but on how to use them in intuitive and fast ways for the artists.

Takeaways:

  • Use the best freely/commercially already available solver for your purpose out there.  Constraint solvers are now very clever and (all things considered) computationally cheap. 
  • Don’t futz with the solvers to get what you want – use tons of constraints to get the effects you want.  Many movie models (like the earthquake scenes of the movie 2012) used literally thousands of constraints per building.  By using constraints, you can scale the effect up and get nearly the same look/feel as when you did it on the low-poly version.  Fiddling with the solver just gets you more and more headaches as low-poly pre-vis ones will collapse very different than high-poly versions and vice-versa.
  • Treat the solvers as black boxes and use different activation systems to achieve desired effects. It is easy and intuitive for artists to use these below methods and nobody needs to experiment with the super-fiddly parameters of the constraint solvers for each kind of breaking they want
    • Dynamic activation = when you break an impulse threshold, you break the constraint holding it in place
    • ‘Glue objects’ that simply hold sets of other constraints together to get ‘clumping’ effects. When the set has a higher impulse than the individual pieces
    • Cascaded activation = you don’t even consider objects as breakable until it becomes an edge piece or is touching an edge piece.   Gives nice ‘collapsing wall’ effects.

Monday:
Course – Advances in Real-Time Rendering – Parts I & II
http://advances.realtimerendering.com/

  • Went to an all-day course with presentations of new real-time techniques by such big-wigs as CryEngine3, Halo R&D team, Little Big Planet, Disney and many others.  It appears that voxel techniques are making a comeback for Halo and Little Big Planet guys.
  • Upcoming Halo title had a fascinating technique for occlusion via voxels.   They collaborated with Umbru software to develop a new kind of voxel-based visibility and portal system when their existing watershed algorithm started breaking down with the new outdoor content
    • Use a BSP tree of voxel areas to descritize the scene into a hierarchy of voxels and connect the polygon geometry with voxels.  Then use that unique structure to generate portals automatically, do fast runtime visibility, and AI pathfinding
    • They also changed their engine’s threading system to be job based instead of a more manual load-balancing that didn’t scale.  They found novel ways to avoid synchronizing the game engine between threads and dramatically reduce memory copies.
  • For their new Cars 2 game, Disney used a unique uniform-grid system to lay out light probes for their spherical harmonic lighting system. Lead to some great optimizations and easy authoring.
  •  Little Big Planet was using voxels for spherical harmonics and ambient occlusion lighting.  They also used a single particle system with really clever screen-space blending in Little Big Planet 2 to generate all their special water/explosion/fire effects.
  • Cryengine 3 guys talked about how they used previous frames with re-projection to get fast occlusion culling and local reflection.  They also used a lazy technique of updating cascaded shadow maps with further out maps getting updated much less often.
  • Frostbite used a rhombus shaped boken technique which has more passes, but is separable and therefore runable on multiple threads.  They also used cascaded maps for culling, not just shadowing.
  • Treyarch talked about techniques they used on Call of Duty Black ops.  They only allowed one dynamic light per surface, but unlimited lightmaps/lightgrids and environment probles per object to always maintain a 60fps goal but with great lighting effects.
  •  A talk by a new developer in ‘stealth mode’ who talked about Real-Time Image Quilting – which allowed realtime texture quilting without seams for expansive environments.
  •  The Gears of War 3 guys talked about overcoming lighting constraints on the PS3 by combining the light vectors into a single combined vector and doing tricks to extract it in the shader
  • Final talk was by a fellow who did super-accurate, highly realistic facial rendering with subsurface scattering.  His technique was an improvement on the nVidia one in many ways (speed/quality), but still not realitime.  Still, was interesting conversation about the difficulties of rendering realistic skin.

         

Tuesday
Course- Beyond Programmable Shading I + II

All day course that talked about the direction and emerging graphics trends.  I alternated between this and looking at posters during the day.

  • Raja Koduri from Apple did a great talk on how power is managed in current devices.  He basically echoed what Intel has been saying: power isn’t scaling with Moore’s law – and how simple programming mistakes can save or kill a battery.  He talked about the need for dialog between hardware and software folks to develop API’s for power usage feedback and for current API’s that might need to be re-worked for low-power futures.
  • There was talk about allowing the actual scheduling methods used internally to graphics processors might need to be exposed in the future for greater programmability and what possibilities that might open.
  • There was a talk about how nVidia Optix SIMD-izes it’s ray tracing pipeline
  • Decent talk on current state of the art on bokeh, motion blur and DOF effects.
  • There was a good talk by Intel’s Marco Salvi on their OIT methodology along with other recent efforts.
  • At the end, there was a SUPER open-panel discussion with speakers about where DirectX/OpenGL/OpenCL were going.  The consensus is that there is no consensus.  Things are in a real flux right now with radically competing demands. Console devs want absolute control (open the gfx api command buffer to us!), mobile developers that want low-power/long life, desktop devs still wanting the best quality, and the uncertainty of the ‘platform of the future’ being really unknown (will we all be on iPads/consoles/laptops/etc).  The only thing they seem to agree on is that DirectX/OpenGL are basically still the best solutions we have unless we want to really bifurcate the API landscape – and it’s unclear whether we want to do that.  There’s a lot of opportunity for new technologies and new movers to make a big impact.

Poster sessions was pretty good with lots of entrants.  Nothing ground breaking, but there were several topics that I now want to look up. (don’t have notes with me today).

 

Wednesday:

  • Spent good part of the morning wandering the show floor, checking out some of the art and book displays, and seeing the show reels in the digital theater.  The afternoon was my turn in booth duty.
  • Show floor and hiring area was noticeably smaller than the California venue.  Big things this year: 3D printers were really big with lots of people doing super-cool live demos.  3D image capture was also big with some great facial/body capture systems.  Lots of 2-3 year computer art degree programs and schools were really pushing their schools.  I worry that there is going to be a glut of artists in about 3-4 years when these masses of graduates get out.

 

Thursday:

A grab bag day of talks as the all-day courses were mostly over.

Hiding Complexity (occlusion culling):

  • For Allen Wake’s almost all outdoor scenes, he used a method of culling shadows that looked from objects to their visible lights.  He’d then use scissor rects for each cascaded shadow layer to avoid filling pixels where they weren’t needed and not even render certain cascades if they were empty.  He also used temporal cues/temporal bounding boxes to avoid recalculating cascades if they didn’t change much
  • Latest Need for Speed – the classic SIMD tale.  They realized a 40x speedup by just throwing out their fancy data structures and simply SIMD-izing their culling system and arranging the data by the track layout.
  • Killzone 3 culling – many details, but basically they use a quick sw rasterizer distributed on many PS3 SPU’s to determine list of objects to draw on a 640x360p depth buffer in 16 pixel high strips.  In the visibility step, the assume all objects visible last frame are still visible, then test individual objects against the depth buffer in parallel.  Do simple sphere reject first, then bounding box test if sphere test passes.  For determining good occluders automatically, they use the low-poly physics mesh of the object.  They pick objects that have a fairly large bounding box, and who’s coverage area is near it’s bounding box area.  (actual coverage area is stored in meta-data).

Smokin’ Fluids:

  • Mostly non-realtime smoke simulation talks.  Best talk was on capturing thin features in smoke simulations. They used a moderately low voxel field with particles to simulate.  Then they did a clever pass over the data to ‘condition’ the voxel data to maintain superb fine details.  Turned out to be almost 10x faster than traditional method and didn’t suffer from the problems of simulations looking very different at higher and higher simulation densities.

Discrete differential geometry

  • Some pretty heady talks on discrete laplacians and circular arc structures.  Most of it was above my head – but was an interesting talk about how they could identify whether a curvy building could be made up of manufacturable, uniform pieces (like a geodesic dome)

Filtering Techniques for AA

  • Great talk on AA techniques which really turned into the ‘Why you should convert your game to MLAA today” cheering session.  Presentations started with different presentations on how people implemented MLAA in God of War III, on Xbox, and on PS3 for various games.
  • Good talk on FXAA and SRAA as alternatives from nVidia – but over half the room left by this point.
  • One guy from nVidia got up and said if they could give you MSAA or the like for nearly free if they’d convert back.  The speaker said, “No, I’d still keep MLAA on the CPU and then use the GPU for something else”.
Fixing more Battlefield 2 problems

Fixing more Battlefield 2 problems

Battlefield: Bad Company 2 on my PC was causing me MAJOR grief.  I’d get into a game, and about 5 minutes in, I’d get dropped and ‘connection to EA server lost’ message.  UTTERLY annoying.  Appears tons of other people have the same problems.  Various solutions from turning firewalls off/etc – but that didn’t work for me.

Changing your router’s UDP and TCP endpoint filtering to “Endpoint Independent” certainly helped – but it would still drop after about 10 minutes.

What seems to have worked is this.  Go to your steam client and:

Steam Library -> rightclick BC2 -> properties -> Set launch options… -> “-pingInterval 50000”
Paste the “-pingInterval 50000” phrase without the quotation marks and that’s it.

That seems to have solved the problem for me; but this was pretty much utter fail on EA/Dice’s part. The amount of hate-forum mail that’s gone on for over 2 years relating to this problem is amazing.

More Battlefield 2 adventures: PnkBsrtrB.exe handshaking failed

More Battlefield 2 adventures: PnkBsrtrB.exe handshaking failed

So, when playing the AIX mod for Battlefield 2, I kept getting kicked after about 2-3 minutes of play when punkbuster(!) complained that:

PnkBsrtrB.exe handshaking failed ; PnkBsrtrB.exe heartbeats stopped ; PB init failure ; Packet loss

The basic problem boiled down to the fact that when Punkbuster installed, it created the outgoing rules in windows firewall, but it did not create the INCOMING rules.  I simply added incoming rules for:

c:windowssysWOW32PnkBsrtrA.exe
c:windowssysWOW32PnkBsrtrB.exe

And set them to ‘allow’.  That turns out to fix the problem.

I still can’t believe how horrible the solutions to prevent cheating were back in the day.