mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 00:23:14 +00:00
New test scene, better render quality (#6)
* Updated test scene * Adjusted lighting, tonemapping * Replaced skybox * Added bloom and FXAA * [meta] Added assets folder to build dependencies
This commit is contained in:
+20
-1
@@ -1,6 +1,11 @@
|
||||
use std::{f32::consts, mem};
|
||||
|
||||
use bevy::{
|
||||
core_pipeline::{
|
||||
bloom::{BloomCompositeMode, BloomPrefilterSettings, BloomSettings},
|
||||
fxaa::Fxaa,
|
||||
tonemapping::Tonemapping,
|
||||
},
|
||||
math::vec3,
|
||||
prelude::*,
|
||||
window::{CursorGrabMode, PrimaryWindow},
|
||||
@@ -59,18 +64,32 @@ impl Default for OrbitCam {
|
||||
}
|
||||
|
||||
fn spawn_camera(mut cmd: Commands) {
|
||||
let focus = vec3(0., 1.5, 0.);
|
||||
let focus = vec3(0.35011, 0.5, -0.99576);
|
||||
let camera_xform = Transform::from_xyz(-2.5, 4.5, 5.0).looking_at(focus, Vec3::Y);
|
||||
|
||||
cmd.spawn((
|
||||
// FIXME: Come up with a good way to separate the camera controller from
|
||||
// all the render settings here (all of these components need to
|
||||
// be paired with the camera)
|
||||
Camera3dBundle {
|
||||
transform: camera_xform,
|
||||
tonemapping: Tonemapping::BlenderFilmic,
|
||||
camera: Camera {
|
||||
hdr: true,
|
||||
..default()
|
||||
},
|
||||
..default()
|
||||
},
|
||||
BloomSettings {
|
||||
composite_mode: BloomCompositeMode::EnergyConserving,
|
||||
intensity: 0.25,
|
||||
prefilter_settings: BloomPrefilterSettings {
|
||||
threshold: 0.8,
|
||||
threshold_softness: 0.5,
|
||||
},
|
||||
..default()
|
||||
},
|
||||
Fxaa::default(),
|
||||
OrbitCam {
|
||||
focus,
|
||||
radius: Vec3::distance(camera_xform.translation, focus),
|
||||
|
||||
@@ -54,7 +54,7 @@ impl SkyboxPaths {
|
||||
}
|
||||
|
||||
fn setup(mut cmd: Commands, assets: Res<AssetServer>) {
|
||||
cmd.insert_resource(Cubemap::new("scythian_tombs_4k", &assets));
|
||||
cmd.insert_resource(Cubemap::new("test_scene", &assets));
|
||||
}
|
||||
|
||||
fn asset_loaded(
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#[rustfmt::skip]
|
||||
use bevy::{
|
||||
pbr::NotShadowCaster,
|
||||
prelude::*,
|
||||
@@ -28,9 +27,36 @@ fn spawn_scene(
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut mat_proc_grid: ResMut<Assets<ProceduralGridMaterial>>,
|
||||
) {
|
||||
// Skeletal mesh
|
||||
// Test scene
|
||||
cmd.spawn(SceneBundle {
|
||||
scene: assets.load("gltf/base_human_male.gltf#Scene0"),
|
||||
scene: assets.load("gltf/sample-room.gltf#Scene0"),
|
||||
..default()
|
||||
});
|
||||
|
||||
// Main light
|
||||
// TODO: get Blender to export enough metadata to automate light placements
|
||||
cmd.spawn(PointLightBundle {
|
||||
point_light: PointLight {
|
||||
color: Color::hex("FFE5B4").unwrap(),
|
||||
intensity: 200.,
|
||||
radius: 0.1,
|
||||
shadows_enabled: true,
|
||||
..default()
|
||||
},
|
||||
transform: Transform::from_xyz(0.35263, 2.4348, 0.19601),
|
||||
..default()
|
||||
});
|
||||
|
||||
// Monitor glow
|
||||
cmd.spawn(PointLightBundle {
|
||||
point_light: PointLight {
|
||||
color: Color::WHITE,
|
||||
intensity: 6.,
|
||||
radius: 0.25,
|
||||
shadows_enabled: false,
|
||||
..default()
|
||||
},
|
||||
transform: Transform::from_xyz(0.42615, 1.0706, -2.0705),
|
||||
..default()
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user