Skip to content

Commit ef74158

Browse files
committed
Merge branch 'renderer-work-dan'
2 parents cacc359 + 7a3d367 commit ef74158

15 files changed

+1084
-111
lines changed

src/Interface/Modules/Render/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
2929

3030
SET(Interface_Modules_Render_FORMS
3131
ViewScene.ui
32+
ViewSceneControls.ui
3233
)
3334

3435
SET(Interface_Modules_Render_HEADERS
3536
share.h
3637
ViewScene.h
38+
ViewSceneControlsDock.h
3739
GLWidget.h
3840
GLContext.h
3941
GLContextPlatformCompatibility.h
@@ -51,10 +53,12 @@ SET(Interface_Modules_Render_HEADERS
5153
ES/systems/RenderBasicSys.h
5254
ES/systems/RenderBasicSysTrans.h
5355
ES/systems/RenderColorMapSys.h
56+
ES/systems/RenderColorMapSysTrans.h
5457
)
5558

5659
SET(Interface_Modules_Render_SOURCES
5760
ViewScene.cc
61+
ViewSceneControlsDock.cc
5862
GLWidget.cc
5963
GLContext.cc
6064
QtGLContext.cc
@@ -69,6 +73,7 @@ SET(Interface_Modules_Render_SOURCES
6973
ES/systems/RenderBasicSys.cc
7074
ES/systems/RenderBasicSysTrans.cc
7175
ES/systems/RenderColorMapSys.cc
76+
ES/systems/RenderColorMapSysTrans.cc
7277
)
7378

7479
QT4_WRAP_UI(Interface_Modules_Render_FORMS_HEADERS ${Interface_Modules_Render_FORMS})

src/Interface/Modules/Render/ES/CoreBootstrap.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "systems/RenderBasicSys.h"
3030
#include "systems/RenderBasicSysTrans.h"
3131
#include "systems/RenderColorMapSys.h"
32+
#include "systems/RenderColorMapSysTrans.h"
3233
#include "CoreBootstrap.h"
3334
#include "AssetBootstrap.h"
3435
#include "Core.h"
@@ -114,6 +115,7 @@ class CoreBootstrap : public es::EmptySystem
114115
core.addUserSystem(getSystemName_RenderBasicGeom());
115116
core.addUserSystem(getSystemName_RenderBasicTransGeom());
116117
core.addUserSystem(getSystemName_RenderColorMap());
118+
core.addUserSystem(getSystemName_RenderColorMapTrans());
117119

118120
// --== General ==--
119121

src/Interface/Modules/Render/ES/Registration.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "systems/RenderBasicSys.h"
4141
#include "systems/RenderBasicSysTrans.h"
4242
#include "systems/RenderColorMapSys.h"
43+
#include "systems/RenderColorMapSysTrans.h"
4344

4445
namespace SCIRun {
4546
namespace Render {
@@ -52,6 +53,7 @@ void rendererRegisterAll(CPM_ES_ACORN_NS::Acorn& core)
5253
registerSystem_RenderBasicGeom(core);
5354
registerSystem_RenderBasicTransGeom(core);
5455
registerSystem_RenderColorMap(core);
56+
registerSystem_RenderColorMapTrans(core);
5557

5658
// Register components
5759
core.registerComponent<StaticSRInterface>();

src/Interface/Modules/Render/ES/systems/RenderBasicSysTrans.cc

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class RenderBasicSysTrans :
9696
{
9797
return this->mDepth < di.mDepth;
9898
}
99-
10099
};
101100

102101
void groupExecute(
@@ -287,15 +286,6 @@ class RenderBasicSysTrans :
287286
GL(glBindBuffer(GL_ARRAY_BUFFER, vbo.front().glid));
288287
GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, iboID));
289288

290-
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
291-
bool cullFace = glIsEnabled(GL_CULL_FACE);
292-
bool blend = glIsEnabled(GL_BLEND);
293-
294-
GL(glDepthMask(GL_FALSE));
295-
GL(glDisable(GL_CULL_FACE));
296-
GL(glEnable(GL_BLEND));
297-
GL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
298-
299289
// Bind any common uniforms.
300290
if (commonUniforms.size() > 0)
301291
{
@@ -314,10 +304,14 @@ class RenderBasicSysTrans :
314304

315305
// Disable zwrite if we are rendering a transparent object.
316306
//if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
317-
{
318-
GL(glDepthMask(GL_FALSE));
319-
GL(glDisable(GL_CULL_FACE));
320-
}
307+
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
308+
bool cullFace = glIsEnabled(GL_CULL_FACE);
309+
bool blend = glIsEnabled(GL_BLEND);
310+
311+
GL(glDepthMask(GL_FALSE));
312+
GL(glDisable(GL_CULL_FACE));
313+
GL(glEnable(GL_BLEND));
314+
GL(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
321315

322316
if (rlist.size() > 0)
323317
{

src/Interface/Modules/Render/ES/systems/RenderColorMapSys.cc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ class RenderColorMapSys :
9898
return;
9999
}
100100

101+
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
102+
{
103+
return;
104+
}
105+
101106
// Setup *everything*. We don't want to enter multiple conditional
102107
// statements if we can avoid it. So we assume everything has not been
103108
// setup (including uniforms) if the simple geom hasn't been setup.
@@ -186,11 +191,13 @@ class RenderColorMapSys :
186191

187192
geom.front().attribs.bind();
188193

189-
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
190-
{
191-
GL(glDepthMask(GL_FALSE));
192-
GL(glDisable(GL_CULL_FACE));
193-
}
194+
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
195+
bool cullFace = glIsEnabled(GL_CULL_FACE);
196+
bool blend = glIsEnabled(GL_BLEND);
197+
198+
GL(glDepthMask(GL_TRUE));
199+
GL(glDisable(GL_CULL_FACE));
200+
GL(glDisable(GL_BLEND));
194201

195202
if (rlist.size() > 0)
196203
{
@@ -304,11 +311,18 @@ class RenderColorMapSys :
304311
}
305312
}
306313

307-
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
314+
if (!depthMask)
315+
{
316+
GL(glDepthMask(GL_FALSE));
317+
}
318+
if (cullFace)
308319
{
309-
GL(glDepthMask(GL_TRUE));
310320
GL(glEnable(GL_CULL_FACE));
311321
}
322+
if (blend)
323+
{
324+
GL(glEnable(GL_BLEND));
325+
}
312326

313327
geom.front().attribs.unbind();
314328

0 commit comments

Comments
 (0)