diff options
Diffstat (limited to 'data/shaders/phong-frag.glsl')
-rw-r--r-- | data/shaders/phong-frag.glsl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/data/shaders/phong-frag.glsl b/data/shaders/phong-frag.glsl index c1a19c1..2d70fda 100644 --- a/data/shaders/phong-frag.glsl +++ b/data/shaders/phong-frag.glsl @@ -50,6 +50,9 @@ const float GAMMA = 2.2; vec4 texture(sampler2D tex, vec2 coord) { return texture2D(tex, coord); } +vec4 texture(samplerCube tex, vec3 coord) { + return textureCube(tex, coord); +} #endif vec3 gammaCorrect(vec3 color) { @@ -161,7 +164,7 @@ void main() { // Apply image based ambient lighting. float fresnel = pow(1.0 - clamp(dot(viewDir, normal), 0.0, 1.0), 5); float roughness = 1.0 - (material.shininess / 1000.0); - vec3 ambientDiffuse = textureCube(skybox, normal).rgb * diffuseColor; + vec3 ambientDiffuse = texture(skybox, normal).rgb * diffuseColor; vec3 ambientSpecular = textureLod(skybox, reflection, roughness * 7.0).rgb * fresnel; vec3 ambientColor = (ambientDiffuse + ambientSpecular) * ambientOcclusion; color += ambientColor; |