50 questions
2
votes
2
answers
104
views
How to maintain scale when rotating?
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 ...
Best practices
0
votes
0
replies
40
views
How to display a lot of line_strips efficiently with ModernGL
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
ModernGL: How can I use a new VBO with my VAO?
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. ...
-1
votes
1
answer
79
views
Problem with Matrix Multiplication in OpenGL Shader Program
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 ...
0
votes
1
answer
249
views
Lock mouse inside window using Python's moderngl_window
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, ...
1
vote
0
answers
430
views
How do I use framebuffer as texture for the next frame in moderngl?
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
How to draw shader / image by data using gpu in moderngl?
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
GUI with Pygame and ModernGL
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
"cannot detect OpenGL context" when using Pygame and moderngl?
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
Python moderngl and PIL with big image (14000x9600) only loads red channel
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
2
answers
2k
views
Creating a context utilizing ModernGL for pygame
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 ...
2
votes
1
answer
974
views
Executing a simple GLSL compute shader with modernGL does not work
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 ...
0
votes
1
answer
803
views
Moderngl: Render VAO with multiple shaders
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 ...
1
vote
1
answer
351
views
Screen appears completely white when using ModernGL and Pygame to render a texture
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), ...
2
votes
0
answers
277
views
MaminGL OpenGL err = 1280 (Invalid Enum) - Animated Plane with Texture
I'm getting invalid enum error using maningl.
I have created an animated wave with video as texture.
Code works well with a short animation of around 5 seconds.
This is the result:
But with more than ...