X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=shaderlib%2Fcooktorrance.glsl;h=7eefbf60eb52e96a9ab320e6c9c42e1ccc4d1e40;hb=9813f8711628a0fbe786406e974dc33546dc9cee;hp=71f8ec76c8df64046cd3a2a70e46742b5f23aa87;hpb=6b9338845dfee441cd18ad6c633e4feef8ad14e1;p=libs%2Fgl.git diff --git a/shaderlib/cooktorrance.glsl b/shaderlib/cooktorrance.glsl index 71f8ec76..7eefbf60 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