History: SoC2012 Implementation of Off-Screen Particles
Preview of version: 32
- «
- »
Aim of the project:
Thanks to this project Ogre users will benefit in faster rendering of particle systems. Particles hidden behind solid objects will not be painted.
Low frequency particle systems will be enabled to be rendered with downsampled resolution without observable loss of quality (i.a. thanks to blur at center of effects and full resolution in the vicinity of solid objects edges). That will enable saving more computational power for improvement of particle system granularity (for example).
General Information:
Project covers implementation of "GPU gems 3. Chapter 23. High-Speed, Off-Screen Particles" from:
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch23.html .
It is being realized during "Google Summer of Code 2012".
Student assigned to the project: Karol Badowski.
Promotor of the project: Assaf Raman.
Project repository is a fork of OGRE mercurial repository (revision 8d3b960cce3e), aviable at:
https://bitbucket.org/KarolBadowski/ogre-gsoc2012-offscreenparticles .
https://bitbucket.org/KarolBadowski/ogre-gsoc2012-offscreenparticles-tidyupcode (new fork)
Project discussion thread on official OGRE forum:
http://www.ogre3d.org/forums/viewtopic.php?f=13&t=69771 .
Project proposal on Google Summer of Code website:
http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/karolbadowski/1
Milestones:
preparation before implementation:
depth acquisition:
downsampled rendering:
render target merging & shaders:
mixed resolution rendering:
Tasks for each milestone:
1:
- requirements specification
- UML diagrams
- reading tutorials
- understanding documentation
2:
- two pass depth acquisition
- multi render target depth acquisition
- z-buffer depth acquisition
- alpha channel depth acquisition
- automatisation of depth acquisition technique choice
3:
- dowsampling with variable scale
- point sampling depth renderer
- maximum of depth samples renderer
4:
- alpha-blending
- binary depth test
- soft particles
5:
- edges detection
- stenciling
Initial proposition of classes diagram:
Short description:
OffScreenParticles: (perhaps could be a CompositorChain)
In the constructor, it transparently makes a choice of appropriate subclasses (for example subclass of DepthAcquisitioner with appropriate parameters).
It acquires input data, calls methods of following classes and propagates the output.
DepthAcquisitioner:
It would be comfrtable if choice of the subclass was automatic, transparent to the developer. Decision process will need to "ask" classes providing intel about Render System. It also could check whether Alpha channel is beeing used (semi-transparent solid objects).
Single-Pass:
-ZBuff_DepthAcquisitioner: Z-buffer
(provided in directX10)
-MRT_DepthAcquisitioner: Multiple Rendering Target
(if older than directX10 and we do not use MSAA - multisample AntiAliasing)
-Alpha_DepthAcquisitioner: depth saved in channel alfa
(if tranparency is not used and (we do not need MSAA or GPU series different than GeForce6 or GeForce7))
Two-Pass:
-TwoPass_DepthAcquisitioner: writing to single rendering target in extra pass
(if we do not use MRT, still have possibility of MSAA even in directx9, still have possibility to use alfa channel)
DepthDownsampler:
It is not obligatory when we use Two-Pass Depth Acquisitioner.
Provides fields and setters allowing to change these fields:
Especially scale of downsampling.
OffScreenRenderer:
Important abstract method: silhouette().
I will provide support at least for two overrides (suggested in the article), that use private methods:
-pointSamplingDepth(): creates halo
-maximumOfDepthSamples(): minor halo artifacts reduced after linear blending
RenderTargetMerger:
Class merges data from MRT, preparing final output.
Most important abstract method is concatenate().
Class should support the usage of some already implemented PixelShaders and their concatenations, user defined application-dependant PixelShaders.
Method alfaBlending() that uses zShade() abstract method.
I will provide the implementation of overrides for zShade(), using:
-binaryDepthTestShade():
-softParticlesShade():
ResolutionMixer:
It provides edge detection method...
-detectEdges(): provides Laplace or Sobel edge detection matrix filter
...and second pass of depth acquisition with full resolution
-stencileEdgesPerticularisation(): fraction of pixels repeat the process without downsampling
Schedule:
"Off-Screen Particles" project timeline:
Before May 21 - Reading documentation of OGRE engine, especially particle systems
before Jun 4 - communication with project supervisor about eventual difficulties or questions in understending of already implemented classes