If you want, you can download the build too. I have only tested this on like two computers though. ;-)
UPDATED: Changed the video (and download)... now with actual balloons! :)
<script src="http://www.google.com/jsapi/?key=GOOGLE AJAX API KEY" type="text/javascript"></script>
<div id="feedControl"></div>
<script type="text/javascript">
function loadFeedControl() {
var feed = new google.feeds.Feed("FEED URL");
feed.setNumEntries(16);
feed.includeHistoricalEntries();
feed.load(function(result) {
if (result.error) {
return;
}
var container = document.getElementById("feedControl");
if (!container) {
return;
}
for (var i = 0; i < result.feed.entries.length; i++) {
var p = document.createElement("p");
p.innerHTML = result.feed.entries[i].content;
container.appendChild(p);
}
});
}
google.load("feeds", "1");
google.setOnLoadCallback(loadFeedControl);
</script>
m_top = m_near * Math::tan(0.5f * m_verticalFov);
m_right = m_top * m_display->aspectRatio();
Given all that, here is the GLSL function that will return the view space position for the given pixel position:vec3 viewSpacePos(vec2 winPos, vec2 winSize, vec4 depthSample, vec2 nearFar)
{
vec3 position;
float depth = depthSample.x;
position.z = -nearFar.x / (nearFar.y - (depth * (nearFar.y - nearFar.x))) * nearFar.y;
position.x = (((winPos.x / winSize.x) * 2.0) - 1.0) * u_right;
position.y = (((winPos.y / winSize.y) * 2.0) - 1.0) * u_top;
float scale = -position.z / nearFar.x;
position.x *= scale;
position.y *= scale;
return position;
}
Hope this helps someone out there! It might be best you try derive it yourself too, so you can debug it (if you ever need to)... :)