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
#include "Headers/SceneNodeRenderState.h"
#include "Platform/Video/Headers/GFXDevice.h"

namespace Divide {

SceneNodeRenderState::~SceneNodeRenderState() {}

U32 SceneNodeRenderState::getDepthStateBlock() {
    if (_depthStateBlockHash == 0) {
        RenderStateBlock depthDesc;
        depthDesc.setColorWrites(false, false, false, false);
        _depthStateBlockHash = depthDesc.getHash();
    }
    return _depthStateBlockHash;
}

U32 SceneNodeRenderState::getShadowStateBlock() {
    if (_shadowStateBlockHash == 0) {
        RenderStateBlock depthDesc;
        /// Cull back faces for shadow rendering
        depthDesc.setCullMode(CullMode::CCW);
        // depthDesc.setZBias(1.0f, 2.0f);
        depthDesc.setColorWrites(true, true, false, false);
        _shadowStateBlockHash = depthDesc.getHash();
    }
    return _shadowStateBlockHash;
}

bool SceneNodeRenderState::getDrawState(RenderStage currentStage) const {
    return _drawState &&
            !BitCompare(_exclusionMask,
                        (to_bitwise(to_uint(currentStage) + 1)));
}

void SceneNodeRenderState::addToDrawExclusionMask(RenderStage stage) {
    _exclusionMask |= (to_bitwise(to_uint(stage) + 1));
}

void SceneNodeRenderState::removeFromDrawExclusionMask(RenderStage stage) {
    _exclusionMask &= ~(to_bitwise(to_uint(stage) + 1));
}

};

Commits for Divide-Framework/trunk/Source Code/Graphs/SceneNodeRenderState.cpp

Diff revisions: vs.
Revision Author Commited Message
557 Diff Diff IonutCava picture IonutCava Tue 10 Nov, 2015 12:00:20 +0000

[IonutCava]
- Gather all rendering calls from glVertexArray and glGenericVertexData into a single function in glResources: submitRenderCommand.
— This allows both classes to interpret GenericDrawCommands in the same way
- Use unsigned ints for all hasehs instead of size_t to avoid negative number hashes (useful for debugging)

437 Diff Diff IonutCava picture IonutCava Thu 14 May, 2015 21:21:04 +0000

[Ionut]
- Merged RenderStateBlock and RenderStateBlockDescriptor classes

433 Diff Diff IonutCava picture IonutCava Wed 13 May, 2015 15:57:17 +0000

[Ionut]
- Some code cleanup (global functions now start with a capital case)
- Some fixed timestep adjustments
- Input logging (key presses & mouse button presses with location at event time)

408 Diff Diff IonutCava picture IonutCava Thu 23 Apr, 2015 15:44:51 +0000

[Ionut]
- Fixed shadow map rendering using the new batching system (W.I.P.)
- Modified the Skeleton/Wireframe/BoundingBox/Geometry toggle system in SceneRenderState

390 Diff Diff IonutCava picture IonutCava Thu 26 Mar, 2015 22:41:09 +0000

[Ionut]
- Renamed most enum values to shorter names (possible due to enum-class type safety)
- Removed to redundant state change cases (glCullFace when CULL_MODE_NONE was used, and glLineWidth that didn’t have redundancy checks)
- Added a hacky SceneGraphNode render call count to skip the first 3 draw calls so that the data buffers have time to update properly (solves flickering and erroneous rendering when moving camera to include a new node)

379 Diff Diff IonutCava picture IonutCava Thu 19 Mar, 2015 17:13:02 +0000

[Ionut]
- More batching work:
— Implemented a RenderQueue where all draw commands are gathered but only sent to the GPU on a “flush” command. (currently, one flush per render bin pass)
— RenderQueue holds RenderPackage (former NodeRenderData) and tries to batch the draw commands into the previous package if ShaderBuffer and TextureData between the 2 packages is compatible (currently disabled as some ShaderBuffer rendering glitches appear with animated data)
— RenderingComponent looses the “render” member as rendering commands are queued and postDraw calls are delegated to the renderbin pass

378 Diff Diff IonutCava picture IonutCava Wed 18 Mar, 2015 23:41:44 +0000

[Ionut]
- Continuation of the previous commit

366 Diff Diff IonutCava picture IonutCava Tue 10 Mar, 2015 16:56:30 +0000

[Ionut]
- More type safe enum replacement

364 Diff Diff IonutCava picture IonutCava Fri 06 Mar, 2015 16:55:21 +0000

[Ionut]
- Part 1 of type safe enum replacement (does not compile)

350 IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)