History: SoC2012 Implementation of Off-Screen Particles
Source of version: 21
- «
- »
Copy to clipboard
!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. 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 realised 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 .
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:
{FANCYLIST()}
__preparation before implementation__:
__depth acquisition__:
__downsampled rendering__:
__render target merging & shaders__:
__mixed resolution rendering__:{FANCYLIST}
!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:
{IMG(src="http://www.bmm.yoyo.pl/ClassDiagram.JPG")}classes diagram version 1.0{IMG}
!Short description:
__OffScreenParticles__: (perhaps could be a CompositorChain)
{REMARKSBOX(type="note")}Class controls appropriate direction of operations.
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.
Even if initial choice of some used subclasses and their parameters is transparent, there are still getters and setters.{REMARKSBOX}
__DepthAcquisitioner__:
{REMARKSBOX(type="note")}Class could be abstract (or even interface), because methods will vary depending on version of used RenderSystem and GPU series.
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)
Class should also provide a method to read acquired depth data transparently, no matter which subclass was used.{REMARKSBOX}
__DepthDownsampler__:
{REMARKSBOX(type="note")}Class used when there is need for downsampling of the depth buffer.
It is not obligatory when we use Two-Pass Depth Acquisitioner.
Provides fields and setters allowing to change these fields:
Especially scale of downsampling.
Could be expanded and have a subclass providing downsampling that is not proportional to the powers of 2 or not square. It could provide rectangular fields, that requires additional field. Subclass: RectDepthDownsampler{REMARKSBOX}
__OffScreenRenderer__:
{REMARKSBOX(type="note")}Abstract Class.
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
(Game developers can provide own impementations of silhouette() method, for example: Median, Average, depending on derivative, how rapid depth changes, other...){REMARKSBOX}
__RenderTargetMerger__:
{REMARKSBOX(type="note")}Abstract Class.
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():
If a specified particle effect does not support transparency, we can use only zShade() without alfaBlending().{REMARKSBOX}
__ResolutionMixer__:
{REMARKSBOX(type="note")}It is class not mandatory to use. Game developer can define in the constructor of OffScreenParticles class whether to use it or not.
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
(acquisition dependant on DepthAcquisitioner subclass, second pass of depth acquisition with full resolution){REMARKSBOX}
!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 which will probably be used to communicate with implemented component.
Jun 20 - further communication, presentation of class diagrams, uml projects, proposed algorythms and solutions for further implementation.
July 15 - implementation of algorythms connected with depth testing and omitting unvisible particles + optimalisation of algorythms. Providing clear component structure of the code and providing documentation.
July 30 - implementation of algorythms connected with Alfa-blending + optimalisation of algorythms. Providing clear component structure of the code and providing documentation.
August 18 - implementation of algorythms connected with mixed - resolution rendering and edge detection + optimalisation of algorythms. Providing clear component structure of the code and providing documentation.