Fully implemented lighting
Two types of light sources are currently supported: directional lights and point lights. A scene can have only one directional light and up to 1024 point lights.
This commit is contained in:
parent
214317e0bf
commit
503ed33aec
7 changed files with 181 additions and 48 deletions
14
src/rendering/lights.zig
Normal file
14
src/rendering/lights.zig
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
pub const DirectionalLight = extern struct {
|
||||
direction: [3]f32 align(16),
|
||||
ambient: [3]f32 align(16),
|
||||
diffuse: [3]f32 align(16),
|
||||
specular: [3]f32 align(16),
|
||||
};
|
||||
|
||||
pub const PointLight = extern struct {
|
||||
position: [3]f32 align(16),
|
||||
ambient: [3]f32 align(16),
|
||||
diffuse: [3]f32 align(16),
|
||||
specular: [3]f32 align(16),
|
||||
data: [3]f32 align(16),
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue