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
glnext-0.8.0.tar.gz
(113.6 kB
view hashes)
Built Distributions
Close
Hashes for glnext-0.8.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 499b4ff07826729ba754ee8b2c34676024922a4a0b831a69ce527b6c878b87d4 |
|
MD5 | d6cb068d9bc0fd6680430a28c6a04ea2 |
|
BLAKE2b-256 | 78952322058407cca099d260301d27964448e98791e6479f791dd6f595f19583 |
Close
Hashes for glnext-0.8.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea9029207274686089e2e0bd4ddc412ae98d4e56d44b948a5ecdb4be7f00b450 |
|
MD5 | 3625e3cb919c1060cc6f8b7b8e1c23b8 |
|
BLAKE2b-256 | 5fc6ea43c1b73ed5c56c618a404fbd847e589b3cbcb2d1b495d923cb9e1ad605 |
Close
Hashes for glnext-0.8.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51dfd53e61929374028eca39c46729ca6866debd2d288467cda19ada072f2a69 |
|
MD5 | fecc5b72a59aafc427ac77075af6d6a2 |
|
BLAKE2b-256 | 6664ab11a015f3759d34c64873e89fddad165dfb851f8d190d0cef484641c93f |
Close
Hashes for glnext-0.8.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36bfad97b125aba5b85b02307fda6e1ebc7c754026c598c6a55d0b3d4346bd5 |
|
MD5 | 86e5d91ecda326726413a3e51bd5613c |
|
BLAKE2b-256 | 8bd99a258e5d18ee9e4e90b6c5e9d51f1295256ac221886327ead5b8155b35b9 |
Close
Hashes for glnext-0.8.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdaa4085666e050fdafb1f56a24a8e8a183b818aca695df1a9de65bad3ca65dd |
|
MD5 | 192c865a8c81da292a8cb9a2930f5c35 |
|
BLAKE2b-256 | 3786d1fe71e5fb3e6a359bc0c31156ea6c38578f9e22d72f5c21ff44190a8440 |
Close
Hashes for glnext-0.8.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eecc62be626070bdce64fffad2be6087d664fb3b1eb6e6b174edb38ef6410a03 |
|
MD5 | 385ae4016714c475ebb320f25f221946 |
|
BLAKE2b-256 | a39b632830c7851e967dde875e6d05244483d6ffee21e60391008ae01e4b70d5 |
Close
Hashes for glnext-0.8.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f06b19dcafd15c190a2ee8dd4e3661f382a4ded42ded9e91eae0eff403fe4cf |
|
MD5 | a28cdf00a786879450e02b207f663a1f |
|
BLAKE2b-256 | 91b930a9d091268e709d526d3eb504a53cfcde0fa120e57f8b1cfc48576697fd |
Close
Hashes for glnext-0.8.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b99e359c65128fb5dac51167e98e1214dd687675781c51c33059665797287b3b |
|
MD5 | 31360754d4d971b8826d382912be806a |
|
BLAKE2b-256 | 1b864f55a13a453a688ca0cbf58b2a1e87d478a456cb6e171897076b9a2ee1e5 |