No project description provided
Project description
glnext
High-Performance offscreen rendering for python.
pip install glnext
Examples
import glnext
from glnext_compiler import glsl
from PIL import Image
instance = glnext.instance()
task = instance.task()
framebuffer = task.framebuffer((512, 512))
pipeline = framebuffer.render(
vertex_shader=glsl('''
#version 450
#pragma shader_stage(vertex)
layout (location = 0) in vec2 in_vert;
layout (location = 1) in vec3 in_color;
layout (location = 0) out vec3 out_color;
void main() {
gl_Position = vec4(in_vert, 0.0, 1.0);
out_color = in_color;
}
'''),
fragment_shader=glsl('''
#version 450
#pragma shader_stage(fragment)
layout (location = 0) in vec3 in_color;
layout (location = 0) out vec4 out_color;
void main() {
out_color = vec4(in_color, 1.0);
}
'''),
vertex_format='2f 3f',
vertex_count=3,
)
pipeline.update(
vertex_buffer=glnext.pack([
-0.5, -0.5, 0.0, 0.0, 1.0,
0.5, -0.5, 0.0, 1.0, 0.0,
0.0, 0.5, 1.0, 0.0, 0.0,
])
)
task.run()
data = framebuffer.output[0].read()
img = Image.frombuffer('RGBA', (512, 512), data)
img.save('hello_world.png')
Windows
With up2date drivers the vulkan runtime binaries should already be on your system. Install the vulkan-sdk if needed.
Linux
Install the vulkan-sdk.
apt-get install libx11-dev
Without GPU
This project is compatible with swiftshader. The CI also runs on pure CPU. (Dockerfile)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file glnext-0.8.1.tar.gz
.
File metadata
- Download URL: glnext-0.8.1.tar.gz
- Upload date:
- Size: 113.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c4d673be31329435aee53f835e8bd221f8b707f147720b22910681da8a3c69 |
|
MD5 | a83e97c51b59a699d893eb059e16d960 |
|
BLAKE2b-256 | 91cf00d4c873574699fc62d55ee12d738f9b81b00a823736603402ebe87b5093 |
File details
Details for the file glnext-0.8.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 37.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b72d1148e278f53be46f9290f57367d04c852344edad64702a2a05102217ed2 |
|
MD5 | 6765c0bfd85741c77f66166629f7bd29 |
|
BLAKE2b-256 | 4d7c8f41425be50dee5f158a8a59cd8682eede481f316054af03b299fb26c95c |
File details
Details for the file glnext-0.8.1-cp39-cp39-manylinux1_x86_64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp39-cp39-manylinux1_x86_64.whl
- Upload date:
- Size: 162.0 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1740680b9073e26ff23b9260ee136b500cf6156ea20a46bd54af8bc59768de |
|
MD5 | 226a0e7ec98459a0fbc6dc8f4fc26da8 |
|
BLAKE2b-256 | fba4c08c87ab901f8757f5201ecf817c8bb4bc93ce8135a2a2befc2fff39d5f3 |
File details
Details for the file glnext-0.8.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 37.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0201127b8600b4a005f444d27c9832c450c58a05acd7741e46a84a1309d68ff |
|
MD5 | 9206884574f49b96f0f014095c79734b |
|
BLAKE2b-256 | 323384395de7ce72506a30be4c8e9702119ac1ce2c38e9b6bec84ce0f4ac8679 |
File details
Details for the file glnext-0.8.1-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 162.1 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc54590ca3d63792757913bdcc325267c58cc9d999baea29cbc320233bab8502 |
|
MD5 | 6979a49a284fa824e941d252c0826f23 |
|
BLAKE2b-256 | 650d01e371331dd441462bf44cfdaa2681c096725e0cf89f01fb0e7f76c1b63b |
File details
Details for the file glnext-0.8.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 37.5 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c21d7ce4b8594cd1cd6610e2f133e976e3531384e6227bb3580a5fafd5ecf5 |
|
MD5 | bd307bf41bc32f6ac51719db944618ab |
|
BLAKE2b-256 | e74451388c6ec60310713830295feead2f6b7b62762c87f0528e89476458c0a6 |
File details
Details for the file glnext-0.8.1-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 161.3 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96cf7fe966109d36b961f212ddef1c5f8fdfede6e36cffc43d9bef920effc6e7 |
|
MD5 | 5abe71545b99bb64b11f3988afce9480 |
|
BLAKE2b-256 | c51cbe2a5b7d04fe420830c84cb3bc2e163d7ad4ac78e2ca807eea7272e896fe |
File details
Details for the file glnext-0.8.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 37.5 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c7a6f1e5d3cbfb8c67bcb137f96ce5be2f909a18c82369de44d3305a02ffe2a |
|
MD5 | 0d8a895d73b5688bfb7bb6ac083d239d |
|
BLAKE2b-256 | b3d8ec716169946821587b878518198ce9fe5d4bf35eeec7338e683c9ef96b2f |
File details
Details for the file glnext-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: glnext-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 160.4 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed76d3a0aeedb87fb4f614218b27b3dde3931bd5e16d385ce0decaf6b79ba944 |
|
MD5 | 509e851fcd9475793e7d89b1630102e4 |
|
BLAKE2b-256 | 97cebfa7f1eb7cf233be0c9347757fbb3d6c96dbc7aaa4ba2055e355da4b30b1 |