Skip to content

Commit

Permalink
rebase to 0.4.0, msaa example shows the same sphere as in 0.2.0
Browse files Browse the repository at this point in the history
missing changes from rebase
  • Loading branch information
IngmarBitter committed Dec 29, 2020
1 parent 8ea8367 commit c75e466
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_pbr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use bevy_math::Vec2;

pub mod render_graph;

mod entity;
Expand Down Expand Up @@ -48,6 +50,7 @@ impl Plugin for PbrPlugin {
albedo: Color::PINK,
shaded: false,
albedo_texture: None,
pbr: Vec2::new(0.01, 0.08),
},
);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bevy_asset::{self, Handle};
use bevy_math::Vec2;
use bevy_reflect::TypeUuid;
use bevy_render::{color::Color, renderer::RenderResources, shader::ShaderDefs, texture::Texture};
use bevy_math::Vec2;

/// A material with "standard" properties used in PBR lighting
#[derive(Debug, RenderResources, ShaderDefs, TypeUuid)]
Expand All @@ -21,7 +21,7 @@ impl Default for StandardMaterial {
fn default() -> Self {
StandardMaterial {
albedo: Color::rgb(1.0, 1.0, 1.0),
pbr: Vec2::new(0.01, 0.08),
pbr: Vec2::new(1.0, 0.95), //(0.01, 0.08),
albedo_texture: None,
shaded: true,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_graph/nodes/camera_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn camera_node_system(
staging_buffer,
0..matrix_size as u64,
&mut |data, _renderer| {
data[0..matrix_size].copy_from_slice(camera_gpu_data.as_bytes());
data[0..matrix_size].copy_from_slice(camera_matrix.as_bytes());
},
);
render_resource_context.unmap_buffer(staging_buffer);
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_render/src/render_graph/nodes/pass_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ impl<Q: WorldQuery> PassNode<Q> {
index: 0,
bind_type: BindType::Uniform {
dynamic: false,
property: UniformProperty::Struct(vec![UniformProperty::Mat4]),
property: UniformProperty::Struct(vec![
UniformProperty::Mat4,
UniformProperty::Vec4,
]),
},
shader_stage: BindingShaderStage::VERTEX | BindingShaderStage::FRAGMENT,
}],
Expand Down
12 changes: 8 additions & 4 deletions examples/3d/msaa.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use bevy::prelude::*;
//use bevy_pbr::{LightBundle, PbrBundle};

/// This example shows how to configure Multi-Sample Anti-Aliasing. Setting the sample count higher will result in smoother edges,
/// but it will also increase the cost to render those edges. The range should generally be somewhere between 1 (no multi sampling,
Expand All @@ -20,14 +21,17 @@ fn setup(
// add entities to the world
commands
// cube
.spawn(PbrComponents {
mesh: meshes.add(Mesh::from(shape::Icosphere { radius: 1.0, subdivisions: 32, })),
.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Icosphere {
radius: 1.0,
subdivisions: 32,
})),
material: materials.add(Color::rgb(0.5, 0.4, 0.3).into()),
..Default::default()
})
// light
.spawn(LightComponents {
translation: Translation::new(40.0, 80.0, 40.0),
.spawn(LightBundle {
transform: Transform::from_translation(Vec3::new(40.0, 80.0, 40.0)),
..Default::default()
})
// camera
Expand Down

0 comments on commit c75e466

Please sign in to comment.