Skip to content

Commit

Permalink
Disable anti-aliasing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndahlquist committed Oct 27, 2020
1 parent 31bd020 commit f933ba1
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pyrender/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, viewport_width, viewport_height, point_size=1.0):
# Scaling needed on retina displays
if sys.platform == 'darwin':
self.dpscale = 2
#print(viewport_width, viewport_height)

self.viewport_width = viewport_width
self.viewport_height = viewport_height
Expand Down Expand Up @@ -237,7 +238,7 @@ def read_color_buf(self):

# Resize for macos if needed
if sys.platform == 'darwin':
color_im = self._resize_image(color_im, True)
color_im = self._resize_image(color_im, False)

return color_im

Expand Down Expand Up @@ -274,7 +275,7 @@ def read_depth_buf(self):

# Resize for macos if needed
if sys.platform == 'darwin':
depth_im = self._resize_image(depth_im)
depth_im = self._resize_image(depth_im, False)

return depth_im

Expand Down Expand Up @@ -324,7 +325,7 @@ def _forward_pass(self, scene, flags):
# Clear it
glClearColor(*scene.bg_color)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glEnable(GL_MULTISAMPLE)
glDisable(GL_MULTISAMPLE)

# Set up camera matrices
V, P = self._get_camera_matrices(scene)
Expand Down Expand Up @@ -1056,13 +1057,13 @@ def _configure_main_framebuffer(self):
# Generate multisample buffer
self._main_cb_ms, self._main_db_ms = glGenRenderbuffers(2)
glBindRenderbuffer(GL_RENDERBUFFER, self._main_cb_ms)
glRenderbufferStorageMultisample(
GL_RENDERBUFFER, 4, GL_RGBA,
glRenderbufferStorage(
GL_RENDERBUFFER, GL_RGBA,
self.viewport_width, self.viewport_height
)
glBindRenderbuffer(GL_RENDERBUFFER, self._main_db_ms)
glRenderbufferStorageMultisample(
GL_RENDERBUFFER, 4, GL_DEPTH_COMPONENT24,
glRenderbufferStorage(
GL_RENDERBUFFER, GL_DEPTH_COMPONENT24,
self.viewport_width, self.viewport_height
)
self._main_fb_ms = glGenFramebuffers(1)
Expand Down Expand Up @@ -1132,7 +1133,7 @@ def _read_main_framebuffer(self, scene, flags):

# Resize for macos if needed
if sys.platform == 'darwin':
depth_im = self._resize_image(depth_im)
depth_im = self._resize_image(depth_im, False)

if flags & RenderFlags.DEPTH_ONLY:
return depth_im
Expand All @@ -1154,7 +1155,7 @@ def _read_main_framebuffer(self, scene, flags):

# Resize for macos if needed
if sys.platform == 'darwin':
color_im = self._resize_image(color_im, True)
color_im = self._resize_image(color_im, False)

return color_im, depth_im

Expand Down

0 comments on commit f933ba1

Please sign in to comment.