Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace nodes with render_features and new jobs framework. #135

Merged
merged 6 commits into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,9 @@ This tool currently is only useful for packing assets.
* Nearly all assets are data-driven from serializable and hashable structures rather than hard-coded.
* Buffers and images are asynchronously uploaded on dedicated transfer queue when available
* Multi-pass material abstraction with bindable parameters
* Nodes/Render Jobs system - Inspired by the 2015 GDC talk "Destiny's Multithreaded Rendering Architecture."
* Render Features and Jobs system - Inspired by the 2015 GDC talk "Destiny's Multithreaded Rendering Architecture."
* A job system with extract, prepare, and write phases
* Rendering is pipelined with simulation thread, and the job structure is intended to be highly parallel (not
actually executed parallel yet)
* Rendering is pipelined with simulation thread, and the job structure is parallelizable by the application
* Handles multiple views and phases allowing advanced features like shadow mapping
* Flexible sorting mechanism for interleaving and batching write commands from multiple rendering features
* Visibility Region - Built on top of `rafx-visibility`
Expand Down
1 change: 1 addition & 0 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ron = "0.6"
puffin-imgui = { version = "0.7.0", optional = true }
profiling = "1.0.1"
stats_alloc = { version = "0.1.8", optional = true }
bevy_tasks = "0.5.0"

[features]
default = [
Expand Down
4 changes: 2 additions & 2 deletions demo/src/assets/font/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::assets::font::FontAssetType;
use rafx::assets::distill_impl::AssetResource;
use rafx::assets::AssetManager;
use rafx::distill::daemon::AssetDaemon;
use rafx::renderer::RendererPlugin;
use rafx::renderer::RendererAssetPlugin;

pub struct FontAssetTypeRendererPlugin;

impl RendererPlugin for FontAssetTypeRendererPlugin {
impl RendererAssetPlugin for FontAssetTypeRendererPlugin {
//
fn configure_asset_daemon(
&self,
Expand Down
4 changes: 2 additions & 2 deletions demo/src/assets/gltf/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::assets::gltf::MeshAssetType;
use rafx::assets::distill_impl::AssetResource;
use rafx::assets::AssetManager;
use rafx::distill::daemon::AssetDaemon;
use rafx::renderer::RendererPlugin;
use rafx::renderer::RendererAssetPlugin;

pub struct GltfAssetTypeRendererPlugin;

impl RendererPlugin for GltfAssetTypeRendererPlugin {
impl RendererAssetPlugin for GltfAssetTypeRendererPlugin {
//
fn configure_asset_daemon(
&self,
Expand Down
4 changes: 2 additions & 2 deletions demo/src/assets/ldtk/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::assets::ldtk::LdtkAssetType;
use rafx::assets::distill_impl::AssetResource;
use rafx::assets::AssetManager;
use rafx::distill::daemon::AssetDaemon;
use rafx::renderer::RendererPlugin;
use rafx::renderer::RendererAssetPlugin;

pub struct LdtkAssetTypeRendererPlugin;

impl RendererPlugin for LdtkAssetTypeRendererPlugin {
impl RendererAssetPlugin for LdtkAssetTypeRendererPlugin {
//
fn configure_asset_daemon(
&self,
Expand Down
9 changes: 4 additions & 5 deletions demo/src/components.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
use crate::features::mesh::MeshRenderNodeHandle;
use crate::features::sprite::SpriteRenderNodeHandle;
use glam::f32::Vec3;
use glam::Quat;
use rafx::framework::visibility::VisibilityObjectArc;
use rafx::render_features::RenderObjectHandle;
use rafx::visibility::ViewFrustumArc;

#[derive(Clone)]
pub struct MeshComponent {
pub render_node: MeshRenderNodeHandle,
pub render_object_handle: RenderObjectHandle,
}

#[derive(Clone)]
pub struct SpriteComponent {
pub render_node: SpriteRenderNodeHandle,
pub render_object_handle: RenderObjectHandle,
}

#[derive(Clone)]
pub struct VisibilityComponent {
pub handle: VisibilityObjectArc,
pub visibility_object_handle: VisibilityObjectArc,
}

#[derive(Clone, Copy)]
Expand Down
8 changes: 4 additions & 4 deletions demo/src/demo_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use rafx::assets::distill_impl::AssetResource;
use rafx::assets::{AssetManager, ComputePipelineAsset, MaterialAsset};
use rafx::base::resource_map::ResourceMap;
use rafx::distill::loader::handle::Handle;
use rafx::nodes::{ExtractResources, RenderRegistryBuilder};
use rafx::renderer::RendererPlugin;
use rafx::render_features::{ExtractResources, RenderRegistryBuilder};
use rafx::renderer::RendererAssetPlugin;

// A plugin that add demo-specific configuration

Expand All @@ -22,15 +22,15 @@ pub struct DemoStaticResources {

pub struct DemoRendererPlugin;

impl RendererPlugin for DemoRendererPlugin {
impl RendererAssetPlugin for DemoRendererPlugin {
fn configure_render_registry(
&self,
render_registry_builder: RenderRegistryBuilder,
) -> RenderRegistryBuilder {
render_registry_builder
.register_render_phase::<DepthPrepassRenderPhase>("DepthPrepass")
.register_render_phase::<OpaqueRenderPhase>("Opaque")
.register_render_phase::<ShadowMapRenderPhase>("ShadowMap")
.register_render_phase::<OpaqueRenderPhase>("Opaque")
.register_render_phase::<TransparentRenderPhase>("Transparent")
.register_render_phase::<PostProcessRenderPhase>("PostProcess")
.register_render_phase::<UiRenderPhase>("Ui")
Expand Down
Loading