37,987 questions
-2
votes
1
answer
48
views
What is the proper way to switch bindings when drawing multiple objects in OpenGL? [closed]
I am working on a very simple rendering engine to play around in, and it has the following properties:
an array of objects to be rendered
every object has a VBO and EBO, using the exact same format
...
-1
votes
1
answer
88
views
Unable to update float value in GLSL shader from Python
I'm using Python and PYSide6/OpenGL to create a GLSL shader, in this shader I want to have a time component. The boilerplate code for the shader is set up fine, and renders at expected. However I can ...
2
votes
1
answer
95
views
How do I fix the System.AccessViolationException?
I am trying to make a square from triangles using indices and vertices, but when I run the code it says this: System.AccessViolationException: 'Attempted to read or write protected memory. This is ...
Best practices
1
vote
1
replies
130
views
How to pass large arbitrary data to opengl shader
I have an array of simulation states that I want to pass to a fragment shader. In this scenario each state element should result in a pixel on the screen.
In order to decide what the color of the ...
5
votes
1
answer
166
views
Second GLFW window won't render?
I decided to try a dual screen to display the square as a wireframe vs a colored in square:
#include <GLAD/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void ...
Advice
0
votes
3
replies
123
views
I have a custom SDL2 graphical engine and i'd like to go isometric view
I gave a lot of time making a custom sdl2 based graphical engine in c++ and i'd like to move to isometric view rendering. This means being able to display 3d objects and i wonder if I should stick to ...
-3
votes
1
answer
97
views
Should I reorder triangle vertices depending on their position to ensure correct winding (CW/CCW)?
I draw triangles in OpenGL using DrawArrays():
public void DrawTriangle(
Vector2 a,
Vector2 b,
Vector2 c,
ShapeOptions shapeOptions = null)
{
shapeOptions ??= PresentationConsts.Shape....
Advice
0
votes
2
replies
83
views
UI Element Detection
I am implementing a UI library, and I want to implement pixel-perfect hit detection.
For example, if a UI element is a red ellipse, when I click on a red pixel, I want a click event to be emitted; ...
3
votes
2
answers
105
views
Window goes black when enabling GL_DEPTH_TEST?
I have a problem that my window:
// gcc -o minimum main.c -lglut -lGL
#include <stdio.h>
#include <unistd.h>
#include <GL/gl.h>
#include <GL/glut.h>
extern void ...
Advice
0
votes
7
replies
113
views
Polyhedra from its vertices in OpenGL
I'm currently working on Voronoi polyhedra, and I already have software that generates all the vertices for me, but I haven't got any indexes to draw the polyhedra.
I know how to draw polygons and ...
1
vote
1
answer
79
views
QComboBox popup not visible when placed in an overlay over QVTKOpenGLNativeWidget in fullscreen on Windows
I'm embedding a VTK rendering widget inside a Qt 6 app using QVTKOpenGLNativeWidget.
The window contains a QVTKOpenGLNativeWidget used for 3D rendering, wrapped inside a QFrame.
On top of it, a ...
Advice
0
votes
3
replies
162
views
How do I draw a line using triangles in OpenGL?
In my code, I useing draw line to draw model selection line and error edge line ,useing draw triangle to draw 3D model.
Using the model's openmesh handle, edges are recorded and drawn.
...
Advice
1
vote
2
replies
273
views
How do I create a raycast in C++ for a game
I have been making a 3D game from scratch using opengl and C++ and I want to know how I can make a ray casting class in C++ for my game where I can call it when ever I need to, to check for things ...
0
votes
1
answer
123
views
SDL3 + OpenGL in c++ is thowing empty SDL_Init erros when making a window in Wayland [duplicate]
I have installed the packages that I need (as far as I know), and the window throws an empty error when I run it.
Output is:
/home/bence/Programming/cpp/game1/cmake-build-debug/game1
SDL_Init Error:
...
3
votes
2
answers
124
views
What does a min filter do on the same mip level?
In a graphics API like Vulkan, you have VkFilter, which can be NEAREST or LINEAR. Leaving aside the mipmap filtering, which is another thing altogether, I'm trying to understand what the point of the ...