Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 330 vs 331 for /trunk/Source Code/Rendering/RenderPass/RenderPassCuller.cpp

Diff revisions: vs.
  @@ -18,7 +18,8 @@
18 18 _visibleNodes.clear();
19 19 }
20 20
21 - /// This method performs the visibility check on the given node and all of it's children and adds them to the RenderQueue
21 + /// This method performs the visibility check on the given node and all of it's children
22 + /// and adds them to the RenderQueue
22 23 void RenderPassCuller::cullSceneGraph(SceneGraphNode* const currentNode, SceneState& sceneState) {
23 24 bool renderingLocked = RenderPassManager::getInstance().isLocked();
24 25
  @@ -49,7 +50,8 @@
49 50 }
50 51 }
51 52
52 - void RenderPassCuller::cullSceneGraphCPU(SceneGraphNode* const currentNode, SceneRenderState& sceneRenderState) {
53 + void RenderPassCuller::cullSceneGraphCPU(SceneGraphNode* const currentNode,
54 + SceneRenderState& sceneRenderState) {
53 55 //No point in updating visual information if the scene disabled object rendering
54 56 //or rendering of their bounding boxes
55 57 if (bitCompare(sceneRenderState.objectState(), SceneRenderState::NO_DRAW)) {
  @@ -70,10 +72,14 @@
70 72 //If the current SceneGraphNode isn't visible, it's children aren't visible as well
71 73 skipChildren = true;
72 74 } else {
75 + RenderingComponent* renderingCmp = currentNode->getComponent<RenderingComponent>();
73 76 if (currentStage != SHADOW_STAGE || (currentStage == SHADOW_STAGE &&
74 - (currentNode->getComponent<RenderingComponent>() ? currentNode->getComponent<RenderingComponent>()->castsShadows() : false))){
77 + (renderingCmp ? renderingCmp->castsShadows() : false))) {
75 78 //Perform visibility test on current node
76 - if (node->isInView(sceneRenderState, currentNode, currentStage == SHADOW_STAGE ? false : true)){
79 + if (node->isInView(sceneRenderState,
80 + currentNode,
81 + currentStage == SHADOW_STAGE ? false :
82 + true)) {
77 83 //If the current node is visible, add it to the render queue
78 84 _visibleNodes.push_back(currentNode);
79 85 currentNode->inView(true);
  @@ -96,7 +102,9 @@
96 102
97 103 while (!TraversalStack.Empty() || !QueryQueue.Empty()) {
98 104 //--PART 1: process finished occlusion queries
99 - while (!QueryQueue.Empty() && (ResultAvailable(QueryQueue.Front()) || TraversalStack.Empty())) {
105 + while (!QueryQueue.Empty() &&
106 + (ResultAvailable(QueryQueue.Front()) ||
107 + TraversalStack.Empty())) {
100 108 node = QueryQueue.Dequeue();
101 109 // wait if result not available
102 110 visiblePixels = GetOcclusionQueryResult(node);