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
6d167984
Commit
6d167984
authored
9 years ago
by
Ken Martin
Browse files
Options
Downloads
Patches
Plain Diff
More cleanup and fixes for 2D this time
parent
3d4cf61e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
+54
-18
54 additions, 18 deletions
Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
with
54 additions
and
18 deletions
Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
+
54
−
18
View file @
6d167984
...
...
@@ -166,16 +166,23 @@ void vtkOpenGLPolyDataMapper2D::BuildShaders(
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::Color::Dec"
,
"attribute vec4 diffuseColor;
\n
"
"varying vec4 fcolor;"
);
"varying vec4 fcolor
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::Color::Impl"
,
"fcolor = diffuseColor;"
);
"fcolorVSOutput = diffuseColor;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Dec"
,
"in vec4 fcolorVSOutput[];
\n
"
"out vec4 fcolorGSOutput;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Impl"
,
"fcolorGSOutput = fcolorVSOutput[i];"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::Color::Dec"
,
"varying vec4 fcolor;"
);
"varying vec4 fcolor
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::Color::Impl"
,
"gl_FragData[0] = fcolor;"
);
"gl_FragData[0] = fcolor
VSOutput
;"
);
}
else
{
...
...
@@ -194,31 +201,45 @@ void vtkOpenGLPolyDataMapper2D::BuildShaders(
{
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::TCoord::Dec"
,
"attribute float tcoordMC; varying float tcoordVC;"
);
"attribute float tcoordMC; varying float tcoordVC
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::TCoord::Impl"
,
"tcoordVC = tcoordMC;"
);
"tcoordVCVSOutput = tcoordMC;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Dec"
,
"in float tcoordVCVSOutput[];
\n
"
"out float tcoordVCGSOutput;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Impl"
,
"tcoordVCGSOutput = tcoordVCVSOutput[i];"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::TCoord::Dec"
,
"varying float tcoordVC; uniform sampler2D texture1;"
);
"varying float tcoordVC
VSOutput
; uniform sampler2D texture1;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::TCoord::Impl"
,
"gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVC,0));"
);
"gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVC
VSOutput
,0));"
);
}
else
{
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::TCoord::Dec"
,
"attribute vec2 tcoordMC; varying vec2 tcoordVC;"
);
"attribute vec2 tcoordMC; varying vec2 tcoordVC
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::TCoord::Impl"
,
"tcoordVC = tcoordMC;"
);
"tcoordVCVSOutput = tcoordMC;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Dec"
,
"in vec2 tcoordVCVSOutput[];
\n
"
"out vec2 tcoordVCGSOutput;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::TCoord::Impl"
,
"tcoordVCGSOutput = tcoordVCVSOutput[i];"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::TCoord::Dec"
,
"varying vec2 tcoordVC; uniform sampler2D texture1;"
);
"varying vec2 tcoordVC
VSOutput
; uniform sampler2D texture1;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::TCoord::Impl"
,
"gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVC.st);"
);
"gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVC
VSOutput
.st);"
);
}
}
...
...
@@ -227,16 +248,31 @@ void vtkOpenGLPolyDataMapper2D::BuildShaders(
{
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::PrimID::Dec"
,
"attribute vec4 appleBugPrimID;
\n
"
"varying vec4 applePrimID;"
);
"varying vec4 applePrimID
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
VSSource
,
"//VTK::PrimID::Impl"
,
"applePrimID = appleBugPrimID;"
);
"applePrimIDVSOutput = appleBugPrimID;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::PrimID::Dec"
,
"in vec4 appleBugPrimIDVSOutput[];
\n
"
"out vec4 appleBugPrimIDGSOutput;"
);
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::PrimID::Impl"
,
"appleBugPrimIDGSOutput = appleBugPrimIDVSOutput[i];"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::PrimID::Dec"
,
"varying vec4 applePrimID;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::PrimID::Impl"
,
"int vtkPrimID = int(applePrimID[0]*255.1) + int(applePrimID[1]*255.1)*256 + int(applePrimID[2]*255.1)*65536;"
);
"varying vec4 applePrimID
VSOutput
;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"//VTK::PrimID::Impl"
,
"int vtkPrimID = int(applePrimID
VSOutput
[0]*255.1) + int(applePrimID
VSOutput
[1]*255.1)*256 + int(applePrimID
VSOutput
[2]*255.1)*65536;"
);
vtkShaderProgram
::
Substitute
(
FSSource
,
"gl_PrimitiveID"
,
"vtkPrimID"
);
}
else
{
if
(
this
->
HaveCellScalars
)
{
vtkShaderProgram
::
Substitute
(
GSSource
,
"//VTK::PrimID::Impl"
,
"gl_PrimitiveID = gl_PrimitiveIDIn;"
);
}
}
}
//-----------------------------------------------------------------------------
...
...
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