X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=shaderlib%2Fcommon.glsl;h=249cae7c67e9c65c64d6dd4ab8a9829dd0ed8ef8;hp=695bce3b5da4ca0d8b06c5785a8bcea6f2c1da3a;hb=e196a09d1df1e8504ff037d1701b7159c4f04e84;hpb=7c797f8445ab02381e358472755e94e5c5125252 diff --git a/shaderlib/common.glsl b/shaderlib/common.glsl index 695bce3b..249cae7c 100644 --- a/shaderlib/common.glsl +++ b/shaderlib/common.glsl @@ -75,12 +75,6 @@ void main() } #pragma MSP stage(fragment) -struct IncomingLight -{ - vec3 direction; - vec3 color; -}; - layout(location=0) out vec4 frag_color; virtual vec3 get_fragment_normal() @@ -93,15 +87,6 @@ virtual vec3 get_fragment_normal() return sgn*normalize(world_normal); } -virtual IncomingLight get_incoming_light(int index, vec3 world_pos) -{ - vec4 light_pos = light_sources[index].position; - vec3 rel_pos = light_pos.xyz-world_pos*light_pos.w; - float d = length(rel_pos); - float attenuation = 1.0/dot(vec3(1.0, d, d*d), light_sources[index].attenuation); - return IncomingLight(rel_pos/d, light_sources[index].color*attenuation); -} - float apply_alpha_cutoff(float alpha, AlphaCutoffParams params) { if(use_alpha_cutoff)