Metadata-Version: 2.0
Name: demosys-py
Version: 1.0.0
Summary: Modern OpenGL 3.3+ Framework inspired by Django
Home-page: https://github.com/Contraz/demosys-py
Author: Einar Forselv
Author-email: eforselv@gmail.com
Maintainer: Einar Forselv
Maintainer-email: eforselv@gmail.com
License: UNKNOWN
Keywords: opengl,framework,demoscene
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Environment :: MacOS X
Classifier: Environment :: X11 Applications
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia :: Graphics
Classifier: License :: OSI Approved :: ISC License (ISCL)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Dist: Pillow (==5.1.0)
Requires-Dist: PyOpenGL (==3.1.0)
Requires-Dist: PyWavefront (==0.3.2)
Requires-Dist: glfw (==1.6.0)
Requires-Dist: moderngl (==5.2.1)
Requires-Dist: pyrocket (==0.2.5)
Requires-Dist: pyrr (==0.9.2)

|pypi| |travis| |rtd|

demosys-py
==========

A modern OpenGL 3.3+ framework inspired by Django.

+-----------------+-----------------+
| |screenshot1|   | |screenshot2|   |
+-----------------+-----------------+

We mainly support OpenGL 3.3+ forward compatible core profiles (no backwards compatibility).

Originally made for for non-interactive real time graphics combined with music
("real time music videos", see `demoscene <https://en.wikipedia.org/wiki/Demoscene>`__),
but can of course be used for other purposes.

Made for people who enjoy playing around with modern OpenGL without spending lots of
time creating all the tooling to get things up and running.

Creating a project with a spinning cube can be done in less than a minute.
(Assuming you have glfw installed)

.. code-block:: shell

   pip install demosys-py
   demosys-admin createproject myproject
   demosys-admin createeffect myproject/cube

Now edit ``myproject/settings.py`` adding the effect in ``EFFECTS``.

.. code-block:: python

   EFFECTS = (
      'myproject.cube',  # note the comma!
   )

Now run the effect!

.. code-block:: shell

   ./manage.py runeffect myproject.cube

Documentation
-------------

Detailed documentation can be found at readthedocs_.
If anything is unclear or incorrect, please make an issue or make a pull request on github.

Features
--------

- A simple effect system based on python packages
- Well documented
- Supports loading GLTF and obj files/scenes
- Support for the rocket sync-tracker system to create interesting keyframe data (Using pyrocket_)
- Management commands to create new projects and effects
- Convenient wrappers for VAO, Shader, Texture, FBO
- On-the-fly Shader and VAO negotiation of the needed buffer binding
- Runtime re-loading shaders (press R)
- Strict validation in most OpenGL operations with reasonable error feedback
- Time line / Timer support
- A highly pluggable framework
- Support for custom management commands
- Camera and system camera support so we can easily inspect our scene
- Easy resource management system (shaders, textures)
- Supports vertex, fragment and geometry shaders (tessellation is wip)
- A geometry module for quick creation of common mesh/VAO types
- (Experimental audio playback support)

If you are not a fan of using a framework, you can create your own context
and just use the classes in ``demosys.opengl``. These will give you fairly
straight forward ways to use VAOs, Shaders, Textures and FBOs.

Requirements
------------

In order to use the framework it's an advantage to know the following:

- Basic or intermediate Python
- Basic glsl
- Basic matrix math

If you are missing any of these requirements the framework can definitely be used
to learn. Zero/0 lines of code are needed to generate a project with a spinning
cube and you can star poking at things.

Contributing
------------

See `CONTRIBUTING <CONTRIBUTING.md>`__.

Known Issues
------------

If you care about audio..

The sound player an be a bit wonky at times on startup refusing to play
on some platforms. We have tried a few libraries and ended up using
pygame's mixer module. (Optional setup for this)

Audio Requirements:

- As the current position in the music is what all
  draw timers are based on, we need a library that can deliver very accurate value for this.
- Efficient and accurate seeking + pause support
- Some way to extract simple data from the music for visualisation

Libraries
---------

GLFW binaries must also be installed. Get from your favourite location.
Use version 3.2.1 or later.

-  `http://pyopengl.sourceforge.net <http://pyopengl.sourceforge.net/>`__
-  `pyGLFW <https://github.com/FlorianRhiem/pyGLFW>`__ for window and
   context creation + input
-  `PIL/Pillow <https://github.com/python-pillow/Pillow>`__ for texture
   loading
-  https://github.com/adamlwgriffiths/Pyrr for math (uses numpy)

Optional for audio:

-  https://www.pygame.org using the mixer module for music

What inspired us to make this project?
--------------------------------------

- We are old farts from the demoscene
- We love Python
- We were wondering what would be done with OpenGL in Python
- We work a lot with Django and love it

Why not combine ideas from our own demosys written in C++ and Django
making a Python 3 version?

Credits
-------

-  Also thanks to `Attila
   Toth <https://www.youtube.com/channel/UC4L3JyeL7TXQM1f3yD6iVQQ>`__
   for an excellent tutorial on OpenGL in Python.

.. _testdemo: https://github.com/Contraz/demosys-py-test
.. _pyrocket: https://github.com/Contraz/pyrocket
.. |pypi| image:: https://img.shields.io/pypi/v/demosys-py.svg
   :target: https://pypi.python.org/pypi/demosys-py
.. |travis| image:: https://travis-ci.org/Contraz/demosys-py.svg?branch=master
   :target: https://travis-ci.org/Contraz/demosys-py
.. |rtd| image:: https://readthedocs.org/projects/demosys-py/badge/?version=latest
   :target: http://demosys-py.readthedocs.io/en/latest/?badge=latest
.. |screenshot1| image:: https://objects.zetta.io:8443/v1/AUTH_06e2dbea5e824620b20b470197323277/contraz.no-static/gfx/productions/SimLife3.png
.. |screenshot2| image:: https://objects.zetta.io:8443/v1/AUTH_06e2dbea5e824620b20b470197323277/contraz.no-static/gfx/productions/SimLife2.png
.. _readthedocs: http://demosys-py.readthedocs.io/


