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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Xiaowei Li
VTK
Commits
7a0aa2f0
Commit
7a0aa2f0
authored
10 months ago
by
Jaswant Panchumarti (Kitware)
Browse files
Options
Downloads
Patches
Plain Diff
Fix point size bug in charts with GLES 3.0
(cherry picked from commit
b8388a66
)
parent
a4e597d6
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/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
+12
-0
12 additions, 0 deletions
Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
with
12 additions
and
0 deletions
Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
+
12
−
0
View file @
7a0aa2f0
...
...
@@ -73,6 +73,7 @@ void copyColors(std::vector<unsigned char>& newColors, unsigned char* colors, in
const
char
*
myVertShader
=
"in vec2 vertexMC;
\n
"
"uniform mat4 WCDCMatrix;
\n
"
"uniform mat4 MCWCMatrix;
\n
"
"uniform float pointSize;
\n
"
"#ifdef haveColors
\n
"
"in vec4 vertexScalar;
\n
"
"out vec4 vertexColor;
\n
"
...
...
@@ -96,6 +97,7 @@ const char* myVertShader = "in vec2 vertexMC;\n"
"ldistance = tcoordMC.x;
\n
"
"#endif
\n
"
"vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
\n
"
"gl_PointSize = pointSize;
\n
"
"gl_Position = vertex*MCWCMatrix*WCDCMatrix; }
\n
"
;
const
char
*
myFragShader
=
"//VTK::Output::Dec
\n
"
...
...
@@ -623,8 +625,10 @@ void vtkOpenGLContextDevice2D::ReadySBOProgram()
"in vec2 vertexMC;
\n
"
"uniform mat4 WCDCMatrix;
\n
"
"uniform mat4 MCWCMatrix;
\n
"
"uniform float pointSize;
\n
"
"void main() {
\n
"
"vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
\n
"
"gl_PointSize = pointSize;
\n
"
"gl_Position = vertex*MCWCMatrix*WCDCMatrix; }
\n
"
,
// fragment shader
"//VTK::System::Dec
\n
"
...
...
@@ -652,10 +656,12 @@ void vtkOpenGLContextDevice2D::ReadySCBOProgram()
"in vec4 vertexScalar;
\n
"
"uniform mat4 WCDCMatrix;
\n
"
"uniform mat4 MCWCMatrix;
\n
"
"uniform float pointSize;
\n
"
"out vec4 vertexColor;
\n
"
"void main() {
\n
"
"vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
\n
"
"vertexColor = vertexScalar;
\n
"
"gl_PointSize = pointSize;
\n
"
"gl_Position = vertex*MCWCMatrix*WCDCMatrix; }
\n
"
,
// fragment shader
"//VTK::System::Dec
\n
"
...
...
@@ -1040,6 +1046,9 @@ void vtkOpenGLContextDevice2D::DrawPoints(
}
this
->
SetPointSize
(
this
->
Pen
->
GetWidth
());
#ifdef GL_ES_VERSION_3_0
cbo
->
Program
->
SetUniformf
(
"pointSize"
,
this
->
Pen
->
GetWidth
());
#endif
this
->
Storage
->
BufferObjectBuilder
.
BuildVBO
(
cbo
,
positions
,
colors
,
nullptr
,
cacheIdentifier
,
this
->
RenderWindow
);
...
...
@@ -1114,6 +1123,9 @@ void vtkOpenGLContextDevice2D::DrawPointSprites(vtkImageData* sprite, vtkDataArr
}
cbo
->
Program
->
SetUniform4uc
(
"vertexColor"
,
this
->
Pen
->
GetColor
());
}
#ifdef GL_ES_VERSION_3_0
cbo
->
Program
->
SetUniformf
(
"pointSize"
,
this
->
Pen
->
GetWidth
());
#endif
this
->
Storage
->
BufferObjectBuilder
.
BuildVBO
(
cbo
,
positions
,
colors
,
nullptr
,
cacheIdentifier
,
this
->
RenderWindow
);
...
...
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