ManimCommunity / ManimCommunity/manim
Depth testing issue where it shouldn't happen
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
Description of bug / unexpected behavior
An OpenGLLine and an OpenGLSurface don't work together as they should even though depth_test=True is passed to both.
Expected behavior
The green line in the example should be seen in total with the exception of the origin. When moving the camera around you can see other angles where the line is indeed completely above.
How to reproduce the issue
class SimpleSurface(Scene):
def construct(self):
frame = self.renderer.camera
frame.set_euler_angles(theta=-30*DEGREES, phi=70*DEGREES)
axes = ThreeDAxes()
line = OpenGLLine(LEFT*5, RIGHT*5, depth_test=True)
line2 = OpenGLLine(UP*5, DOWN*5, depth_test=True)#.shift(OUT*0.5)
line2.set_stroke(color=GREEN, width=8)
saddle = OpenGLSurface(
lambda u,v: axes.c2p(
u*np.cos(v),
u*np.sin(v),
0.2*u*u*np.cos(2*v)
),
u_range=[0, 3],
v_range=[0, 2*PI],
color=BLUE_E,
depth_test=True
)
saddle.mesh = OpenGLSurfaceMesh(saddle, depth_test=True)
saddle.mesh.set_stroke(WHITE, 1, opacity=1)
self.play(
FadeIn(saddle),
Create(saddle.mesh)
)
self.add(line, line2)
self.interactive_embed()
System specifications
- OS: macOS Big Sur 11.4
- RAM: 8 GB 2133 MHz LPDDR3
- Python version (
python/py/python3 --version): 3.9 - GPU: Intel Iris Plus Graphics 655 1536 MB
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided SimpleSurface reproduction with OpenGLLine, OpenGLSurface, and OpenGLSurfaceMesh, then inspect how depth testing is handled in the OpenGL rendering path. Compare the rendered line and surface from multiple camera angles; done means the green line remains visible except at the origin when depth_test=True is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100