Fix some errors caused by rebasing with origin

This commit is contained in:
SeanOMik 2023-12-21 17:40:16 -05:00
parent 66ec18eade
commit ad35015478
Signed by: SeanOMik
GPG Key ID: 568F326C7EB33ACB
2 changed files with 0 additions and 20 deletions

View File

@ -1,6 +1,5 @@
use std::sync::Arc;
use super::texture::RenderTexture;
use super::texture::RenderTexture;
pub struct MaterialSpecular {

View File

@ -1,6 +1,5 @@
// Vertex shader
const max_light_count: u32 = 16u;
const max_light_count: u32 = 16u;
struct VertexInput {
@ -25,7 +24,6 @@ struct PointLight {
position: vec4<f32>,
color: vec4<f32>,
intensity: f32,
constant: f32,
linear: f32,
@ -34,10 +32,6 @@ struct PointLight {
ambient: f32,
diffuse: f32,
specular: f32,
ambient: f32,
diffuse: f32,
specular: f32,
};
struct DirectionalLight {
@ -113,17 +107,9 @@ struct Material {
shininess: f32,
}
struct Material {
ambient: vec4<f32>,
diffuse: vec4<f32>,
specular: vec4<f32>,
shininess: f32,
}
@group(0) @binding(0)
var t_diffuse: texture_2d<f32>;
@group(0) @binding(1)
@group(0) @binding(1)
var s_diffuse: sampler;
@group(4) @binding(0)
@ -199,14 +185,12 @@ fn blinn_phong_point_light(world_pos: vec3<f32>, world_norm: vec3<f32>, point_li
let diffuse_strength = max(dot(world_norm, light_dir), 0.0);
var diffuse_color = light_color * (diffuse_strength * material.diffuse.xyz);
var diffuse_color = light_color * (diffuse_strength * material.diffuse.xyz);
//// end of diffuse ////
//// specular ////
let view_dir = normalize(camera_view_pos - world_pos);
let half_dir = normalize(view_dir + light_dir);
let specular_strength = pow(max(dot(world_norm, half_dir), 0.0), material.shininess);
var specular_color = specular_strength * (light_color * specular_factor);
//// end of specular ////
@ -216,9 +200,6 @@ fn blinn_phong_point_light(world_pos: vec3<f32>, world_norm: vec3<f32>, point_li
let attenuation = 1.0 / (point_light.constant + point_light.linear * distance +
point_light.quadratic * (distance * distance));
//ambient_color *= attenuation * point_light.intensity * point_light.ambient;
//diffuse_color *= attenuation * point_light.intensity * point_light.diffuse;
//specular_color *= attenuation * point_light.intensity * point_light.specular;
//// end of point light attenuation ////
ambient_color *= point_light.ambient * attenuation;