Skip to main content
2 votes
2 answers
105 views

I've been messing around with OpenGL/ModernGL in Python/Pygame, and after getting my images rendered to the screen, I have been having issues rotating them. I'm aware of the order that I need to ...
0 votes
1 answer
249 views

I'm trying to make an interactive fragment shader using moderngl_window, featuring full 3D camera control. I want to do what pretty much every 3D game does - constrain the cursor to the active window, ...
Best practices
0 votes
0 replies
40 views

I need to display many (a lot) 3d trajectories with modernGL. For now, I chain the trajectories and I create two arrays only (one for all the vertices and one for their colors) that I pass as params ...
-1 votes
1 answer
109 views

According to my understanding of what a VAO is, it acts as a descriptor for the format of vertex data, and if you have vertex buffers that share the same format, you can use the same VAO for both. ...
2 votes
2 answers
2k views

I'm trying to create a pygame software that utilizes shaders from ModernGL. I took the code from the following tutorial on Youtube. However, when I attempt to execute the code, ModernGL raises the ...
-1 votes
1 answer
79 views

I’m currently studying OpenGL with ModernGL. I can render a red cube without any issues using the vertices below and assigning them to a shader program: Red Cube Rendered Here’s the code I used to ...
1 vote
0 answers
430 views

I'm trying to animate Mandelbrot set slow step-by-step appearance. Here is my approximate code for fragment shader: #version 330 uniform sampler2D previousIteration; in vec2 uv; /* from -1 to 1 */ ...
0 votes
0 answers
327 views

So I am working on a raycasting project and first of all I need to know is how to render shader / image using GPU and moderngl on python. import moderngl def noise(size): return [(random.randint(0,...
1 vote
1 answer
2k views

I have recently been learning ModernGL with Python and Pygame. However I cannot work out how to create 2D images (a GUI) ontop of the ModernGL context (do I still use Pygame?) Before when I tried to ...
1 vote
2 answers
2k views

I wrote the simple program below: import pygame as pg import moderngl as mgl import sys class GraphicsEngine: def __init__(self, win_size=(1200,700)): pg.init() self.WIN_SIZE = ...
0 votes
0 answers
370 views

I am trying to load big .png files (~10-16 MB, 14000x9600) with PIL. When I load them into a texture I can only use one color channel (I try 3 or 4 and it tells me it doesn't match in size). The part ...
2 votes
1 answer
974 views

I recently discovered the advantages of compute shaders. However, somehow I couldn't get them to write data correctly. In the minimal example below, I want to use a compute shader to rotate the first ...
1 vote
1 answer
351 views

I am trying to make a minimal Moderngl example of about <150 lines so I can better understand how it works. The issue here is that when I try to render this texture (it is an image of a mushroom), ...
0 votes
1 answer
803 views

I'm doing some stuff with 2D opengl rendering. Is there a way to render a vertex array object but have the data be passed through multiple shaders? For example, a shader that applies a normal map to ...
0 votes
1 answer
567 views

After creating a headless context with ctx = create_context(standalone=True) ctx.viewport = (0, 0, 500, 500) and creating a vertex array, I wish to get the image data of vao.render(). Is there any ...

15 30 50 per page