fix warnings, remove some commented code from base shader
ci/woodpecker/push/debug Pipeline failed Details

This commit is contained in:
SeanOMik 2024-06-16 00:11:21 -04:00
parent 6182a4b9c8
commit 0edba69b02
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
2 changed files with 1 additions and 30 deletions

View File

@ -2,10 +2,9 @@ pub mod point;
pub mod directional; pub mod directional;
pub mod spotlight; pub mod spotlight;
use lyra_ecs::{Entity, Tick, World, query::{Entities, TickOf}}; use lyra_ecs::{Entity, Tick, World};
pub use point::*; pub use point::*;
pub use spotlight::*; pub use spotlight::*;
use tracing::debug;
use std::{collections::{HashMap, VecDeque}, marker::PhantomData, mem, rc::Rc}; use std::{collections::{HashMap, VecDeque}, marker::PhantomData, mem, rc::Rc};

View File

@ -113,28 +113,6 @@ var t_light_grid: texture_storage_2d<rg32uint, read_write>; // vec2<u32>
@fragment @fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> { fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
/*let object_color: vec4<f32> = textureSample(t_diffuse, s_diffuse, in.tex_coords);
let specular_color: vec3<f32> = textureSample(t_specular, s_specular, in.tex_coords).xyz;
var light_res = vec3<f32>(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<f32>(light_object_res, object_color.a);*/
if (u_camera.tile_debug == 1u) { if (u_camera.tile_debug == 1u) {
return debug_grid(in); return debug_grid(in);
} }
@ -185,12 +163,6 @@ fn debug_grid(in: VertexOutput) -> vec4<f32> {
let ratio = f32(tile.y) / f32(u_lights.light_count); let ratio = f32(tile.y) / f32(u_lights.light_count);
return vec4<f32>(ratio, ratio, ratio, 1.0); return vec4<f32>(ratio, ratio, ratio, 1.0);
/* if ( ta || tb ) {
return vec4<f32>(0.0, 0.0, 0.0, 1.0);
} else {
return vec4<f32>(f32(tile_index.x) / 50.0, f32(tile_index.y) / 38.0, 0.0, 1.0);
} */
} }
fn blinn_phong_dir_light(world_pos: vec3<f32>, world_norm: vec3<f32>, dir_light: Light, material: Material, specular_factor: vec3<f32>) -> vec3<f32> { fn blinn_phong_dir_light(world_pos: vec3<f32>, world_norm: vec3<f32>, dir_light: Light, material: Material, specular_factor: vec3<f32>) -> vec3<f32> {