" int g_light_preview;\n"
" int g_shadow_samples;\n"
"\n"
+" int g_debug_indices;\n"
+" int g_debug_complexity;\n"
+"\n"
" // g_time ?\n"
"\n"
" //vec4 g_point_light_positions[32];\n"
" vec4 light_dir_1 = texelFetch( uLightsArray, light_indices.y*3+2 );\n"
" vec4 light_dir_2 = texelFetch( uLightsArray, light_indices.z*3+2 );\n"
"\n"
-" //return vec3(fract(distance(light_co_0.xyz,aWorldCo)),\n"
-" // fract(distance(light_co_1.xyz,aWorldCo)),\n"
-" // fract(distance(light_co_2.xyz,aWorldCo)));\n"
-"\n"
-" // return vec3(fract(light_indices.x * 0.125), fract(light_indices.y*0.125),\n"
-" // fract(light_indices.z * 0.125 ));\n"
-"\n"
-" total_light += newlight_compute_spot\n"
-" ( \n"
-" wnormal, halfview,\n"
-" light_colour_0.rgb,\n"
-" light_co_0.xyz,\n"
-" light_dir_0\n"
-" ) * board_shadow;\n"
-"\n"
-" total_light += newlight_compute_spot\n"
-" ( \n"
-" wnormal, halfview,\n"
-" light_colour_1.rgb,\n"
-" light_co_1.xyz,\n"
-" light_dir_1\n"
-" ) * board_shadow;\n"
-" total_light += newlight_compute_spot\n"
-" ( \n"
-" wnormal, halfview,\n"
-" light_colour_2.rgb,\n"
-" light_co_2.xyz,\n"
-" light_dir_2\n"
-" ) * board_shadow;\n"
+" if( g_debug_indices == 1 )\n"
+" {\n"
+" float rings = min( fract(distance(light_co_0.xyz,aWorldCo)),\n"
+" min( fract(distance(light_co_1.xyz,aWorldCo)),\n"
+" fract(distance(light_co_2.xyz,aWorldCo)) ) \n"
+" );\n"
+" \n"
+" return vec3(fract(light_indices.x * 0.125), fract(light_indices.y*0.125),\n"
+" fract(light_indices.z * 0.125 )) + (rings-0.5) * 0.25;\n"
+" }\n"
+"\n"
+" if( g_debug_complexity == 1 )\n"
+" {\n"
+" return vec3(1.0,0.0,0.0) * ( light_indices.w/3.0 );\n"
+" }\n"
+"\n"
+" if( light_indices.w >= 1 )\n"
+" {\n"
+" total_light += newlight_compute_spot\n"
+" ( \n"
+" wnormal, halfview,\n"
+" light_colour_0.rgb,\n"
+" light_co_0.xyz,\n"
+" light_dir_0\n"
+" ) * board_shadow \n"
+" * step( world.day_phase, light_colour_0.w );\n"
+"\n"
+" if( light_indices.w >= 2 )\n"
+" {\n"
+" total_light += newlight_compute_spot\n"
+" ( \n"
+" wnormal, halfview,\n"
+" light_colour_1.rgb,\n"
+" light_co_1.xyz,\n"
+" light_dir_1\n"
+" ) * board_shadow\n"
+" * step( world.day_phase, light_colour_1.w );\n"
+"\n"
+" if( light_indices.w >= 3 )\n"
+" {\n"
+" total_light += newlight_compute_spot\n"
+" ( \n"
+" wnormal, halfview,\n"
+" light_colour_2.rgb,\n"
+" light_co_2.xyz,\n"
+" light_dir_2\n"
+" ) * board_shadow\n"
+" * step( world.day_phase, light_colour_2.w );\n"
+" }\n"
+" }\n"
+" }\n"
"\n"
" vec3 fog_colour = scene_sky( -halfview, world );\n"
" \n"