Commit b7ecf61a authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Added focus blur and initial shadow shader code.

parent 34a96829
gladedir = $(datadir)/@PACKAGE@
glade_DATA = Functy.glade cartesian.vs cartesian.fs spherical.vs spherical.fs curve.vs curve.fs
glade_DATA = Functy.glade cartesian.vs cartesian.fs cartesian-shadow.vs cartesian-shadow.fs spherical.vs spherical.fs spherical-shadow.vs spherical-shadow.fs curve.vs curve.fs curve-shadow.vs curve-shadow.fs screen.fs screen.vs
EXTRA_DIST = $(glade_DATA)
#version 120
//uniform vec3 vPosition, vScale;
//uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
//varying vec3 vFuncParams;
//varying mat3 vNormalMatrix;
///*REPLACE:controlvars*//*END*/
//float DifferentialX (float x, float y, float t);
//float DifferentialY (float x, float y, float t);
//vec4 Colour (float x, float y, float z, float t);
void main () {
// vec3 vHalf;
// float fNDotL;
// float fNDotHV;
// vec4 vColour;
// vec4 vColourRaw;
// float fAttenuation;
// vec3 vNormalBidir;
// vec3 vTangentX;
// vec3 vTangentY;
// vec3 vNormal;
// // Calculate two tangents to the curve at the point where the fragment touches
// vTangentX.x = 1.0f;
// vTangentX.y = 0.0f;
// vTangentX.z = (DifferentialX (vFuncParams.x, vFuncParams.y, fTime) - vPosition.z) / vScale.z;
// vTangentY.x = 0.0f;
// vTangentY.y = 1.0f;
// vTangentY.z = (DifferentialY (vFuncParams.x, vFuncParams.y, fTime) - vPosition.z) / vScale.z;
// // Calculate the normal from the tangents
// vNormal = cross (vTangentX, vTangentY);
// vNormal = normalize (vNormalMatrix * vNormal);
// if (gl_FrontFacing) {
// vNormalBidir = vNormal;
// }
// else {
// vNormalBidir = -vNormal;
// }
// // Calculate the material colour
// vColourRaw = Colour (vFuncParams.x, vFuncParams.y, vFuncParams.z, fTime);
// vColour = vGlobal * vColourRaw;
// // Calculate dot product between normal and light direction
// fNDotL = max (dot (vNormalBidir, normalize (vDir)), 0.0);
// if (fNDotL > 0.0) {
// fAttenuation = 1.0 / (gl_LightSource[0].constantAttenuation + gl_LightSource[0].linearAttenuation * fDist + gl_LightSource[0].quadraticAttenuation * fDist * fDist);
// vColour += fAttenuation * (vDiffuse * fNDotL + vAmbient) * vColourRaw;
// vHalf = normalize (vHalfVector);
// fNDotHV = max (dot (vNormalBidir, vHalf), 0.0);
// vColour += fAttenuation * gl_FrontMaterial.specular * gl_LightSource[0].specular * pow (fNDotHV, gl_FrontMaterial.shininess);
// }
// gl_FragColor = vColour;
// gl_FragColor.a = vColourRaw.a;
gl_FragColor = vec4 (1.0, 1.0, 1.0, 1.0);
}
//float DifferentialX (float x, float y, float t) {
// float z;
//
// z = /*REPLACE:diffX*/0.0f/*END*/;
//
// return z;
//}
//float DifferentialY (float x, float y, float t) {
// float z;
// z = /*REPLACE:diffY*/0.0f/*END*/;
//
// return z;
//}
//vec4 Colour (float x, float y, float z, float t) {
// vec4 c;
// c.r = /*REPLACE:red*/1.0f/*END*/;
// c.g = /*REPLACE:green*/1.0f/*END*/;
// c.b = /*REPLACE:blue*/1.0f/*END*/;
// c.a = /*REPLACE:alpha*/1.0f/*END*/;
//
// return c;
//}
#version 120
uniform vec3 vPosition, vScale;
uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
varying vec3 vFuncParams;
//varying mat3 vNormalMatrix;
/*REPLACE:controlvars*//*END*/
float FunctionZ (float x, float y, float t);
void main() {
vec4 vEyeCoordsPos;
// vec3 vPos;
vec4 vVertex;
// Calculate new vertex position
vVertex = gl_Vertex;
vFuncParams.x = (vVertex.x * vScale.x) + vPosition.x;
vFuncParams.y = (vVertex.y * vScale.y) + vPosition.y;
vFuncParams.z = FunctionZ (vFuncParams.x, vFuncParams.y, fTime);
vVertex.z = (vFuncParams.z - vPosition.z) / vScale.z;
// There appears to be a bug accessing gl_NormalMatrix from the fragment shader
// We therefore pass it across using a varying variable
// vNormalMatrix = gl_NormalMatrix;
// Normalise light direction, which is stored in eye space
vEyeCoordsPos = gl_ModelViewMatrix * vVertex;
// vPos = vec3 (gl_LightSource[0].position - vEyeCoordsPos);
// vDir = normalize (vPos);
// Set the clipping coordinate to be eye coordinate
gl_ClipVertex = vEyeCoordsPos;
// // Calculate distance to light source
// fDist = length (vPos);
// // Normalise half vector; this gets sent to the fragment shader
// vHalfVector = normalize (gl_LightSource[0].halfVector.xyz);
// // Calculate diffuse, ambient and global values
// vDiffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
// vAmbient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
// vGlobal = gl_LightModel.ambient * gl_FrontMaterial.ambient;
// Specify position of vertex
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vVertex;
}
float FunctionZ (float x, float y, float t) {
float z;
z = /*REPLACE:function*/0.0f/*END*/;
return z;
}
#version 120
//uniform vec3 vPosition, vScale;
//uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
//varying vec3 vFuncParams;
//varying mat3 vNormalMatrix;
//uniform sampler2D tTexture;
//uniform sampler2D tBumpMap;
//uniform sampler2DShadow tShadow;
//uniform float fBumpScale;
//uniform float fTextureStrength;
//varying vec4 vShadowPos;
//uniform mat4 mLightTransform;
///*REPLACE:controlvars*//*END*/
//float FunctionR (float a, float p, float t);
//vec3 FunctionD1 (float a, float t);
//vec3 FunctionD2 (float a, float t);
//float DifferentialA (float a, float p, float t);
//float DifferentialP (float a, float p, float t);
//vec4 Colour (float a, float p, float r, float t);
void main () {
// vec3 vHalf;
// float fNDotL;
// float fNDotHV;
// vec4 vColour;
// vec4 vColourRaw;
// vec4 vTexColour;
// float fAttenuation;
// vec3 vNormalBidir;
// vec3 vNormal;
// vec3 vNormalC;
// float fDiffA;
// float fDiffP;
// vec3 vTangent;
// vec3 vSecond;
// vec3 vBinormal;
// vec3 vTangentA;
// vec3 vTangentP;
// float fA;
// float fP;
// float fR;
// float fRDerivA;
// float fRDerivP;
// vec3 vN;
// float fLen;
// float fCos;
// float fSin;
// vec3 vBump;
// vec3 vNormInt;
// vec4 vShadowTexPos;
//
// fA = vFuncParams.x;
// fP = vFuncParams.y;
// fR = vFuncParams.z;
// // Perform lots of calculations to figure out the normal
// fR = FunctionR (fA, fP, fTime);
// vTangent = FunctionD1 (fA, fTime);
// vSecond = FunctionD2 (fA, fTime);
// fLen = length (vTangent);
// vTangent = normalize (vTangent);
// vBinormal = cross (vTangent, vSecond);
//
// if (length (vBinormal) < 0.000001) {
// vBinormal = cross (vTangent, vec3(0.0, 0.0, 1.0));
// }
//
// vBinormal = normalize (vBinormal);
// vNormalC = cross (vTangent, vBinormal);
//
// // Calculate two tangents to the curve at the point where the fragment touches
// fCos = cos (fP);
// fSin = sin (fP);
// fRDerivA = DifferentialA (fA, fP, fTime);
// fRDerivP = DifferentialP (fA, fP, fTime);
// vTangentA.x = (fRDerivA * fCos);
// vTangentA.y = (fRDerivA * fSin);
// vTangentA.z = fLen;
//
// vTangentP.x = (fRDerivP * fCos) - (fR * fSin);
// vTangentP.y = (fRDerivP * fSin) + (fR * fCos);
// vTangentP.z = 0.0;
//
// // Calculate the normal from the tangents
// vBump = normalize (texture2D (tBumpMap, gl_TexCoord[0].st).xyz * 2.0 - 1.0);
// vBump.x *= -fBumpScale;
// // The y (longitudinal) height has far less effect than the x (radial) height, so we have to scale it accordingly
// vBump.y *= -fBumpScale * 100.0;
// vNormInt = cross (vTangentP, vTangentA);
// vN = vTangentP * vBump.y;
// vN += vTangentA * vBump.x;
// vN += vNormInt * vBump.z;
// //vN = cross (vTangentP, vTangentA);
// vN = normalize (vN);
// vNormal.x = (vNormalC.x * vN.x) + (vBinormal.x * vN.y) + (vTangent.x * vN.z);
// vNormal.y = (vNormalC.y * vN.x) + (vBinormal.y * vN.y) + (vTangent.y * vN.z);
// vNormal.z = (vNormalC.z * vN.x) + (vBinormal.z * vN.y) + (vTangent.z * vN.z);
// vNormal = normalize (vNormalMatrix * vNormal);
// if (gl_FrontFacing) {
// vNormalBidir = vNormal;
// }
// else {
// vNormalBidir = -vNormal;
// }
// // Calculate the material colour
// vColourRaw = Colour (vFuncParams.x, vFuncParams.y, vFuncParams.z, fTime);
// vColour = vGlobal * vColourRaw;
// // Calculate dot product between normal and light direction
// fNDotL = max (dot (vNormalBidir, normalize (vDir)), 0.0);
// if (fNDotL > 0.0) {
// fAttenuation = 1.0 / (gl_LightSource[0].constantAttenuation + gl_LightSource[0].linearAttenuation * fDist + gl_LightSource[0].quadraticAttenuation * fDist * fDist);
// vColour += fAttenuation * (vDiffuse * fNDotL + vAmbient) * vColourRaw;
// vHalf = normalize (vHalfVector);
// fNDotHV = max (dot (vNormalBidir, vHalf), 0.0);
// vColour += fAttenuation * gl_FrontMaterial.specular * gl_LightSource[0].specular * pow (fNDotHV, gl_FrontMaterial.shininess);
// }
// vTexColour = 1.0 - ((1.0 - texture2D (tTexture, gl_TexCoord[0].st)) * fTextureStrength);
// gl_FragColor = vTexColour * vColour;
// // Convert the fragment coordinate into a shadow texture coordinate
// vShadowTexPos = ((vShadowPos / vShadowPos.w) + 1.0f) / 2.0f;
// // Add slight bias to avoid shadow acne
// vShadowTexPos.z -= 0.005;
// // Darken the colour in proportion to the shadow level
// gl_FragColor *= vec4 (0.5, 0.5, 0.5, 0.5) + (0.5 * shadow2D (tShadow, vShadowTexPos.xyz));
// gl_FragColor.a = vColourRaw.a;
gl_FragColor = vec4 (1.0, 1.0, 1.0, 1.0);
}
//vec4 Colour (float a, float p, float r, float t) {
// vec4 c;
// c.r = /*REPLACE:red*/1.0f/*END*/;
// c.g = /*REPLACE:green*/1.0f/*END*/;
// c.b = /*REPLACE:blue*/1.0f/*END*/;
// c.a = /*REPLACE:alpha*/1.0f/*END*/;
//
// return c;
//}
//float FunctionR (float a, float p, float t) {
// float r;
// r = /*REPLACE:function*/1.0f/*END*/;
// return r;
//}
//vec3 FunctionD1 (float a, float t) {
// vec3 v;
// v.x = /*REPLACE:diffAX*/1.0f/*END*/;
// v.y = /*REPLACE:diffAY*/1.0f/*END*/;
// v.z = /*REPLACE:diffAZ*/1.0f/*END*/;
// return v;
//}
//vec3 FunctionD2 (float a, float t) {
// vec3 v;
// v.x = /*REPLACE:diff2AX*/1.0f/*END*/;
// v.y = /*REPLACE:diff2AY*/1.0f/*END*/;
// v.z = /*REPLACE:diff2AZ*/1.0f/*END*/;
// return v;
//}
//float DifferentialA (float a, float p, float t) {
// float r;
//
// r = /*REPLACE:diffA*/0.0f/*END*/;
//
// return r;
//}
//float DifferentialP (float a, float p, float t) {
// float r;
// r = /*REPLACE:diffP*/0.0f/*END*/;
//
// return r;
//}
#version 120
uniform vec3 vPosition, vScale;
uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
//varying vec3 vFuncParams;
//varying mat3 vNormalMatrix;
//varying vec4 vShadowPos;
//uniform mat4 mLightTransform;
#define M_PI (3.1415926535897932384626433832795)
/*REPLACE:controlvars*//*END*/
vec3 FunctionC (float a, float t);
float FunctionR (float a, float p, float t);
vec3 FunctionD1 (float a, float t);
vec3 FunctionD2 (float a, float t);
void main() {
vec4 vEyeCoordsPos;
vec3 vPos;
vec4 vVertex;
vec3 vNormalC;
float fA;
float fP;
float fR;
vec3 vTangent;
vec3 vSecond;
vec3 vBinormal;
vec3 vOffset;
// float fLen;
float fSin;
float fCos;
// float fBinormalLength;
// Calculate new vertex position
vVertex = gl_Vertex;
fA = vVertex.x;
fP = vVertex.y;
fR = FunctionR (fA, fP, fTime);
vPos = FunctionC (fA, fTime);
vTangent = FunctionD1 (fA, fTime);
vSecond = FunctionD2 (fA, fTime);
// fLen = length (vTangent);
vTangent = normalize (vTangent);
vBinormal = cross (vTangent, vSecond);
if (length (vBinormal) < 0.000001) {
vBinormal = cross (vTangent, normalize( vec3(0.01, 0.1, 1.0)));
}
vBinormal = normalize (vBinormal);
vNormalC = cross (vTangent, vBinormal);
fCos = cos (fP);
fSin = sin (fP);
vOffset = (vNormalC * fCos) + (vBinormal * fSin);
vVertex.x = ((vPos.x + (fR * vOffset.x)) / vScale.x) - vPosition.x;
vVertex.y = ((vPos.y + (fR * vOffset.y)) / vScale.y) - vPosition.y;
vVertex.z = ((vPos.z + (fR * vOffset.z)) / vScale.z) - vPosition.z;
// vFuncParams.x = fA;
// vFuncParams.y = fP;
// vFuncParams.z = fR;
// // There appears to be a bug accessing gl_NormalMatrix from the fragment shader
// // We therefore pass it across using a varying variable
// vNormalMatrix = gl_NormalMatrix;
// // Normalise light direction, which is stored in eye space
vEyeCoordsPos = gl_ModelViewMatrix * vVertex;
// vPos = vec3 (gl_LightSource[0].position - vEyeCoordsPos);
// vDir = normalize (vPos);
// Set the clipping coordinate to be eye coordinate
gl_ClipVertex = vEyeCoordsPos;
// // Calculate distance to light source
// fDist = length (vPos);
// // Normalise half vector; this gets sent to the fragment shader
// vHalfVector = normalize (gl_LightSource[0].halfVector.xyz);
// // Calculate diffuse, ambient and global values
// vDiffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
// vAmbient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
// vGlobal = gl_LightModel.ambient * gl_FrontMaterial.ambient;
//
// Specify position of vertex
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vVertex;
// // Calculate position in relatiion to light for shadow calculations
// vShadowPos = mLightTransform * vVertex;
// gl_TexCoord[0].s = 1.0f * (0.1f + (fA / 1.2f));
// gl_TexCoord[0].t = 1.0f * (0.1f + (fP / (M_PI)) / 15.0);
}
vec3 FunctionC (float a, float t) {
vec3 c;
c.x = /*REPLACE:curveX*/a/*END*/;
c.y = /*REPLACE:curveY*/1.0f/*END*/;
c.z = /*REPLACE:curveZ*/1.0f/*END*/;
return c;
}
float FunctionR (float a, float p, float t) {
float r;
r = /*REPLACE:function*/1.0f/*END*/;
return r;
}
vec3 FunctionD1 (float a, float t) {
vec3 v;
v.x = /*REPLACE:diffAX*/1.0f/*END*/;
v.y = /*REPLACE:diffAY*/1.0f/*END*/;
v.z = /*REPLACE:diffAZ*/1.0f/*END*/;
return v;
}
vec3 FunctionD2 (float a, float t) {
vec3 v;
v.x = /*REPLACE:diff2AX*/1.0f/*END*/;
v.y = /*REPLACE:diff2AY*/1.0f/*END*/;
v.z = /*REPLACE:diff2AZ*/1.0f/*END*/;
return v;
}
#version 120
uniform vec3 vPosition, vScale;
uniform float fTime;
uniform sampler2D framebufferTexture;
uniform sampler2D framebufferDepth;
// Blur based on focus: 0 = near; 1 = far
// 0 ... fFocusNear ... fFocusFar ... 1
// Blur near from 0 (max) to fFocusNear (none)
const float fFocusNear = 0.99;
// Blur far from fFocusFar (min) to 1 (max)
const float fFocusFar = 0.99;
// The smaller the value the greater the blur
const float fFocusScaleNear = 10.0;
const float fFocusScaleFar = 320.0;
const float fDarkenMax = 0.5;
void main () {
int nXPos;
int nYPos;
vec4 vBlur;
vec2 vTexPos;
vec3 vTexSize;
float fDepth;
float fAmount;
float fDepthScaled;
float fDarken;
fDepth = texture2D (framebufferDepth, gl_TexCoord[0].st).x;
fDepthScaled = 0.0;
fAmount = 0.0;
fDarken = 1.0;
// Blur based on focus: 0 = near; 1 = far
if (fDepth < fFocusNear) {
// Too near to the camera
fDepthScaled += (fFocusNear - fDepth) / fFocusNear;
fAmount += (fDepthScaled) / fFocusScaleNear;
fDarken *= 1.0;
}
if (fDepth > fFocusFar) {
// Too far from the camera
fDepthScaled += ((fDepth - fFocusFar) / (1.0 - fFocusFar));
fAmount += (fDepthScaled) / fFocusScaleFar;
fDarken *= fDarkenMax + ((1.0 - fDarkenMax) * (1.0 - fDepthScaled));
}
vBlur = vec4 (0.0);
for (nXPos = -3; nXPos <= 3; nXPos++) {
for (nYPos = -3; nYPos <= 3; nYPos++) {
vTexPos.s = gl_TexCoord[0].s + (nXPos * fAmount);
vTexPos.t = gl_TexCoord[0].t + (nYPos * fAmount);
vBlur += texture2D (framebufferTexture, vTexPos) / 49.0;
}
}
vBlur.x *= fDarken;
vBlur.y *= fDarken;
vBlur.z *= fDarken;
gl_FragColor = vBlur;
}
#version 120
uniform vec3 vPosition, vScale;
uniform float fTime;
void main() {
// Specify position of vertex
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}
#version 120
//uniform vec3 vPosition, vScale;
//uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
//varying vec3 vFuncParams;
//varying mat3 mNormalMatrix;
//uniform sampler2D tTexture;
//uniform sampler2D tBumpMap;
//uniform sampler2DShadow tShadow;
//uniform float fBumpScale;
//uniform float fTextureStrength;
//varying vec4 vShadowPos;
//uniform mat4 mLightTransform;
///*REPLACE:controlvars*//*END*/
//float DifferentialA (float a, float p, float t);
//float DifferentialP (float a, float p, float t);
//vec4 Colour (float a, float p, float r, float t);
void main () {
// vec3 vHalf;
// float fNDotL;
// float fNDotHV;
// vec4 vColour;
// vec4 vTexColour;
// vec4 vColourRaw;
// float fAttenuation;
// vec3 vNormalBidir;
// vec3 vNormal;
// float fDiffA;
// float fDiffP;
// vec3 vTangentA;
// vec3 vTangentP;
// float fA;
// float fP;
// float fR;
// vec3 vBump;
// vec3 vNormInt;
// vec4 vShadowTexPos;
// fA = vFuncParams.x;
// fP = vFuncParams.y;
// fR = vFuncParams.z;
// // Calculate two tangents to the curve at the point where the fragment touches
// fDiffA = DifferentialA (fA, fP, fTime);
// fDiffP = DifferentialP (fA, fP, fTime);
// vTangentA.x = sin (fP) * ((fDiffA * cos (fA)) - (fR * sin (fA)));
// vTangentA.y = sin (fP) * ((fDiffA * sin (fA)) + (fR * cos (fA)));
// vTangentA.z = fDiffA * cos (fP);
// vTangentP.x = cos (fA) * ((fDiffP * sin (fP)) + (fR * cos (fP)));
// vTangentP.y = sin (fA) * ((fDiffP * sin (fP)) + (fR * cos (fP)));
// vTangentP.z = (fDiffP * cos (fP)) - (fR * sin (fP));
// // Calculate the normal from the tangents
// vBump = normalize (texture2D(tBumpMap, gl_TexCoord[0].st).xyz * 2.0 - 1.0);
// vBump.x *= fBumpScale;
// vBump.y *= fBumpScale;
// vNormInt = cross (vTangentA, vTangentP);
// vNormal = vTangentA * vBump.x;
// vNormal += vTangentP * vBump.y;
// vNormal += vNormInt * vBump.z;
// //vNormal = cross (vTangentA, vTangentP);
// // Since sin(p) is zero when p is zero, we need to fix the normal
// if (fP == 0.0f) {
// vNormal = vec3(0.0f, 0.0f, -1.0f);
// }
// vNormal = normalize (mNormalMatrix * vNormal);
// if (gl_FrontFacing) {
// vNormalBidir = vNormal;
// }
// else {
// vNormalBidir = -vNormal;
// }
// // Calculate the material colour
// vColourRaw = Colour (vFuncParams.x, vFuncParams.y, vFuncParams.z, fTime);
// vColour = vGlobal * vColourRaw;
// // Calculate dot product between normal and light direction
// fNDotL = max (dot (vNormalBidir, normalize (vDir)), 0.0);
// if (fNDotL > 0.0) {
// fAttenuation = 1.0 / (gl_LightSource[0].constantAttenuation + gl_LightSource[0].linearAttenuation * fDist + gl_LightSource[0].quadraticAttenuation * fDist * fDist);
// //float diffuse = clamp ((dot (vNormalBidir, vBump)), 0.0f, 1.0f);
// //vColour += fAttenuation * diffuse * (vAmbient) * vColourRaw;
// vColour += fAttenuation * (vDiffuse * fNDotL + vAmbient) * vColourRaw;
// //vColour += fAttenuation * (diffuse * vDiffuse * fNDotL + vAmbient) * vColourRaw;
// //vColour += diffuse / 2.0f;
// vHalf = normalize (vHalfVector);
// fNDotHV = max (dot (vNormalBidir, vHalf), 0.0);
// vColour += fAttenuation * gl_FrontMaterial.specular * gl_LightSource[0].specular * pow (fNDotHV, gl_FrontMaterial.shininess);
// }
// vTexColour = 1.0 - ((1.0 - texture2D (tTexture, gl_TexCoord[0].st)) * fTextureStrength);
// gl_FragColor = vTexColour * vColour;
// // Convert the fragment coordinate into a shadow texture coordinate
// vShadowTexPos = ((vShadowPos / vShadowPos.w) + 1.0f) / 2.0f;
// // Add slight bias to avoid shadow acne
// vShadowTexPos.z -= 0.005;
// // Darken the colour in proportion to the shadow level
// gl_FragColor *= vec4 (0.5, 0.5, 0.5, 0.5) + (0.5 * shadow2D (tShadow, vShadowTexPos.xyz));
// gl_FragColor.a = vColourRaw.a;
gl_FragColor = vec4 (1.0, 1.0, 1.0, 1.0);
}
//float DifferentialA (float a, float p, float t) {
// float r;
//
// r = /*REPLACE:diffA*/0.0f/*END*/;
//
// return r;
//}
//float DifferentialP (float a, float p, float t) {
// float r;
// r = /*REPLACE:diffP*/0.0f/*END*/;
//
// return r;
//}
//vec4 Colour (float a, float p, float r, float t) {
// vec4 c;
// c.r = /*REPLACE:red*/1.0f/*END*/;
// c.g = /*REPLACE:green*/1.0f/*END*/;
// c.b = /*REPLACE:blue*/1.0f/*END*/;
// c.a = /*REPLACE:alpha*/1.0f/*END*/;
//
// return c;
//}
#version 120
uniform vec3 vPosition, vScale;
uniform float fTime;
//varying vec4 vDiffuse, vGlobal, vAmbient;
//varying vec3 vDir, vHalfVector;
//varying float fDist;
//varying vec3 vFuncParams;
//varying mat3 mNormalMatrix;
//varying vec4 vShadowPos;
//uniform mat4 mLightTransform;
#define M_PI (3.1415926535897932384626433832795)
/*REPLACE:controlvars*//*END*/