background

Archive for October, 2009

OpenCL in openFrameworks example – 1 milion particles @ 100-200fps

Posted in Shared on October 29th, 2009 by herkulano – Be the first to comment

Recently I've been playing a lot with OpenCL, the new API / framework designed to handle cross-platform parallel computing (i.e. a simple way of running code simultaneously on all cores of your CPU, GPU or other processors). Implementations have been cropping up this year in NVidia drivers or ATI drivers, but most famously it's included with Mac OSX 10.6 Snow Leopard.

To cut a long story short I've been working on a simple-to-use C++ wrapper for some of the most common functions, imaginatively called ofxOpenCL and here is a little demo of 1 million particles running at 100-200fps.

NOTE: The Vimeo compression destroys most of the particles, so I suggest downloading the quicktime directly from the vimeo page at http://www.vimeo.com/7332496


This is 1,000,000 particles being interacted on by mouse, updated on GPU (with springy behaviours ) via an OpenCL kernel, data written straight to a VBO and rendered - without ever coming back to host (i.e. main memory + cpu etc.)

Frame-rate is around 100-200fps running on a macbook pro with GF 9600GT. That's 100-200fps on a laptop! (albeit a pretty decent one), but I'm dying to try this on a GF 285 GTX - which has 7.5x the number of cores, 2.5x the fillrate and 3.5x the memory bandwidth - for only £250!!

The kernel for this is surprisingly simple:

__kernel void updateParticleWithoutCollision(__global Particle* pIn, __global float2* pOut, const float2 mousePos, const float2 dimensions){
	int id = get_global_id(0);
	__global Particle *p = &pIn[id];
 
	float2 diff = mousePos - pOut[id];
	float invDistSQ = 1.0f / dot(diff, diff);
	diff *= 300.0f * invDistSQ;
 
	p->vel += (dimensions*0.5 - pOut[id]) * CENTER_FORCE2 - diff* p->mass;
	pOut[id] += p->vel;
	p->vel *= DAMP2;
 
	float speed2 = dot(p->vel, p->vel);
	if(speed2<MIN_SPEED2) pOut[id] = mousePos + diff * (1 + p->mass);
}

This example is based on Rui's opencl example at http://vimeo.com/7298380.

Discussion on the matter at http://www.openframeworks.cc/forum/viewtopic.php?f=10&t=2728&p=15107#p15...

source code for ofxOpenCL and the above example at
http://code.google.com/p/ofxmsaof/downloads/list
(the SVN is likely to be more recent).

Announcing Google Maps Navigation for Android 2.0

Posted in Shared on October 28th, 2009 by herkulano – Be the first to comment
(cross-posted on the Official Google Blog)

Since 2005, millions of people have relied on Google Maps for mobile to get directions on the go. However, there's always been one problem: Once you're behind the wheel, a list of driving directions just isn't that easy to use. It doesn't tell you when your turn is coming up. And if you miss a turn? Forget it, you're on your own.

Today we're excited to announce the next step for Google Maps for mobile: Google Maps Navigation (Beta) for Android 2.0 devices.

This new feature comes with everything you'd expect to find in a GPS navigation system, like 3D views, turn-by-turn voice guidance and automatic rerouting. But unlike most navigation systems, Google Maps Navigation was built from the ground up to take advantage of your phone's Internet connection.

Here are seven features that are possible because Google Maps Navigation is connected to the Internet:

The most recent map and business data
When you use Google Maps Navigation, your phone automatically gets the most up-to-date maps and business listings from Google Maps — you never need to buy map upgrades or update your device. And this data is continuously improving, thanks to users who report maps issues and businesses who activate their listings with Google Local Business Center.

Search in plain English
Google Maps Navigation brings the speed, power and simplicity of Google search to your car. If you don't know the address you're looking for, don't worry. Simply enter the name of a business, a landmark or just about anything into the search box, and Google will find it for you. Then press "Navigate", and you're on your way.

Search by voice
Typing on a phone can be difficult, especially in the car, so with Google Maps Navigation, you can say your destination instead. Hold down the search button to activate voice search, then tell your phone what you want to do (like "Navigate to Pike Place in Seattle"), and navigation will start automatically.

Traffic view
Google Maps Navigation gets live traffic data over the Internet. A traffic indicator light in the corner of the screen glows green, yellow or red, depending on the current traffic conditions along your route. If there's a jam ahead of you, you'll know. To get more details, tap the light to zoom out to an aerial view showing traffic speeds and incidents ahead. And if the traffic doesn't look good, you can choose an alternate route.

Search along route
For those times when you're already on the road and need to find a business, Google Maps Navigation searches along your route to give you results that won't take you far from your path. You can search for a specific business by name or by type, or you can turn on popular layers, such as gas stations, restaurants or parking.

Satellite view
Google Maps Navigation uses the same satellite imagery as Google Maps on the desktop to help you get to your destination. Turn on the satellite layer for a high-resolution, 3D view of your upcoming route. Besides looking cool, satellite view can help you make sense of complicated maneuvers.

Street View
If you want to know what your next turn looks like, double-tap the map to zoom into Street View, which shows the turn as you'll see it, with your route overlaid. And since locating an address can sometimes be tricky, we'll show you a picture of your destination as you approach the end of your route, so you'll know exactly what to look for.

Since there's nothing quite like seeing the product in action, we made this video to demonstrate a real-life example:




The first phone to have Google Maps Navigation and Android 2.0 is the Droid from Verizon. Google Maps Navigation is initially available in the United States. And like other Google Maps features, Navigation is free.

Click here to learn more and browse a gallery of product screenshots. Take Google Maps Navigation for a spin, and bring Internet-connected GPS navigation with you in your car.

Posted by Keith Ito, Software Engineer

Google drops Android 2.0 SDK

Posted in Shared on October 27th, 2009 by herkulano – Be the first to comment

One day after we called out Google for holding onto the Android 2.0 SDK, it magically appeared on their website. Developers can now grab the new SDK from the official Android site.

Hightlights of the Android 2.0 platform include:

Contacts and accounts

  • Multiple accounts can be added to a device for email and contact synchronization, including Exchange accounts. (Handset manufacturers can choose whether to include Exchange support in their devices.)
  • Developers can create sync adapters that provide synchronization with additional data sources.
  • Quick Contact for Android provides instant access to a contact’s information and communication modes. For example, a user can tap a contact photo and select to call, SMS, or email the person. Other applications such as Email, Messaging, and Calendar can also reveal the Quick Contact widget when you touch a contact photo or status icon.

  • Sync support for contacts from multiple data sources including Exchange. Handset manufacturers can choose whether or not to include Exchange support in their devices.
  • New way to hover on a person to see more info and select communication mode (for example, phone, SMS, email).

Email

  • Exchange support.
  • Combined inbox to browse email from multiple accounts in one page.

Messaging

  • Search functionality for all saved SMS and MMS messages.
  • Auto delete the oldest messages in a conversation when a defined limit is reached.

Camera

  • Built-in flash support
  • Digital zoom
  • Scene mode
  • White balance
  • Color effect
  • Macro focus

Android virtual keyboard

  • An improved keyboard layout to makes it easier to hit the correct characters and improve typing speed.
  • The framework’s multi-touch support ensures that key presses aren’t missed while typing rapidly with two fingers.
  • A smarter dictionary learns from word usage and automatically includes contact names as suggestions.

Browser

  • Refreshed UI with actionable browser URL bar enables users to directly tap the address bar for instant searches and navigation.
  • Bookmarks with web page thumbnails.
  • Support for double-tap zoom.
  • Support for HTML5:
    • Database API support, for client-side databases using SQL.
    • Application cache support, for offline applications.
    • Geolocation API support, to provide location information about the device.
    • <video> tag support in fullscreen mode.

Calendar

  • Agenda view provides infinite scrolling.
  • Events indicate the attending status for each invitee.
  • Invite new guests to events.

Media Framework

Revamped graphics architecture for improved performance that enables better hardware acceleration.

Bluetooth

  • Bluetooth 2.1
  • New BT profiles: Object Push Profile (OPP) and Phone Book Access Profile (PBAP)

New Framework APIs

Android 2.0 includes several new developer APIs. For an overview of new APIs, see the Android 2.0 version notes.

For a complete report of all API changes, see the API Differences Report.

Quick Contact for Android Multiple Accounts Messaging Search Email Combined Inbox Camera Modes Welcome to Android 2.0

Dyson’s Bladeless Fan

Posted in Shared on October 26th, 2009 by herkulano – Be the first to comment

Sir James Dyson asks questions about products that no one else seem to ask. Like does a fan need blades? Apparently not. Look at that thing. Amazing. (via not cot)

Dunbar's Number isn't just a number, it's the law

Posted in Shared on October 26th, 2009 by herkulano – Be the first to comment

Dunbar's number is 150.

And he's not compromising, no matter how much you whine about it.

Dunbar postulated that the typical human being can only have 150 friends. One hundred fifty people in the tribe. After that, we just aren't cognitively organized to handle and track new people easily. That's why, without external forces, human tribes tend to split in two after they reach this size. It's why WL Gore limits the size of their offices to 150 (when they grow, they build a whole new building).

Facebook and Twitter and blogs fly in the face of Dunbar's number. They put hundreds or thousands of friendlies in front of us, people we would have lost touch with (why? because of Dunbar!) except that they keep digitally reappearing.

Reunions are a great example of Dunbar's number at work. You might like a dozen people you meet at that reunion, but you can't keep up, because you're full.

Some people online are trying to flout Dunbar's number, to become connected and actual friends with tens of thousands of people at once. And guess what? It doesn't scale. You might be able to stretch to 200 or 400, but no, you can't effectively engage at a tribal level with a thousand people. You get the politician's glassy-eyed gaze or the celebrity's empty stare. And then the nature of the relationship is changed.

I can tell when this happens. I'm guessing you can too.

Bryan Snyder's The Carlsbad Temptress

Posted in Shared on October 23rd, 2009 by herkulano – Be the first to comment

The Carlsbad Temptress by bryan snyder from Bryan Snyder on Vimeo.

(via Animal)

Top this!

Posted in Shared on October 21st, 2009 by herkulano – Be the first to comment

Diablo Cody on the pressure to outdo herself:

So what kind of pressure did you feel, post-Juno, to write something good?
None.

I don’t believe you.
Seriously. How could I possibly? The experience that I had with Juno is something I could never replicate, ever. First of all, you never have your first baby again. Second, the whole production was really charmed from start to finish. I mean, every moment of it was special. And then it culminated in Oscar nominations...I’m so fortunate that I got to have that experience. Now I almost feel this great calm coming over me. I’d be feeling a lot more pressure if I was still striving for that goal.

Sometimes, the work is the work and the goal isn't to top what you did yesterday. Doing justice to the work is your task, not setting a world record.

Apple goes live with HTML5 video

Posted in Shared on October 21st, 2009 by herkulano – Be the first to comment

Apple has a fair amount of video on their site, and now you will find it displayed via <video> As always, it looks very nice indeed. The video controls look very much like the new Quicktime X:

html5videoapple

All via the code:

html5videoapplecode

Of course, for all the deets on video, check out brother Mark.