add color changing

This commit is contained in:
zack 2024-12-29 12:00:32 -05:00
parent 94432b0c0d
commit 210d5078c6
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
7 changed files with 129 additions and 54 deletions

View file

@ -32,8 +32,13 @@ pub fn main_vs(
}
#[spirv(fragment)]
pub fn main_fs(frag_world_position: Vec3, frag_world_normal: Vec3, out_color: &mut Vec4) {
let base_color = Vec3::new(1.0, 0.5, 0.5);
pub fn main_fs(
frag_world_position: Vec3,
frag_world_normal: Vec3,
out_color: &mut Vec4,
#[spirv(uniform, descriptor_set = 0, binding = 0)] ubo: &UniformBufferObject,
) {
let base_color = ubo.model_color;
let light_pos = Vec3::new(2.0, 2.0, -2.0);
// Calculate light direction