… | |
… | |
338 | |
338 | |
339 | void light::disable (view &ctx) |
339 | void light::disable (view &ctx) |
340 | { |
340 | { |
341 | } |
341 | } |
342 | |
342 | |
|
|
343 | void linear_light::enable (view &ctx) |
|
|
344 | { |
|
|
345 | light::enable (ctx); |
|
|
346 | } |
|
|
347 | |
|
|
348 | void linear_light::disable (view &ctx) |
|
|
349 | { |
|
|
350 | light::disable (ctx); |
|
|
351 | } |
|
|
352 | |
343 | void linear_light::vsh () |
353 | void linear_light::vsh () |
344 | { |
354 | { |
345 | using namespace shader::compile; |
355 | using namespace shader::compile; |
346 | temp_1f camdist; |
356 | temp_1f camdist; |
347 | |
357 | |
… | |
… | |
354 | void linear_light::fsh () |
364 | void linear_light::fsh () |
355 | { |
365 | { |
356 | using namespace shader::compile; |
366 | using namespace shader::compile; |
357 | |
367 | |
358 | sh_lightvec = lightvec; |
368 | sh_lightvec = lightvec; |
359 | sh_colour = float3 (c.r / 255.F, c.g / 255.F, c.b / 255.F) * (min (intensity * camdist * 100.F + 0.9F, 1.F)); |
369 | sh_colour = float3 (c.r / 255.F, c.g / 255.F, c.b / 255.F) * (min (camdist * (intensity * 100.F) + 0.9F, 1.F)); |
360 | } |
370 | } |
361 | |
371 | |
362 | |
372 | |