:orphan: Examples ======== Every example is a plain pygame script, the same file runs on the desktop and in the browser. Run one locally with ``python examples/hello_triangle.py`` from the repository root. Geometry and 3D ~~~~~~~~~~~~~~~ .. raw:: html
GrassGrass CrateCrate Box gridBox grid Wireframe terrainWireframe terrain Bezier surfaceBezier surface ModernGL logoModernGL logo Bezier curvesBezier curves Empty 3dEmpty 3d SSAOSSAO MatcapMatcap CubemapCubemap SSAO from depthSSAO from depth Deferred renderingDeferred rendering Blinn-PhongBlinn-Phong Blinn-Phong instancedBlinn-Phong instanced Blinn-Phong simplifiedBlinn-Phong simplified QuaternionsQuaternions ShadowShadow ReflectionReflection
Simulations ~~~~~~~~~~~ .. raw:: html
Soft body simulationSoft body simulation Particle systemParticle system Game of lifeGame of life Computed fragmentComputed fragment
2D and fullscreen effects ~~~~~~~~~~~~~~~~~~~~~~~~~ .. raw:: html
Hello raymarchingHello raymarching ShadertoyShadertoy FractalFractal Noise functionsNoise functions Gradient backgroundGradient background WaterWater SpritesSprites FontFont BlurBlur
Geometries ~~~~~~~~~~ .. raw:: html
Cube shapeCube shape Sphere shapeSphere shape Uvsphere shapeUvsphere shape Cylinder shapeCylinder shape Point shapePoint shape Facing squareFacing square Facing circleFacing circle Wireframe cubeWireframe cube Wireframe gridWireframe grid Wireframe pointWireframe point
Procedural textures ~~~~~~~~~~~~~~~~~~~ .. raw:: html
BackgroundBackground BrickBrick CheckerChecker VoronoiVoronoi
Rendering basics ~~~~~~~~~~~~~~~~ .. raw:: html
Uniform bufferUniform buffer Instanced renderingInstanced rendering ViewportsViewports BlendingBlending Shader includeShader include Image write checkImage write check Vertex offsetVertex offset Hardcoded cameraHardcoded camera Texture arrayTexture array PickingPicking
Getting started ~~~~~~~~~~~~~~~ .. raw:: html
Hello triangleHello triangle Hello textureHello texture Hello modelHello model Vertex bufferVertex buffer Index bufferIndex buffer PointsPoints
Tutorial ~~~~~~~~ A step by step introduction, from a clear color to a lit, textured, postprocessed scene with a Pillow overlay. .. raw:: html
Tutorial
  1. Hello world
  2. Shader
  3. Camera
  4. Vertex buffer
  5. Uniforms
  6. Multiple objects
  7. Different geometries
  8. Texture
  9. Models and images
  10. Lighting
  11. Multiple programs
  12. Uniform buffer
  13. Shader includes
  14. Postprocessing
  15. Pillow overlay