shader refactoring and float pos for lights
This commit is contained in:
parent
86135cb2ce
commit
9b618b0e3f
3 changed files with 92 additions and 70 deletions
src/scene
|
@ -15,9 +15,9 @@ impl PointLight {
|
|||
}
|
||||
|
||||
pub fn insert_into_memory(&self, mut v: Vec<u32>) -> Vec<u32> {
|
||||
v[self.memory_start] = self.pos.x as u32;
|
||||
v[self.memory_start + 1] = self.pos.y as u32;
|
||||
v[self.memory_start + 2] = self.pos.z as u32;
|
||||
v[self.memory_start] = u32::from_ne_bytes(self.pos.x.to_ne_bytes());
|
||||
v[self.memory_start + 1] = u32::from_ne_bytes(self.pos.y.to_ne_bytes());
|
||||
v[self.memory_start + 2] = u32::from_ne_bytes(self.pos.z.to_ne_bytes());
|
||||
|
||||
v[self.memory_start + 3] = (self.color.x * 255.0) as u32;
|
||||
v[self.memory_start + 4] = (self.color.y * 255.0) as u32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue