fixing the shader not compiling

This commit is contained in:
samcake 2015-05-01 00:14:23 -07:00
parent 6da796f735
commit e560687371
11 changed files with 46 additions and 46 deletions

View file

@ -19,7 +19,7 @@
uniform sampler2D diffuseMap;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -31,7 +31,7 @@ void main(void) {
Material mat = getMaterial();
packDeferredFragment(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
getMaterialDiffuse(mat) * diffuse.rgb * color,
getMaterialSpecular(mat),

View file

@ -20,7 +20,7 @@ const int MAX_TEXCOORDS = 2;
uniform mat4 texcoordMatrices[MAX_TEXCOORDS];
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -36,7 +36,7 @@ void main(void) {
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, gl_Vertex, gl_Position)$>
<$transformModelToEyeDir(cam, obj, gl_Normal, normal.xyz)$>
<$transformModelToEyeDir(cam, obj, gl_Normal, interpolatedNormal.xyz)$>
normal = vec4(normalize(normal.xyz), 0.0);
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
}

View file

@ -24,7 +24,7 @@ uniform sampler2D emissiveMap;
uniform vec2 emissiveParams;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -39,7 +39,7 @@ void main(void) {
Material mat = getMaterial();
packDeferredFragmentLightmap(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
getMaterialDiffuse(mat) * diffuse.rgb * color,
getMaterialSpecular(mat),

View file

@ -23,7 +23,7 @@ uniform mat4 texcoordMatrices[MAX_TEXCOORDS];
attribute vec2 texcoord1;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
// the interpolated texcoord1
varying vec2 interpolatedTexcoord1;
@ -44,8 +44,8 @@ void main(void) {
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, gl_Vertex, gl_Position)$>
<$transformModelToEyeDir(cam, obj, gl_Normal, normal.xyz)$>
<$transformModelToEyeDir(cam, obj, gl_Normal, interpolatedNormal.xyz)$>
normal = vec4(normalize(normal.xyz), 0.0);
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
}

View file

@ -27,7 +27,7 @@ uniform vec2 emissiveParams;
uniform sampler2D specularMap;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec2 interpolatedTexcoord1;
@ -42,7 +42,7 @@ void main(void) {
Material mat = getMaterial();
packDeferredFragmentLightmap(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
getMaterialDiffuse(mat) * diffuse.rgb * color,
specular, // no use of getMaterialSpecular(mat)

View file

@ -23,7 +23,7 @@ uniform sampler2D diffuseMap;
uniform sampler2D specularMap;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -35,7 +35,7 @@ void main(void) {
Material mat = getMaterial();
packDeferredFragment(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
getMaterialDiffuse(mat) * diffuse.rgb * color,
specular, //getMaterialSpecular(mat),

View file

@ -19,7 +19,7 @@
// the diffuse texture
uniform sampler2D diffuseMap;
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -31,7 +31,7 @@ void main(void) {
Material mat = getMaterial();
packDeferredFragmentTranslucent(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
getMaterialOpacity(mat) * diffuse.a,
getMaterialDiffuse(mat) * diffuse.rgb * color,
getMaterialSpecular(mat),

View file

@ -15,7 +15,7 @@
<@include DeferredBufferWrite.slh@>
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
// the glow intensity
//uniform float glowIntensity;
@ -28,7 +28,7 @@ void main(void) {
*/
packDeferredFragment(
normalize(normal.xyz),
normalize(interpolatedNormal.xyz),
glowIntensity,
gl_Color.rgb,
gl_FrontMaterial.specular.rgb,

View file

@ -13,11 +13,11 @@
//
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
void main(void) {
// transform and store the normal for interpolation
normal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0));
interpolatedNormal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0));
// pass along the diffuse color
gl_FrontColor = gl_Color;

View file

@ -1,5 +1,5 @@
<@include gpu/Config.slh@>
<$VERSION_HEADER$>
<@include gpu/Config.slh@>
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// skin_model.vert
@ -12,8 +12,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
<@include gpu/Transform.slh@>
<$declareStandardTransform()$>
<@include gpu/Transform.slh@>
<$declareStandardTransform()$>
const int MAX_TEXCOORDS = 2;
const int MAX_CLUSTERS = 128;
@ -26,7 +26,7 @@ attribute vec4 clusterIndices;
attribute vec4 clusterWeights;
// the interpolated normal
varying vec4 normal;
varying vec4 interpolatedNormal;
varying vec3 color;
@ -37,7 +37,7 @@ void main(void) {
mat4 clusterMatrix = clusterMatrices[int(clusterIndices[i])];
float clusterWeight = clusterWeights[i];
position += clusterMatrix * gl_Vertex * clusterWeight;
normal += clusterMatrix * vec4(gl_Normal, 0.0) * clusterWeight;
interpolatedNormal += clusterMatrix * vec4(gl_Normal, 0.0) * clusterWeight;
}
// pass along the diffuse color
@ -46,11 +46,11 @@ void main(void) {
// and the texture coordinates
gl_TexCoord[0] = texcoordMatrices[0] * vec4(gl_MultiTexCoord0.xy, 0.0, 1.0);
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
<$transformModelToEyeDir(cam, obj, normal.xyz, normal.xyz)$>
normal = vec4(normalize(normal.xyz), 0.0);
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, position, gl_Position)$>
<$transformModelToEyeDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
}

View file

@ -1,5 +1,5 @@
<@include gpu/Config.slh@>
<$VERSION_HEADER$>
<@include gpu/Config.slh@>
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// skin_model_normal_map.vert
@ -12,8 +12,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
<@include gpu/Transform.slh@>
<$declareStandardTransform()$>
<@include gpu/Transform.slh@>
<$declareStandardTransform()$>
const int MAX_TEXCOORDS = 2;
const int MAX_CLUSTERS = 128;
@ -54,16 +54,16 @@ void main(void) {
// and the texture coordinates
gl_TexCoord[0] = texcoordMatrices[0] * vec4(gl_MultiTexCoord0.xy, 0.0, 1.0);
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, interpolatedPosition, gl_Position)$>
<$transformModelToEyeDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
<$transformModelToEyeDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
// standard transform
TransformCamera cam = getTransformCamera();
TransformObject obj = getTransformObject();
<$transformModelToClipPos(cam, obj, interpolatedPosition, gl_Position)$>
<$transformModelToEyeDir(cam, obj, interpolatedNormal.xyz, interpolatedNormal.xyz)$>
<$transformModelToEyeDir(cam, obj, interpolatedTangent.xyz, interpolatedTangent.xyz)$>
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0);
}