-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: View, globals individual shaders
Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
- Loading branch information
1 parent
d79ecee
commit 9fe40e4
Showing
9 changed files
with
37 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#define_import_path bevy_render::view | ||
|
||
struct View { | ||
view_proj: mat4x4<f32>, | ||
inverse_view_proj: mat4x4<f32>, | ||
view: mat4x4<f32>, | ||
inverse_view: mat4x4<f32>, | ||
projection: mat4x4<f32>, | ||
inverse_projection: mat4x4<f32>, | ||
world_position: vec3<f32>, | ||
// viewport(x_origin, y_origin, width, height) | ||
viewport: vec4<f32>, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
#define_import_path bevy_sprite::mesh2d_view_types | ||
|
||
struct View { | ||
view_proj: mat4x4<f32>, | ||
inverse_view_proj: mat4x4<f32>, | ||
view: mat4x4<f32>, | ||
inverse_view: mat4x4<f32>, | ||
projection: mat4x4<f32>, | ||
inverse_projection: mat4x4<f32>, | ||
world_position: vec3<f32>, | ||
// viewport(x_origin, y_origin, width, height) | ||
viewport: vec4<f32>, | ||
}; | ||
|
||
struct Globals { | ||
// The time since startup in seconds | ||
// Wraps to 0 after 1 hour. | ||
time: f32, | ||
// The delta time since the previous frame in seconds | ||
delta_time: f32, | ||
// Frame count since the start of the app. | ||
// It wraps to zero when it reaches the maximum value of a u32. | ||
frame_count: u32, | ||
#ifdef SIXTEEN_BYTE_ALIGNMENT | ||
// WebGL2 structs must be 16 byte aligned. | ||
_wasm_padding: f32 | ||
#endif | ||
} | ||
#import bevy_render::view | ||
#import bevy_render::globals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters