I am trying to implement shadow maps in opengl core 3.3. When I send a bias to the texture function in GLSL it doesn't seem to do anything at all. Am I using it wrong?
#version 330
uniform sampler2D diffusetex;
uniform sampler2D normaltex;
uniform sampler2D postex;
uniform sampler2D depthtex;
uniform sampler2DShadow shadowmap;
uniform mat4 shadowmat;
in vec2 uv;
layout (location=0) out vec4 outColor;
void main(){
vec3 normal = normalize(texture(normaltex, uv).xyz);
vec3 world_position = texture(postex, uv).xyz;
vec4 shadowcoord = shadowmat*vec4(world_position, 1);
float shadow = texture(shadowmap, shadowcoord.xyz,0.5);
float luma = max(0.1,shadow);//ambient light
outColor = texture(diffusetex, uv)*luma;
}
I am using linux, the nvidia proprietary drivers and golang. Doubt it has anything to do with it but just in case, there it is.