r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

Cory Doctorow – Every pirate wants to be an admiral

r3dux | May 31, 2011

The good Mr. Doctorow briefly discusses the progression of copying in culture from the earliest silent-movie piano performances to the Net, and how it’s reached a stage where the corporations are strong-arming legislature that will give you three strikes and cut you off if you don’t put your hand in your pocket.

Definitely worth seeing, if only for the grin-inducing progression of Performance-to-Piracy claims :D

Comments
No Comments »
Categories
Life, Tech
Tags
Admiral, Cory Doctorow, Film, Media, Music, Piracy
Comments rss Comments rss
Trackback Trackback

VLT (Very Large Telescope) HD Timelapse Footage

r3dux | May 30, 2011
YouTube Preview Image

How beautiful, and love the music (The Calm Blue Sea). Kinda makes me feel pretty small and insignificant, but I guess it’s only because I am…

A whole heap of info about the VLT array itself can be found here for those of a curious nature.

Comments
No Comments »
Categories
Imagery, Music
Tags
Footage, Galaxy, Space, Telescope, Timelapse, Very Large Telescope, VLT
Comments rss Comments rss
Trackback Trackback

The House of the Dead: Overkill coming to PS3

r3dux | May 29, 2011

Woo-hoo! Loved this game on the Wii (and the wife and I laughed our asses off playing it) – so a HD version on a console with enough grunt to actually run it at a decent frame rate is more than welcome! Also, PlayStation Move support should make it just as point-and-shoot as the Wii version.

YouTube Preview Image

Gameplay footage of the first mission, which contains lots of blood and swearing, can be found: here

Papa Caesar FTW!

Comments
No Comments »
Categories
Gaming
Tags
HOTD, House of the Dead, Move, Overkill, PS3, Wii
Comments rss Comments rss
Trackback Trackback

OpenGL – A Modified Phong-Blinn Light Model For Shadowed Areas

r3dux | May 28, 2011

I was looking through the book Graphics Programming Methods (2003) the other day when I came across a paper titled “A Modified Phong-Blinn Light Model for Shadowed Areas” and thought it was pretty good, so I implemented it. It’s a really short paper, but what’s it’s basically saying is that by not allowing ambient light to be modified by geometry normals, any characteristics of the geometry are lost because we calculate the diffuse intensity as the dot product of the light location and the surface normal and limit the result between 0 and 1 (i.e. we only take diffuse lighting into consideration for surfaces facing our light source).

What the paper proposes instead is that we allow the dot product to run as -1.0 to +1.0, and when the value is within the range 0.0 to 1.0 (i.e. facing the light) we shade as usual, but when it’s -1.0 to 0.0 (facing away from the light) we calculate the lighting as the ambient light plus the negative diffuse intensity multiplied by the ambient light multiplied by q, where q is a value between 0.0 and 1.0. When q is 0.0, it’s like we’re using a traditional Phong-Blinn model, when it’s 1.0 we’re using the fully modified version, and any value in between is a sliding-scale combination of them.

To put that another way, if our surface is facing away from the light source, we use: Lighting = Ambient + (Diffuse * Ambient * q)

In the following images, the light source is roughly in line with the geometry on the Y and Z axis’, and is a way over on the positive X axis (i.e. to the right). Check out the difference…

Standard lighting with q = 0.0

Standard lighting with q = 0.0 - notice that the inside right area of the torus is getting no diffuse lighting, and all detail is lost to the ambient lighting.

Improved lighting with q = 0.5

Improved lighting with q = 0.5 - there's now some detail in the shadowed area on the inside-right of the torus

Improved lighting with q = 1.0

Improved lighting with q = 1.0 - there's now significantly more detail in the shadowed area on the inside-right of the torus

To create this effect, I used the following fragment shader:

Modified Phong-Blinn Light Model Fragment Shader

#version 330
 
// Uniforms
uniform vec4 ambientColour;
uniform vec4 diffuseColour;
uniform vec4 specularColour;
uniform sampler2D colourMap;
uniform sampler2D normalMap;
uniform float qUniform; // A value to manipulate our lighting by when surface is facing away from light source
 
// Input from our vertex shader
smooth in vec3 vVaryingNormal;
smooth in vec3 vVaryingLightDir;
smooth in vec2 vTexCoords;
 
// Output fragments
out vec4 vFragColour;
 
void main(void)
{ 
	const float maxVariance = 2.0; // Mess around with this value to increase/decrease Normal pertubation
	const float minVariance = maxVariance / 2.0;
 
	// Create a normal which is our standard normal + the normal map perturbation (which is going to be either positive or negative)
	vec3 normalAdjusted = vVaryingNormal + normalize(texture2D(normalMap, vTexCoords.st).rgb * maxVariance - minVariance);
 
	// Get our diffuse intensity as a dot product which is NOT limited 0..1
	float diffuseIntensity = dot(normalize(normalAdjusted), normalize(vVaryingLightDir)); 
 
	vec3 colour = vec3(0.0);
 
	// If the surface is facing the light then shade as normal
	if (diffuseIntensity > 0.0)
	{
		colour = (diffuseIntensity * diffuseColour.rgb) * texture2D(colourMap, vTexCoords.st).rgb + ambientColour.rgb;
	}
	else // Otherwise use the modified light model
	{
		colour = (diffuseIntensity * diffuseColour.rgb * ambientColour.rgb * qUniform) + ambientColour.rgb;
	}
 
	// Set the almost final output color as a vec4 - only specular to go
	vFragColour = vec4(colour, 1.0);
 
	// Specular light
	vec3 vReflection        = normalize(reflect(-normalize(normalAdjusted), normalize(vVaryingLightDir)));
	float specularIntensity = max(0.0, dot(normalize(normalAdjusted), vReflection));
 
	// Add in specular component
	if (diffuseIntensity > 0.0)
	{
		float fSpec = pow(specularIntensity, 64.0);
		vFragColour.rgb += vec3(fSpec * specularColour.rgb);
	}
}

Credits for this method go to Anders Hast, Tony Barrera, and Ewer Bengtsson – good work, fellas! =D

Comments
No Comments »
Categories
Coding
Tags
Blinn, Fragment, GLSL, Lighting, Modified, OpenGL, Phong, Shader, Shadow, Shadowed
Comments rss Comments rss
Trackback Trackback

Simple OpenGL FBO Textures

r3dux | May 26, 2011

I was playing around with FBOs and rendering to textures the other week and came up with this. A spinning yellow torus is rendered to a texture, then a second spinning torus is textured using the texture we just created of the first spinning torus… Yeah, I need to stop using donuts as my test objects.

YouTube Preview Image

Full source code & shaders after the jump…

Read the rest of this entry »

Comments
No Comments »
Categories
Coding
Tags
C++, FBO, Fragment, GLSL, OpenGL, Shader, Texture, Vertex
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“Try typing a random number into a search engine. Every number tells a story: 354165 is biology lab equipment...”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox