Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
   Copyright (c) 2016 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _MANAGERS_RENDER_PASS_MANAGER_H_
#define _MANAGERS_RENDER_PASS_MANAGER_H_

#include "Core/Headers/NonCopyable.h"
#include "Rendering/RenderPass/Headers/RenderPass.h"

namespace Divide {

class SceneGraph;
class RenderQueue;
class SceneRenderState;
enum class RenderStage : U32;

DEFINE_SINGLETON(RenderPassManager)

  public:
    /// Call every renderqueue's render function in order
    void render(SceneRenderState& sceneRenderState);
    /// Add a new pass that will run once for each of the RenderStages specified
    RenderPass& addRenderPass(const stringImpl& renderPassName, 
                              U8 orderKey,
                              std::initializer_list<RenderStage> renderStages);
    /// Find a renderpass by name and remove it from the manager
    void removeRenderPass(const stringImpl& name);
    U16  getLastTotalBinSize(RenderStage renderStage) const;

    inline RenderQueue& getQueue() {
        return *_renderQueue;
    }

    RenderPass::BufferData&
    getBufferData(RenderStage renderStage, U32 pass, U32 stage);

    const RenderPass::BufferData&
    getBufferData(RenderStage renderStage, U32 pass, U32 stage) const;

  private:
    RenderPassManager();
    ~RenderPassManager();

    RenderPass* getPassForStage(RenderStage renderStage) const;
  private:
    // Some vector implementations are not move-awarem so use STL in this case
    vectorImpl<RenderPass*> _renderPasses;
    RenderQueue* _renderQueue;

END_SINGLETON

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Managers/Headers/RenderPassManager.h

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

713 Diff Diff IonutCava picture IonutCava Wed 25 May, 2016 15:43:38 +0000

[IonutCava]
- Removed all unique_ptr’s from the code with classic new/delete pairs. They were seriously not needed.
- Added the concept of SceneComponent to scene specific classes: aiManager, lightPool, sceneGraph, physicsInterface etc
— This allowed the removal of the global GET_ACTIVE_SCENEGRAPH call;

698 Diff Diff IonutCava picture IonutCava Mon 09 May, 2016 20:21:34 +0000

[IonutCava]
- Remove all anaglyph rendering code. nVidia gained 1 sympathy point with me for VRWorks:
— Single Pass Stereo completely removes the need for double rendering the scene for each eye.
— LiquidVR also support similar technology
-— Once VR development starts for Divide, documentation for both SDKs should be pretty sorted.

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

560 Diff Diff IonutCava picture IonutCava Wed 11 Nov, 2015 16:11:13 +0000

[IonutCava]
- Implement a proper RenderPassManager that can hold and execute, in order, multiple rendering passes, with each pass able to handle multiple rendering stages:
— Added a RenderPass for shadowmapping that gets executed first
— Added a RenderPass for environment mapping that gets executed second
— Added a RenderPass for normal rendering that gets executed third and processes 2 stages: Z_PRE_PASS and DISPLAY
— All RenderPasses get executed twice if anaglyph rendering is enableDebugRender
- Added environment map auto-generation. The second render pass creates a reflection cube map used for reflections
- Cleaned up Kernel->GFXDevice->SceneManager relation for scene rendering
- Moved Renderer to SceneManager as it is not related to the GFXDevice in any way and it’s implementation can be very scene dependent.

523 Diff Diff IonutCava picture IonutCava Wed 07 Oct, 2015 16:11:44 +0000

[IonutCava]
- Performance optimizations:
— Change GFXDevice’s vector of RenderPackages to a standalone class that handles its own memory, thus avoiding the hit from clear()/push_back()
— Also minimizes memory allocation in each render pass
- Remove the extra WaitForLockedRange call in LockRange command. It was added to work around a bug that doesn’t happen any more due to better buffer usage.
- Add some vegetation generation notes for future updates

466 Diff Diff IonutCava picture IonutCava Fri 05 Jun, 2015 15:07:17 +0000

[Ionut]
- Moved EASTL, SimpleINI and Threadpool libraries from Dependencies repo to engine repo
- Disabled EASTL string and vector support as they are really out of date and missing required features.
— EASTL hash map is still usable

442 Diff Diff IonutCava picture IonutCava Wed 20 May, 2015 15:25:02 +0000

[Ionut]
- Better platform handling:
— All platform specific code moved in 3 separate files: PlatformDefinesWindows / PlatformDefinesUnix / PlatformDefinesApple
— Added CPU and RAM check at startup to make sure we meet minimum requirements to run properly
- Smart pointers should never used MemoryManager_NEW for allocating memory (MemoryManager_NEW tracks allocations but must be matched with a DELETE call in order to no report leaks). Corrected.
- Zombification of Singletons is only enabled in Debug builds
- Fixed a bug in Task.cpp (nowTime check) that prevented some tasks to run on the first call (changed a ‘>’ check to a ‘>=’)
— This also fixed bounding box computations for skinned submeshes
- Improved dead zone handling for joysticks

396 Diff Diff IonutCava picture IonutCava Thu 02 Apr, 2015 10:51:16 +0000

[Ionut]
- Small cleanups

387 IonutCava picture IonutCava Wed 25 Mar, 2015 17:05:46 +0000

[Ionut]
- Massively reduced rendering pipeline complexity:
— RenderPassCuller is only responsible for culling the SceneGraph from the given node and holds a cache of visible nodes for each render stage
— The SceneManager asks the RenderPassCuller to the get a list of visible nodes -> passes the nodes to the RenderQueue -> asks the RenderQueue to sort itself -> sorts the visible nodes based on the order given by the RenderQueue -> asks the GFXDevice to build render data and the command buffer based on the resulting nodes -> clears the RenderPassCuller cache on “frame end” event
- Fixed draw commands that don’t use an indirect buffer