Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michael Migliore
VTK
Commits
08791305
Commit
08791305
authored
Jan 15, 2022
by
Michael Migliore
Browse files
Use texture LOD level 0 when drawing skybox
parent
8ff61aec
Pipeline
#263693
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Rendering/OpenGL2/vtkOpenGLSkybox.cxx
View file @
08791305
...
...
@@ -143,7 +143,7 @@ void vtkOpenGLSkybox::Render(vtkRenderer* ren, vtkMapper* mapper)
" vec3 dirv = vec3(dot(diri,floorRight),
\n
"
" dot(diri,floorPlane.xyz),
\n
"
" dot(diri,floorFront));
\n
"
" vec4 color = texture(actortexture, dirv);
\n
"
" vec4 color = texture
Lod
(actortexture, dirv
, 0.0
);
\n
"
"//VTK::Gamma::Impl
\n
"
);
}
if
(
this
->
Projection
==
vtkSkybox
::
Sphere
)
...
...
@@ -162,7 +162,7 @@ void vtkOpenGLSkybox::Render(vtkRenderer* ren, vtkMapper* mapper)
" dot(diri,floorFront));
\n
"
" float phix = length(vec2(dirv.x, dirv.z));
\n
"
" vec4 color = textureLod(actortexture, vec2(0.5*atan(dirv.x, "
"dirv.z)/3.1415927 + 0.5, atan(dirv.y,phix)/3.1415927 + 0.5),
1
.0);
\n
"
"dirv.z)/3.1415927 + 0.5, atan(dirv.y,phix)/3.1415927 + 0.5),
0
.0);
\n
"
"//VTK::Gamma::Impl
\n
"
);
}
if
(
this
->
Projection
==
vtkSkybox
::
StereoSphere
)
...
...
@@ -182,7 +182,7 @@ void vtkOpenGLSkybox::Render(vtkRenderer* ren, vtkMapper* mapper)
" dot(diri,floorFront));
\n
"
" float phix = length(vec2(dirv.x, dirv.z));
\n
"
" vec4 color = textureLod(actortexture, vec2(0.5*atan(dirv.x, dirv.z)/3.1415927 + "
"0.5, 0.5*atan(dirv.y,phix)/3.1415927 + 0.25 + 0.5*leftEye),
1
.0);
\n
"
"0.5, 0.5*atan(dirv.y,phix)/3.1415927 + 0.25 + 0.5*leftEye),
0
.0);
\n
"
"//VTK::Gamma::Impl
\n
"
);
}
if
(
this
->
Projection
==
vtkSkybox
::
Floor
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment