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 upRendering optimization notes #428
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
I would do frustum culling in user space, and make it possible to use a marker component for visibility
|
I would do frustum culling in user space, and make it possible to use a marker component for visibility |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
pub struct Visible;
impl Component for Visible {
type Storage = NullStorage<Visible>;
}
and use that in the join in the passes.
and use that in the join in the passes. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
Or maybe the opposite would be better, NotVisible and !NotVisible in Join, that way those that don't care about frustum culling don't need to do anything.
|
Or maybe the opposite would be better, NotVisible and !NotVisible in Join, that way those that don't care about frustum culling don't need to do anything. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
@Rhuagh Wouldn't it be nicer to do visibility query in renderer? Consider multicamera setup
|
@Rhuagh Wouldn't it be nicer to do visibility query in renderer? Consider multicamera setup |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
It's a fairly expensive procedure, and something that I consider optional.
|
It's a fairly expensive procedure, and something that I consider optional. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
If you have 8 meshes in total, you're gonna lose performance by doing it.
|
If you have 8 meshes in total, you're gonna lose performance by doing it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
I agree on that frustum culling should be optional.
But I'm not agree about using marker components for this purpose.
It's better to query visible meshes from Camera + Transform + SpecialSortedStructure. Probably with some caching.
|
I agree on that frustum culling should be optional. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
I don't agree.
With user space culling we allow the user to come up with their own culling techniques without having to duplicate our pass code. Some users may need occlusion culling, z-culling, frustum culling, distance culling. I don't think we should add all of those culling techniques to the renderer crate, but provide systems that can do these things externally.
|
I don't agree. With user space culling we allow the user to come up with their own culling techniques without having to duplicate our pass code. Some users may need occlusion culling, z-culling, frustum culling, distance culling. I don't think we should add all of those culling techniques to the renderer crate, but provide systems that can do these things externally. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
And by putting it in user space, we also enable the user to use the visibility data for their own systems.
|
And by putting it in user space, we also enable the user to use the visibility data for their own systems. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
Good point. But still those culling methods results are local to camera.
|
Good point. But still those culling methods results are local to camera. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
Some are yes, some aren't. Distance culling for instance can be done without the full camera matrix, you only need the position of the camera (or the controller entity, which might be a different entity).
|
Some are yes, some aren't. Distance culling for instance can be done without the full camera matrix, you only need the position of the camera (or the controller entity, which might be a different entity). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I mean that for another camera you have another results |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
Sure. My point is that it should be up to the user to decide what culling to use, and where, so they can reuse the results of the culling themselves if needed.
|
Sure. My point is that it should be up to the user to decide what culling to use, and where, so they can reuse the results of the culling themselves if needed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
Maybe we can have Culled attached to Camera. And in this component will be bitset with bits set to meshes culled by any technique.
|
Maybe we can have |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
If nobody fills Culled for specific Camera then renderer will render all meshes
|
If nobody fills |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
Possibly, I'm not sure what the performance/usability difference would be.
|
Possibly, I'm not sure what the performance/usability difference would be. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
But it's not a bad idea. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Difference with what approach? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Using components. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
It should be close to marker component in performance. And allows multiple cameras
|
It should be close to marker component in performance. And allows multiple cameras |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
That's a good point. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Rhuagh
Oct 18, 2017
Member
I reordered the comment above btw, to reflect what I think is a good order to do the improvements in :)
|
I reordered the comment above btw, to reflect what I think is a good order to do the improvements in :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
I agree with this order. I was writing them in the same order they were coming in my mind
|
I agree with this order. I was writing them in the same order they were coming in my mind |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
omni-viral
Oct 18, 2017
Member
@Rhuagh There is already an issue about skinning. This one is about optimizations we can add into renderer.
|
@Rhuagh There is already an issue about skinning. This one is about optimizations we can add into renderer. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Caching should be easy soon: Look at the |
omni-viral commentedOct 18, 2017
•
edited
Edited 1 time
-
omni-viral
edited Oct 22, 2017 (most recent)
Here we may put our notes and ideas about rendering optimizations.
I'll start with a few.
With help of slide-rs/specs#291.
gfx_halcollision-rscan help to optimize it further.