realitix / vulk Goto Github PK
View Code? Open in Web Editor NEWDesktop/Android Python game development framework on top of Vulkan API
License: Apache License 2.0
Desktop/Android Python game development framework on top of Vulkan API
License: Apache License 2.0
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.
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)
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.
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.
Introduced in a75390f.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.