Skip to content

Instantly share code, notes, and snippets.

# Visualization of particles with gravity
# Adapted from pyopencl example
# Source: http://enja.org/2010/08/27/adventures-in-opencl-part-2-particles-with-opengl/
#
# Refactoring example to show shader usage:
# Uses the x-ray shader found in MeshLab
# Code is a modified version of http://www.pygame.org/wiki/GLSLExample
#
# OpenCL support
# Visualization of particles with gravity
# Adapted from pyopencl example
# Source: http://enja.org/2010/08/27/adventures-in-opencl-part-2-particles-with-opengl/
# Changelog: playing around with OO structures--nothing big
import pyopencl as cl # OpenCL - GPU computing interface
mf = cl.mem_flags
from pyopencl.tools import get_gl_sharing_context_properties
from OpenGL.GL import * # OpenGL - GPU rendering interface