Showing posts with label GLSL. Show all posts
Showing posts with label GLSL. Show all posts

Tuesday, March 18, 2008

Cube Mapping

The GLSL mat3 constructor that is supposed to take a mat4 and slice out the upper 3x3 doesn't work on my MacBook Pro. Apparently I'm not the only one. http://emergencyexit.untergrund.net/2007/12/glsl/

As described in the above url, you can use the following instead:

mat3(matrix[0].xyz, matrix[1].xyz, matrix[2].xyz)

Thursday, March 6, 2008

gl_NormalMatrix

I've run into a few driver problems under OS X

For comparison, here are my system specs:
Mac OS X Version 10.5.2
Processor: 1.5 GHz PowerPC G4
Memory 512 MB DDR SDRAM

gl_NormalMatrix is computed incorrectly on my mac.
The problem, and a temporary solution are listed below.
frag_Normal = gl_NormalMatrix * gl_Normal

frag_Normal = (gl_ModelViewMatrix * vec4(gl_Normal, 0.0)).xyz


Framebuffer objects must be powers of two.

More to come.