X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=shaderlib%2Fcooktorrance.glsl;h=f441a6d392088fe05f8152dc3430d2de1b701c3a;hb=5a01404e40717c6c2cc389ed8357713e1f216f07;hp=71f8ec76c8df64046cd3a2a70e46742b5f23aa87;hpb=6b9338845dfee441cd18ad6c633e4feef8ad14e1;p=libs%2Fgl.git diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index 71f8ec76..f441a6d3 100644 --- a/shaderlib/cooktorrance.glsl +++ b/shaderlib/cooktorrance.glsl @@ -30,8 +30,6 @@ layout(constant_id=auto) const bool use_emission = false; layout(constant_id=auto) const bool use_emission_map = false; layout(constant_id=auto) const bool use_image_based_lighting = false; -const float PI = 3.1415926535; - #pragma MSP stage(fragment) virtual vec4 get_base_color() { @@ -153,10 +151,14 @@ vec3 cooktorrance_environment(vec3 normal, vec3 look, vec3 base_color, float met vec3 cooktorrance_lighting(vec3 normal, vec3 look, vec3 base_color, float metalness, float roughness) { - vec3 light = normalize(world_light_dir); - - float shadow = get_shadow_factor(0); - vec3 color = cooktorrance_one_light_direct(normal, look, light, light_sources[0].color, base_color, metalness, roughness)*shadow; + vec3 color = vec3(0.0); + for(int i=0; i