-
-
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.
Merge pull request #3175 from cart/merge-renderer
Merge New Renderer
- Loading branch information
Showing
194 changed files
with
24,520 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[block]] | ||
struct CustomMaterial { | ||
color: vec4<f32>; | ||
}; | ||
[[group(1), binding(0)]] | ||
var<uniform> material: CustomMaterial; | ||
|
||
[[stage(fragment)]] | ||
fn fragment() -> [[location(0)]] vec4<f32> { | ||
return material.color; | ||
} |
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,33 @@ | ||
#import bevy_pbr::mesh_view_bind_group | ||
#import bevy_pbr::mesh_struct | ||
|
||
[[group(1), binding(0)]] | ||
var<uniform> mesh: Mesh; | ||
|
||
struct Vertex { | ||
[[location(0)]] position: vec3<f32>; | ||
[[location(1)]] normal: vec3<f32>; | ||
[[location(2)]] uv: vec2<f32>; | ||
}; | ||
|
||
struct VertexOutput { | ||
[[builtin(position)]] clip_position: vec4<f32>; | ||
}; | ||
|
||
[[stage(vertex)]] | ||
fn vertex(vertex: Vertex) -> VertexOutput { | ||
let world_position = mesh.model * vec4<f32>(vertex.position, 1.0); | ||
|
||
var out: VertexOutput; | ||
out.clip_position = view.view_proj * world_position; | ||
return out; | ||
} | ||
|
||
[[stage(fragment)]] | ||
fn fragment() -> [[location(0)]] vec4<f32> { | ||
var color = vec4<f32>(0.0, 0.0, 1.0, 1.0); | ||
# ifdef IS_RED | ||
color = vec4<f32>(1.0, 0.0, 0.0, 1.0); | ||
# endif | ||
return color; | ||
} |
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
Oops, something went wrong.