gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.36k stars 546 forks source link

Design the high-level drawing layer above gfx-rs #125

Closed kvark closed 7 years ago

kvark commented 10 years ago

As we are getting settled with the scope (see #108), we should start thinking about the layer above gfx-rs. I hope to see it as a separate projects in our gfx-rs organization, where this issue is the ideas hub for the initial design.

Here is what I expect this layer to do:

photex commented 10 years ago

Dropping some items here free association style:

These are clearly parts of multiple projects and some are pretty wishy-washy. I'm a fan of the scope of gfx right now. I don't think it should get much higher level than a graphics device abstraction. The next step is to build on top of gfx.

ghost commented 10 years ago

visibility determination (start with simple frustum intersection tests perhaps set the stage for other methods) Define a concept of DrawList Automatically re-order calls inside each draw list

These get my +1. They could be inter-related, creating a drawlist and culling it could be done as part of gfx-rs.

kvark commented 10 years ago

Found a couple of interesting links:

So my basic understanding of the high layer is the following. It defines the scene graph, where materials and spatial nodes are just possible node types, there should also be means of serializing/deserializing it. The user builds this graph on his side and passes it to the layer over the task boundary. The layer does visibility culling, skeletal animations, and sorting. Maybe something else too. The final draw list is provided to our Renderer (either one by one or in some kind of groups, we'll see later), which (again) sends commands to the device over the task boundary.

Primitive buiders are a separate thing, and I think @photex and @bjz already thought about making a library about procedural generation that would cover that.

kvark commented 10 years ago

Another example pipeline

kvark commented 10 years ago

The drawlist concept is mostly defined in #209.

kvark commented 9 years ago

Nominating gfx_scene for this role.

bvssvni commented 9 years ago

I've looked over the gfx_scene source and it looks promising.

kvark commented 9 years ago

The ecosystem has been expanded to include gfx_pipeline, claymore_scene, and claymore_load (sub-crates of claymore). It is now as high as we could ever be:

let pipeline = gfx_pipeline::forward::Pipeline::new(...);
let scene = claymore_load::scene(...);
...
pipeline.render(&scene, ...);

Please evaluate these libraries at some time to see if they can fit the role. I'm pretty much done with the general architecture, so I'll be focusing more on the game itself, hopefully.

kvark commented 9 years ago

gfx_scene has been transferred

kvark commented 7 years ago

Closing because of the following great libraries: