jiangyizhou / aquarium-test Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
In order to further stress the Dawn backend, we should increase the number of Draw() calls. Currently DrawIndexed()
is used to draw many instances at once. Using DrawIndexed()
in this case is optimal - however, by instead calling Draw()
many times, we can better emulate a modern graphics application.
I suggest that in models that have high instance counts (particularly FishModel
), a separate path that uses Draw()
instead of DrawIndexed()
should be available. A command line parameter can be added that will switch the path on. Perhaps --allowIndividualDraws
?
This is a meta issue to track progress for Aquarium improvements, When complete, the workload will be better suited to show backend optimizations.
Items to be completed (in no specific order):
We should implement MSAA functionality soon. What is the blocking factor here? Is it lack of Vulkan/Dawn MSAA support?
Currently, DrawIndexed()
is used to draw InnerModel
, OuterModel
, and one instance of GenericModel
where drawn instances is 1 . There is an overhead associated with DrawIndexed()
that is unnecessary and could be eliminated by using Draw()
instead.
I also see an instance of GenericModel
where drawn instances is 0. In this case, we should not draw at all.
In order to reduce memory, we should eliminate redundant buffers. For multiple models, there are multiple instances created with their own lightFactorUniforms buffer. These separate instances use the same data for lightFactorUniforms, so we should instead share a buffer between all instances of the same model.
This is valid for:
To simulate lots of rendering meshes of modern games, individual draw path is required to draw every fish one by one.
We can try two methods of d3d12 to implement this path, and compare the performance,
Every frame, fishVertexUniforms
is updated with the same hardcoded data. The data should be initialized and never updated again.
FishPers data should be created based on the number of fish in the scene. There are 3 instances where it is hardcoded to 100,000:
FishModelDawn.cpp:41
FishModelDawn.cpp:154
FishModelDawn.h:65
Add MSAA support on D3D12 backend.
Size of world uniforms should be dynamically allocated for each of the model. Then copy buffer size can be largely reduced.
Shaderc has extra-semicolon warning which will trigger warning error when build aquarium.
Currently, native d3d12 backend uses 2 back buffers, but dawn d3d12 or vulkan has 3. Fps may be cut dawn by vsync. So enable 3 back buffers to improve performance.
Aquarium currently suffers from a very long startup time. The largest contributor to this is mipmap generation for all textures. Currently this occurs single threaded on the CPU. The ideal solution would be to upload each full texture to the GPU and use a compute shader to generate mipmaps.
Currently Dawn is getting built as debug which causes backend debug validation layers to be enabled. We should be able to switch between release and debug builds.
Perhaps out/debug
and out/release
instead of a single out/build
?
The function updateGlobalUniforms()
generates the scene's common position values and are pushed to a individual models and then update every frame. Instead, we could eliminate many CPU->GPU copies by only updating these values on the GPU one time and then sharing between all models.
The models currently updating a separate copy of viewUniforms
every frame are:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.