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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
   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 _RENDERING_RENDER_PASS_RENDERPASS_H_
#define _RENDERING_RENDER_PASS_RENDERPASS_H_

#include "Platform/Headers/PlatformDefines.h"
namespace Divide {

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

// A RenderPass may contain multiple linked stages.
// Usefull to avoid having multiple renderqueues per pass if 2 stages depend on one:
// E.g.: Z_PRE_PASS + DISPLAY share the same renderqueue
class RenderPass : private NonCopyable {
   public:
       struct BufferData {
           BufferData();
           ~BufferData();

           ShaderBuffer* _renderData;
           ShaderBuffer* _cmdBuffer;
           U32 _lastCommandCount;
           U32 _lasNodeCount;
       };
   protected:

    struct BufferDataPool {
        explicit BufferDataPool(U32 maxPasses, U32 maxStages);
        ~BufferDataPool();

        BufferData& getBufferData(U32 pass, I32 idx);
        typedef vectorImpl<BufferData*> BufferPool;
        vectorImpl<BufferPool> _buffers;
    };

   public:
    // passStageFlags: the first stage specified will determine the data format used by the additional stages in the list
    RenderPass(stringImpl name, U8 sortKey, std::initializer_list<RenderStage> passStageFlags);
    ~RenderPass();

    void render(SceneRenderState& renderState);
    inline U8 sortKey() const { return _sortKey; }
    inline U16 getLastTotalBinSize() const { return _lastTotalBinSize; }
    inline const stringImpl& getName() const { return _name; }

    inline bool hasStageFlag(RenderStage stageFlag) const {
        return std::find_if(std::cbegin(_stageFlags), std::cend(_stageFlags),
                            [&stageFlag](RenderStage stage) {
                                return (stage == stageFlag);
                            }) != std::cend(_stageFlags);
    }


    BufferData& getBufferData(U32 pass, I32 idx);
   protected:
    bool preRender(SceneRenderState& renderState, U32 pass);
    bool postRender(SceneRenderState& renderState, U32 pass);

    std::pair<U32, U32> getRenderPassInfoForStages(const vectorImpl<RenderStage>& stages) const;
   private:
    U8 _sortKey;
    stringImpl _name;
    bool _useZPrePass;
    U16 _lastTotalBinSize;
    vectorImpl<RenderStage> _stageFlags;
    BufferDataPool* _passBuffers;
};

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Rendering/RenderPass/Headers/RenderPass.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

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

645 Diff Diff IonutCava picture IonutCava Mon 15 Feb, 2016 16:44:16 +0000

[IonutCava]
- Added frustum planes to the GFXDevice UBO
- Occlusion culling updates

644 Diff Diff IonutCava picture IonutCava Sun 14 Feb, 2016 15:04:17 +0000

[IonutCava]
- Fix ZPrePass on AMD hardware:
— Use invariant gl_Position;
— USe early fragment test for non-alpha blended entities
— Add a toggle to disable/enable ZPrePass at compile time
- Add Occlusion culling debugging feature togglable at compile time
- Initial code for high prio materials (used to always calc reflections, compute shaders immediately, etc)

634 Diff Diff IonutCava picture IonutCava Wed 27 Jan, 2016 20:41:59 +0000

[IonutCava]
- Fix 2 issues with previous commit

629 Diff Diff IonutCava picture IonutCava Thu 21 Jan, 2016 17:08:04 +0000

[IonutCava]
- New environment mapping system:
— Use previous frame’s list of nodes sorted front to back
— Update reflection for each if they meet the necessary criteria
- Cleanup particle system classes
- Cleanup GenericVertexData class
- Improve argument forwarding to frustum culling tasks

612 Diff Diff IonutCava picture IonutCava Sun 20 Dec, 2015 17:47:26 +0000

[IonutCava]
- Z-PrePass system improvements
— Depth only rendertarget and both eye render targets (screen and anaglyph) share the same depth buffer
— Screen render targets don’t clear or write the/to the depth buffer

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.

540 IonutCava picture IonutCava Wed 28 Oct, 2015 19:06:28 +0000

[IonutCava]
- Remove the “Platform” folder from the Platform project as the name is redundant. Move files one level up