diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-11-02 19:37:52 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-11-02 19:37:52 (GMT) |
| commit | 640d4e9e3a1aee1f99a4e43025a1301ec19bfdc1 (patch) | |
| tree | 6384cc9919492f44d95c59640ade8c0ce393154d /includes | |
| parent | 7de6526a1e545d258a0c83ceab7acc6ca89d6b98 (diff) | |
| download | powder-640d4e9e3a1aee1f99a4e43025a1301ec19bfdc1.zip powder-640d4e9e3a1aee1f99a4e43025a1301ec19bfdc1.tar.gz | |
Fix Air inversion
Diffstat (limited to 'includes')
| -rw-r--r-- | includes/graphics.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/includes/graphics.h b/includes/graphics.h index de61e47..b9d39bb 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -258,16 +258,44 @@ const char * lensVertex = "void main(void)\ gl_Position = ftransform();;\ gl_FrontColor = gl_Color;\ }"; -const char * airFragment = "uniform sampler2D airX;\ +const char * airVFragment = "uniform sampler2D airX;\ uniform sampler2D airY;\ uniform sampler2D airP;\ void main () {\ vec4 texX = texture2D(airX, gl_TexCoord[0].st);\ vec4 texY = texture2D(airY, gl_TexCoord[0].st);\ vec4 texP = texture2D(airP, gl_TexCoord[0].st);\ - gl_FragColor = vec4(abs(texX.r)/2.0, texP.b/2.0, abs(texY.g)/2.0, 1.0);\ + gl_FragColor = vec4(abs(texX.r)/2.0, texP.b/2.0, abs(texY.g)/2.0, 1.0);\ }"; -const char * airVertex = "void main(void)\ +const char * airVVertex = "void main(void)\ +{\ + gl_TexCoord[0] = gl_MultiTexCoord0;\ + gl_Position = ftransform();;\ + gl_FrontColor = gl_Color;\ +}"; +const char * airPFragment = "uniform sampler2D airX;\ +uniform sampler2D airY;\ +uniform sampler2D airP;\ +void main () {\ + vec4 texP = texture2D(airP, gl_TexCoord[0].st);\ + gl_FragColor = vec4(max(texP.b/2.0, 0), 0, abs(min(texP.b/2.0, 0)), 1.0);\ +}"; +const char * airPVertex = "void main(void)\ +{\ + gl_TexCoord[0] = gl_MultiTexCoord0;\ + gl_Position = ftransform();;\ + gl_FrontColor = gl_Color;\ +}"; +const char * airCFragment = "uniform sampler2D airX;\ +uniform sampler2D airY;\ +uniform sampler2D airP;\ +void main () {\ + vec4 texX = texture2D(airX, gl_TexCoord[0].st);\ + vec4 texY = texture2D(airY, gl_TexCoord[0].st);\ + vec4 texP = texture2D(airP, gl_TexCoord[0].st);\ + gl_FragColor = vec4(max(texP.b/2.0, 0), 0, abs(min(texP.b/2.0, 0)), 1.0) + vec4(abs(texX.r)/8.0, abs(texX.r)/8.0, abs(texX.r)/8.0, 1.0) + vec4(abs(texY.g)/8.0, abs(texY.g)/8.0, abs(texY.g)/8.0, 1.0);\ +}"; +const char * airCVertex = "void main(void)\ {\ gl_TexCoord[0] = gl_MultiTexCoord0;\ gl_Position = ftransform();;\ |
