Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian
VTK
Commits
7673512a
Commit
7673512a
authored
9 years ago
by
Ken Martin
Browse files
Options
Downloads
Patches
Plain Diff
Restore the prior blend func and use the piecewise func range
parent
0ffd410b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
+26
-16
26 additions, 16 deletions
Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
with
26 additions
and
16 deletions
Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
+
26
−
16
View file @
7673512a
...
...
@@ -95,10 +95,10 @@ protected:
virtual
void
RenderPieceDraw
(
vtkRenderer
*
ren
,
vtkActor
*
act
);
// create the table for opacity values
void
BuildOpacityTable
(
vtkPolyData
*
);
void
BuildOpacityTable
();
// create the table for scale values
void
BuildScaleTable
(
vtkPolyData
*
);
void
BuildScaleTable
();
// Description:
// Does the shader source need to be recomputed
...
...
@@ -500,15 +500,13 @@ bool vtkOpenGLPointGaussianMapperHelper::GetNeedToRebuildBufferObjects(
}
//-------------------------------------------------------------------------
void
vtkOpenGLPointGaussianMapperHelper
::
BuildOpacityTable
(
vtkPolyData
*
poly
)
void
vtkOpenGLPointGaussianMapperHelper
::
BuildOpacityTable
()
{
vtkDataArray
*
oda
=
poly
->
GetPointData
()
->
GetArray
(
this
->
Owner
->
GetOpacityArray
());
double
range
[
2
];
oda
->
GetRange
(
range
,
0
);
// if a piecewise function was provided, use it to map the opacities
vtkPiecewiseFunction
*
pwf
=
this
->
Owner
->
GetScalarOpacityFunction
();
pwf
->
GetRange
(
range
);
int
tableSize
=
this
->
Owner
->
GetOpacityTableSize
();
if
(
this
->
OpacityTable
)
...
...
@@ -529,15 +527,13 @@ void vtkOpenGLPointGaussianMapperHelper::BuildOpacityTable(vtkPolyData *poly)
}
//-------------------------------------------------------------------------
void
vtkOpenGLPointGaussianMapperHelper
::
BuildScaleTable
(
vtkPolyData
*
poly
)
void
vtkOpenGLPointGaussianMapperHelper
::
BuildScaleTable
()
{
vtkDataArray
*
oda
=
poly
->
GetPointData
()
->
GetArray
(
this
->
Owner
->
GetScaleArray
());
double
range
[
2
];
oda
->
GetRange
(
range
,
0
);
// if a piecewise function was provided, use it to map the opacities
vtkPiecewiseFunction
*
pwf
=
this
->
Owner
->
GetScaleFunction
();
pwf
->
GetRange
(
range
);
int
tableSize
=
this
->
Owner
->
GetScaleTableSize
();
if
(
this
->
ScaleTable
)
...
...
@@ -571,7 +567,7 @@ void vtkOpenGLPointGaussianMapperHelper::BuildBufferObjects(
poly
->
GetPointData
()
->
HasArray
(
this
->
Owner
->
GetScaleArray
());
if
(
hasScaleArray
&&
this
->
Owner
->
GetScaleFunction
())
{
this
->
BuildScaleTable
(
poly
);
this
->
BuildScaleTable
();
}
else
{
...
...
@@ -597,7 +593,7 @@ void vtkOpenGLPointGaussianMapperHelper::BuildBufferObjects(
poly
->
GetPointData
()
->
HasArray
(
this
->
Owner
->
GetOpacityArray
());
if
(
hasOpacityArray
&&
this
->
Owner
->
GetScalarOpacityFunction
())
{
this
->
BuildOpacityTable
(
poly
);
this
->
BuildOpacityTable
();
}
else
{
...
...
@@ -676,12 +672,21 @@ void vtkOpenGLPointGaussianMapperHelper::BuildBufferObjects(
void
vtkOpenGLPointGaussianMapperHelper
::
RenderPieceDraw
(
vtkRenderer
*
ren
,
vtkActor
*
actor
)
{
// draw polygons
if
(
this
->
Owner
->
GetEmissive
()
!=
0
)
{
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE
);
// additive for emissive sources
}
if
(
this
->
VBO
->
VertexCount
)
{
// save off current state of src / dst blend functions
GLint
blendSrcA
=
GL_SRC_ALPHA
;
GLint
blendDstA
=
GL_ONE
;
GLint
blendSrcC
=
GL_SRC_ALPHA
;
GLint
blendDstC
=
GL_ONE
;
if
(
this
->
Owner
->
GetEmissive
()
!=
0
)
{
glGetIntegerv
(
GL_BLEND_SRC_ALPHA
,
&
blendSrcA
);
glGetIntegerv
(
GL_BLEND_DST_ALPHA
,
&
blendDstA
);
glGetIntegerv
(
GL_BLEND_SRC_RGB
,
&
blendSrcC
);
glGetIntegerv
(
GL_BLEND_DST_RGB
,
&
blendDstC
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE
);
// additive for emissive sources
}
// First we do the triangles or points, update the shader, set uniforms, etc.
this
->
UpdateShaders
(
this
->
Tris
,
ren
,
actor
);
if
(
this
->
UsingPoints
)
...
...
@@ -694,6 +699,11 @@ void vtkOpenGLPointGaussianMapperHelper::RenderPieceDraw(vtkRenderer* ren, vtkAc
glDrawArrays
(
GL_TRIANGLES
,
0
,
static_cast
<
GLuint
>
(
this
->
VBO
->
VertexCount
));
}
if
(
this
->
Owner
->
GetEmissive
()
!=
0
)
{
// restore blend func
glBlendFuncSeparate
(
blendSrcC
,
blendDstC
,
blendSrcA
,
blendDstA
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment