diff --git a/lyra-game/src/render/light/mod.rs b/lyra-game/src/render/light/mod.rs index 6eb1db4..bd0af89 100644 --- a/lyra-game/src/render/light/mod.rs +++ b/lyra-game/src/render/light/mod.rs @@ -2,10 +2,9 @@ pub mod point; pub mod directional; pub mod spotlight; -use lyra_ecs::{Entity, Tick, World, query::{Entities, TickOf}}; +use lyra_ecs::{Entity, Tick, World}; pub use point::*; pub use spotlight::*; -use tracing::debug; use std::{collections::{HashMap, VecDeque}, marker::PhantomData, mem, rc::Rc}; diff --git a/lyra-game/src/render/shaders/base.wgsl b/lyra-game/src/render/shaders/base.wgsl index 9e86e04..b597c6f 100755 --- a/lyra-game/src/render/shaders/base.wgsl +++ b/lyra-game/src/render/shaders/base.wgsl @@ -113,28 +113,6 @@ var t_light_grid: texture_storage_2d; // vec2 @fragment fn fs_main(in: VertexOutput) -> @location(0) vec4 { - /*let object_color: vec4 = textureSample(t_diffuse, s_diffuse, in.tex_coords); - let specular_color: vec3 = textureSample(t_specular, s_specular, in.tex_coords).xyz; - - var light_res = vec3(0.0); - - for (var i = 0u; i < u_lights.light_count; i++) { - var light = u_lights.data[i]; - - if (light.light_ty == LIGHT_TY_DIRECTIONAL) { - light_res += blinn_phong_dir_light(in.world_position, in.world_normal, light, u_material, specular_color); - } else if (light.light_ty == LIGHT_TY_POINT) { - light_res += blinn_phong_point_light(in.world_position, in.world_normal, light, u_material, specular_color); - } else if (light.light_ty == LIGHT_TY_SPOT) { - light_res += blinn_phong_spot_light(in.world_position, in.world_normal, light, u_material, specular_color); - } - } - - let light_object_res = light_res * (object_color.xyz/* * u_material.diffuse.xyz*/); - - return vec4(light_object_res, object_color.a);*/ - - if (u_camera.tile_debug == 1u) { return debug_grid(in); } @@ -185,12 +163,6 @@ fn debug_grid(in: VertexOutput) -> vec4 { let ratio = f32(tile.y) / f32(u_lights.light_count); return vec4(ratio, ratio, ratio, 1.0); - - /* if ( ta || tb ) { - return vec4(0.0, 0.0, 0.0, 1.0); - } else { - return vec4(f32(tile_index.x) / 50.0, f32(tile_index.y) / 38.0, 0.0, 1.0); - } */ } fn blinn_phong_dir_light(world_pos: vec3, world_norm: vec3, dir_light: Light, material: Material, specular_factor: vec3) -> vec3 {