use rusting_engine::{
CollisionType, ComputeShaderType, Engine, Material, Physics, ShaderType, Transform,
};
pub fn main() {
let mut engine = Engine::new("RustingEngine - Shaders Demo");
engine.set_light([30.0, 30.0, 30.0], [1.0, 0.95, 0.9], 450.0);
let unlit_mat = Material::standard()
.color([0.2, 0.8, 0.2])
.shader(ShaderType::Unlit)
.build();
let emissive_mat = Material::standard()
.color([1.0, 1.0, 0.0])
.shader(ShaderType::Emissive)
.build();
let pbr_mat = Material::standard()
.color([0.8, 0.2, 0.2])
.shader(ShaderType::Pbr)
.build();
engine.add_cube(
Transform::default(),
&unlit_mat,
&Physics::default()
.compute_shader(ComputeShaderType::Static)
.mass(0.0), );
engine.add_sphere(
Transform {
position: [0.0, 15.0, 0.0],
scale: [2.0, 2.0, 2.0],
..Default::default()
},
&emissive_mat,
&Physics::default()
.mass(100.0)
.collision_type(CollisionType::Sphere),
2,
);
engine.add_cube(
Transform {
position: [2.0, 20.0, 2.0],
..Default::default()
},
&pbr_mat,
&Physics::default().mass(10.0),
);
engine.run();
}