Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRenderer rewrite #285
Conversation
ebkalderon
added some commits
Mar 7, 2017
omni-viral
and others
added some commits
Aug 23, 2017
| + if self.config.fullscreen { | ||
| + wb = wb.with_fullscreen(winit::get_primary_monitor()); | ||
| + } | ||
| + match self.config.dimensions { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
and others
added some commits
Aug 23, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Binero
Aug 24, 2017
Contributor
There is still a few issues with this PR.
- It exposes a lot of
cgmath, for instance insiderenderer::Camera. - It appears to me that the renderer and the asset manager are tightly linked through
AssetPtr. It was decided in #190 that both systems are optional, so the asset manager must work without the renderer, and the renderer must work without the asset manager.
|
There is still a few issues with this PR.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Aug 24, 2017
Member
@Binero I don't know when that decision was made, but having a game without rendering doesn't make much sense to me.
|
@Binero I don't know when that decision was made, but having a game without rendering doesn't make much sense to me. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Aug 24, 2017
Member
Zork! although I must say it seems unlikely a text adventure would have any need for Amethyst. :P
|
Zork! although I must say it seems unlikely a text adventure would have any need for Amethyst. :P |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Binero
Aug 24, 2017
Contributor
@torkleyy Well, the issue is linked in the post. One of the rationales I quite like is that the components need to be reusable and replaceable. If I want to use a custom renderer, that should be possible. If I want to use a custom asset manager, that should be possible as well.
|
@torkleyy Well, the issue is linked in the post. One of the rationales I quite like is that the components need to be reusable and replaceable. If I want to use a custom renderer, that should be possible. If I want to use a custom asset manager, that should be possible as well. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
Aug 24, 2017
Member
The fundamental problem with that idea is that it's in direct conflict with our desire for a hot reloading feature. The two have to be coupled to make that work. The only way I can see around this would be to use cargo features to expose a different API without hot reloading capabilities when there isn't an "assets" feature present. So if modularity is truly that high of a priority for us we can do that but I feel that should be a bigger discussion with more people involved. My views personally are that we eventually have to make some architectural decisions for our end users in order to provide useful and usable software. Too many choices can hamper ease of use.
|
The fundamental problem with that idea is that it's in direct conflict with our desire for a hot reloading feature. The two have to be coupled to make that work. The only way I can see around this would be to use cargo features to expose a different API without hot reloading capabilities when there isn't an "assets" feature present. So if modularity is truly that high of a priority for us we can do that but I feel that should be a bigger discussion with more people involved. My views personally are that we eventually have to make some architectural decisions for our end users in order to provide useful and usable software. Too many choices can hamper ease of use. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
torkleyy
Aug 24, 2017
Member
The way I see it, renderer and assets crate are separate, thus reusable. The main crate is just the glue, so if you want to e.g. use another renderer, you can still use the other crates, but you need your own glue.
|
The way I see it, renderer and assets crate are separate, thus reusable. The main crate is just the glue, so if you want to e.g. use another renderer, you can still use the other crates, but you need your own glue. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Binero
Aug 24, 2017
Contributor
One must consider that because they are so tightly coupled at the moment, it is impossible to generate meshes at runtime, as is needed in for example voxel engines or other volumetric engines.
This is because MeshComponent is an Asset, which is loaded from Loader. I think the following approach would be much more flexible:
- When you load a
Meshfrom theLoader, it gives you anAssetFuture<T> where T: Meshwhich implementsComponentwheneverTdoes. - This
AssetFuture<Mesh>can be attached to an entity. - There is an
AssetSystemwhich tracks whenever these futures have been completed, and replaces theAssetFuture<T>components on these entities withT.
As an added bonus, this system could leave behind a LoadedAsset<T> component, as to keep track of which entities use which assets. Hot reloading can then easily be implemented by simply iterating over these entities and adding new AssetFutures.
This approach has the advantage that when the asset system is not required, as it isn't for instance when you are generating meshes, it doesn't get in the way as it does now, preventing you from implementing your features.
|
One must consider that because they are so tightly coupled at the moment, it is impossible to generate meshes at runtime, as is needed in for example voxel engines or other volumetric engines. This is because
As an added bonus, this system could leave behind a This approach has the advantage that when the asset system is not required, as it isn't for instance when you are generating meshes, it doesn't get in the way as it does now, preventing you from implementing your features. |
Binero
and others
added some commits
Aug 24, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Wow. Checks are passed |
torkleyy commentedAug 15, 2017
This is the PR merging
rendererintodevelop. It is WIP, but shows the overall progress.TODO