Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualstefthedrummer

Posted 19 June 2013 - 03:54 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

</span>

#version 330 core
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
    vec3 sunPosition;
    vec3 sunDirection;
    vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
    mat4 camViewProj;
    mat4 sunViewProj;
    mat4 sunViewCoordProj;
};
 
void main()
{
    vec3 diffuse   = texture2D(diffuseTexture, passCoord).rgb;
    vec3 normal    = texture2D(normalTexture, passCoord).rgb;
    vec3 worldPos  = texture2D(worldTexture, passCoord).rgb;
 
    float intensity         = diffuse.x + diffuse.y + diffuse.z;
 
    vec4 sunSpacePos        = sunViewCoordProj * vec4(worldPos, 1.0f);
    vec2 shadowMapCoord     = vec2(sunSpacePos);
    float curSunSpaceDepth  = texture2D(shadowMap, shadowMapCoord).x;
    float sunSpaceDepth     = sunSpacePos.z - 0.0001f;
    float shadowFactor      = (curSunSpaceDepth < sunSpaceDepth) ? 1.0f : 1.0f;
 
    outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}

<span  style="color:rgb(40,40,40);font-family:arial, helvetica;font-size:14.399999618530273px">

#5stefthedrummer

Posted 19 June 2013 - 03:54 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

</span>

#version 330 core
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
    vec3 sunPosition;
    vec3 sunDirection;
    vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
    mat4 camViewProj;
    mat4 sunViewProj;
    mat4 sunViewCoordProj;
};
 
void main()
{
    vec3 diffuse       = texture2D(diffuseTexture, passCoord).rgb;
    vec3 normal       = texture2D(normalTexture, passCoord).rgb;
    vec3 worldPos   = texture2D(worldTexture, passCoord).rgb;
 
    float intensity     = diffuse.x + diffuse.y + diffuse.z;
 
    vec4 sunSpacePos            = sunViewCoordProj * vec4(worldPos, 1.0f);
    vec2 shadowMapCoord      = vec2(sunSpacePos);
    float curSunSpaceDepth    = texture2D(shadowMap, shadowMapCoord).x;
    float sunSpaceDepth         = sunSpacePos.z - 0.0001f;
    float shadowFactor            = (curSunSpaceDepth < sunSpaceDepth) ? 1.0f : 1.0f;
 
    outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}

<span  style="color:rgb(40,40,40);font-family:arial, helvetica;font-size:14.399999618530273px">

#4stefthedrummer

Posted 19 June 2013 - 03:53 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

</span>

#version 330 core
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
    vec3 sunPosition;
    vec3 sunDirection;
    vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
    mat4 camViewProj;
    mat4 sunViewProj;
    mat4 sunViewCoordProj;
};
 
void main()
{
    vec3 diffuse    = texture2D(diffuseTexture, passCoord).rgb;
    vec3 normal        = texture2D(normalTexture, passCoord).rgb;
    vec3 worldPos    = texture2D(worldTexture, passCoord).rgb;
 
    float intensity            = diffuse.x + diffuse.y + diffuse.z;
 
    vec4 sunSpacePos        = sunViewCoordProj * vec4(worldPos, 1.0f);
    vec2 shadowMapCoord        = vec2(sunSpacePos);
    float curSunSpaceDepth    = texture2D(shadowMap, shadowMapCoord).x;
    float sunSpaceDepth        = sunSpacePos.z - 0.0001f;
    float shadowFactor        = (curSunSpaceDepth < sunSpaceDepth) ? 1.0f : 1.0f;
 
    outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}

<span  style="color:rgb(40,40,40);font-family:arial, helvetica;font-size:14.399999618530273px">

#3stefthedrummer

Posted 19 June 2013 - 03:52 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

</span>
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
vec3 sunPosition;
vec3 sunDirection;
vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
mat4 camViewProj;
mat4 sunViewProj;
mat4 sunViewCoordProj;
};
 
void main()
{
vec3 diffuse<span> </span>= texture2D(diffuseTexture, passCoord).rgb;
vec3 normal<span> </span>= texture2D(normalTexture, passCoord).rgb;
vec3 worldPos<span> </span>= texture2D(worldTexture, passCoord).rgb;
 
float intensity<span> </span>= diffuse.x + diffuse.y + diffuse.z;
 
vec4 sunSpacePos<span> </span>= sunViewCoordProj * vec4(worldPos, 1.0f);
vec2 shadowMapCoord<span> </span>= vec2(sunSpacePos);
float curSunSpaceDepth<span> </span>= texture2D(shadowMap, shadowMapCoord).x;
float sunSpaceDepth<span> </span>= sunSpacePos.z - 0.0001f;
float shadowFactor<span> </span>= (curSunSpaceDepth < sunSpaceDepth) ? 0.2f : 1.0f;
 
outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}
<span  style="color:rgb(40,40,40);font-family:arial, helvetica;font-size:14.399999618530273px">

#2stefthedrummer

Posted 19 June 2013 - 03:51 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

[Deferred-Render-Pass - calculate final color and shading]

</span>
#version 330 core
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
vec3 sunPosition;
vec3 sunDirection;
vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
mat4 camViewProj;
mat4 sunViewProj;
mat4 sunViewCoordProj;
};
 
void main()
{
vec3 diffuse<span> </span>= texture2D(diffuseTexture, passCoord).rgb;
vec3 normal<span> </span>= texture2D(normalTexture, passCoord).rgb;
vec3 worldPos<span> </span>= texture2D(worldTexture, passCoord).rgb;
 
float intensity<span> </span>= diffuse.x + diffuse.y + diffuse.z;
 
vec4 sunSpacePos<span> </span>= sunViewCoordProj * vec4(worldPos, 1.0f);
vec2 shadowMapCoord<span> </span>= vec2(sunSpacePos);
float curSunSpaceDepth<span> </span>= texture2D(shadowMap, shadowMapCoord).x;
float sunSpaceDepth<span> </span>= sunSpacePos.z - 0.0001f;
float shadowFactor<span> </span>= (curSunSpaceDepth < sunSpaceDepth) ? 0.2f : 1.0f;
 
outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}
<span  style="color:rgb(40,40,40);font-family:arial, helvetica;font-size:14.399999618530273px">

#1stefthedrummer

Posted 19 June 2013 - 03:40 PM

Hey everyone,

 

since I updated my Catalyst Driver for my 6950, my code sopped working.

The following code works fine on several machines with both NVidia and AMD Graphics, but not on my main machine.

My compiler returns uniform location -1 for "worldTexture" and "shadowMap" even though these variables are used to calculate the result!

Is it a bug, or did I miss something?

 

 

 

[Deferred-Render-Pass - calculate final color and shading]

 

#version 330 core
 
in  vec2 passCoord;
 
out vec3 outDiffuse;
 
uniform sampler2D diffuseTexture;
uniform sampler2D worldTexture;
uniform sampler2D normalTexture;
uniform sampler2D shadowMap;
 
layout(std140) uniform Sun {
vec3 sunPosition;
vec3 sunDirection;
vec3 sunDiffuse;
};
 
layout(std140) uniform Camera {
mat4 camViewProj;
mat4 sunViewProj;
mat4 sunViewCoordProj;
};
 
void main()
{
vec3 diffuse = texture2D(diffuseTexture, passCoord).rgb;
vec3 normal = texture2D(normalTexture, passCoord).rgb;
vec3 worldPos = texture2D(worldTexture, passCoord).rgb;
 
float intensity = diffuse.x + diffuse.y + diffuse.z;
 
vec4 sunSpacePos = sunViewCoordProj * vec4(worldPos, 1.0f);
vec2 shadowMapCoord = vec2(sunSpacePos);
float curSunSpaceDepth = texture2D(shadowMap, shadowMapCoord).x;
float sunSpaceDepth = sunSpacePos.z - 0.0001f;
float shadowFactor = (curSunSpaceDepth < sunSpaceDepth) ? 0.2f : 1.0f;
 
outDiffuse = (diffuse * shadowFactor + intensity * sunDiffuse) * max(dot(normal, sunDirection), 0.0f);
}

PARTNERS