Coder Social home page Coder Social logo

realitix / vulk Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 3.0 776 KB

Desktop/Android Python game development framework on top of Vulkan API

License: Apache License 2.0

Python 97.17% Shell 0.65% GLSL 2.18%
vulkan python gamedev-library high-performance-computing engine3d

vulk's Introduction

VULK - Vulkan 3d engine

Project status

Build Status Coverage Status

Documentation | API reference | Example of use

What is it ?

Vulk is a 3D engine aimed to provide the best graphical experience with Vulkan API. It is written fully in Python. It depends on C modules for the communication with Vulkan.

What is the project goal ?

  • Easy to use: you don't need to understand Vulkan to use VULK.
  • Modular: every single part of the api must be modular.
  • Full: you shouldn't need to customize core code, it should suits everyone needs.

Documentation

Documentation is builded with mkdocs and the material theme. After each commit, Travis CI builds the documentation and pushes it in the vulk-doc repository. All the documentation is inside the docs/ folder. You can easily contribute to it, it's markdown syntax. Check out the mkdocs documentation.

To build the html documentation (in vulk-doc folder), execute the following commands:

pip install -r requirements.txt
python setup.py doc

API reference

The API documentation is generated after each commit by Travis CI servers into the dedicated repo vulk-api. You can check it here: API reference

API convention

To make a beautiful API documentation, we must respect conventions. Instead of reinventing the wheel with syntax format, we use the Google Style Python Docstrings. Here a complete example: example.

Unit tests

To run the unit tests, execute the following command:

python setup.py test

Dependancies

  • vulkan: Module to communicate with Vulkan SDK
  • pyshaderc: Module to compile GLSL to Spir-V
  • VulkBare: Module which provides helper functions

Stay in touch

You can contact me by opening issue (bug or interesting discussion about the project). If you want a fast and pleasant talk, join the irc channel: #vulk. I'm connected from 9AM to 6PM (France).

vulk's People

Contributors

echelon9 avatar realitix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vulk's Issues

How to create a numpy array of a `UniformBufferObject` that is read in by GLSL layout binding?

I am trying to set up a UniformBufferObject per this tutorial that is supposed to be read in by GLSL via Layout binding.

May I know what is the numpy equivalent of the below struct?

struct UniformBufferObject {
    glm::mat4 model;
    glm::mat4 view;
    glm::mat4 proj;
};

Example, after creating the transformation matrices model, view, and proj like so, what should I do next to convert it to a numpy array(equivalent to struct UniformBufferObject ) that could then be passed to GLSL layout binding?

>>> model = [0.1, 0.1, 0.1, 1, 0.1, 0.1, 0.1, 1, 0.1, 0.1, 0.1, 1, 0.1, 0.1, 0.1, 0,]
>>> view = [0.2, 0.2, 0.2, 1, 0.2, 0.2, 0.2, 1, 0.2, 0.2, 0.2, 1, 0.2, 0.2, 0.2, 0,]
>>> proj = [0.3, 0.3, 0.3, 1, 0.3, 0.3, 0.3, 1, 0.3, 0.3, 0.3, 1, 0.3, 0.3, 0.3, 0,]
>>> modeln = np.asarray(model, dtype= 'f4').reshape(4,4)
>>> viewn = np.asarray(view, dtype= 'f4').reshape(4,4)
>>> projn = np.asarray(proj, dtype= 'f4').reshape(4,4)
>>> modeln
array([[0.1, 0.1, 0.1, 1. ],
       [0.1, 0.1, 0.1, 1. ],
       [0.1, 0.1, 0.1, 1. ],
       [0.1, 0.1, 0.1, 0. ]], dtype=float32)
>>> viewn
array([[0.2, 0.2, 0.2, 1. ],
       [0.2, 0.2, 0.2, 1. ],
       [0.2, 0.2, 0.2, 1. ],
       [0.2, 0.2, 0.2, 0. ]], dtype=float32)
>>> projn
array([[0.3, 0.3, 0.3, 1. ],
       [0.3, 0.3, 0.3, 1. ],
       [0.3, 0.3, 0.3, 1. ],
       [0.3, 0.3, 0.3, 0. ]], dtype=float32)
>>> 

I could not relate uniform.py with this tutorial UniformBufferObject. Appreciate your guidance. Cheers.

Architecture of the 2D API

Spritebatch is now working with full support of texture swapping and texture region.
We can now go to the next level and write a 2D scene manager on top of this Spritebatch.
Of course, such a task is not trivial and must be done with care.

As of all Vulk components, we must keep in mind the rule "API first". Like @kennethreitz like to say, I want a SceneManager for Humans™, not for computer. I totally agree with him and this must be our leitmotiv.

In this issue thread, I will propose a first design and we will see where it goes.
This thread is just a sandbox for ideas.

Can't install

So in realitix/vulkan#20
I was recommended to check this project out, tried to, however, it fails to install in my environment.
https://i.imgur.com/zdRjAw4.png
So, I'm lacking the "apigenerator" module.
I then noticed that the setup does not install the requirements.txt, so I did that with:
py -3.6 -m pip install -r requirements.txt
however that also fails. Here a log piece that contains the problematic part:
https://pastebin.com/7w2qubBR

The bit of German in there says that it can't access the file, due to being opened by another process. Tried completely emptying the temp folder and retrying as well as elevating the process - to no avail.
But long before that it fails on some unicode.

Checked out pyshaderc to find pre-compiled modules but those only go up to Python 3.3.

Should it matter, this is on windows 10 64bit.

pylint: Error with use of update_layout() (no-value-for-parameter)

Image().update_layout() is now defined as:

def update_layout(self, cmd, old_layout, new_layout, src_stage,
                      dst_stage, src_access, dst_access):

Need to ensure all the arguments are provided when calling update_layout() method in vulk.vulkanobject.

************* Module vulk.vulkanobject
E:998,12: No value for argument 'src_stage' in method call (no-value-for-parameter)
E:998,12: No value for argument 'dst_stage' in method call (no-value-for-parameter)
E:998,12: No value for argument 'src_access' in method call (no-value-for-parameter)
E:998,12: No value for argument 'dst_access' in method call (no-value-for-parameter)
E:1004,12: No value for argument 'src_stage' in method call (no-value-for-parameter)
E:1004,12: No value for argument 'dst_stage' in method call (no-value-for-parameter)
E:1004,12: No value for argument 'src_access' in method call (no-value-for-parameter)
E:1004,12: No value for argument 'dst_access' in method call (no-value-for-parameter)
E:1014,12: No value for argument 'new_layout' in method call (no-value-for-parameter)
E:1014,12: No value for argument 'src_stage' in method call (no-value-for-parameter)
E:1014,12: No value for argument 'dst_stage' in method call (no-value-for-parameter)
E:1014,12: No value for argument 'src_access' in method call (no-value-for-parameter)
E:1014,12: No value for argument 'dst_access' in method call (no-value-for-parameter)
E:1019,12: No value for argument 'src_stage' in method call (no-value-for-parameter)
E:1019,12: No value for argument 'dst_stage' in method call (no-value-for-parameter)
E:1019,12: No value for argument 'src_access' in method call (no-value-for-parameter)
E:1019,12: No value for argument 'dst_access' in method call (no-value-for-parameter)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.