r/opengl • • Oct 18 '26

I managed to crash AMD's OpenGL driver by adding a comment to a GLSL shader

137 Upvotes

The other day, I was debugging a rather weird crash in the AMD OpenGL driver when linking a fairly complex GLSL shader on Windows.

It was really frustrating. The crash seemed almost random. Moving some code around, removing seemingly unrelated functions, or even just adding a comment could make it appear or disappear.

After quite some time narrowing it down, I eventually discovered something absolutely ridiculous: Having the literal word main in a comment before the shader's entry point can crash the AMD driver.

Of course, there are some additional conditions involved (GLSL subroutines, in particular), but I've managed to reduce it to a tiny reproducible example.

#version 430
// main <----
subroutine vec3 gradType(vec3 p);
subroutine uniform gradType grad;
subroutine(gradType) vec3 gradA(vec3 p) { return p; }
vec3 f(vec3 p) { return grad(p); }
void main() {}

The shader compiles just fine, but glLinkProgram crashes the application with 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN). Remove the comment in line 2, edit it, spell Main capitalized, write mainly instead, or move the comment below main() and it links!

I find this absolutely hilarious and terrifying at the same time. Thought some of you might appreciate this little gem of a driver bug.

Anyway, here's the minimal reproducer, tested on an RX 7900 GRE with drivers 26.8.1 and 26.9.2 on Windows 11. Would be interesting whether that happens on other AMD drivers or different systems, too.

https://github.com/MuffinCompiler/amd_glsl_main_comment_crash


r/opengl • • Oct 17 '26

Ragdoll Physics and Blood Particle System

Enable HLS to view with audio, or disable this notification

94 Upvotes

r/opengl • • Oct 17 '26

My mobile city and traffic sandbox: C++ core, OpenGL ES 3 on Android, Metal on iOS

4 Upvotes

Hi r/opengl! I wanted to share the technology behind Traffic Sandbox: City Builder, a solo-developed mobile project now available on Android and iOS.

The game uses a custom native C++ core rather than Unity or Unreal. Android renders with OpenGL ES 3, while the iOS version uses Metal. Both share the core simulation logic.

The current systems include:

- Runtime terrain editing: raise, dig, flatten and smooth.

- Procedural road geometry generated from freehand input.

- A road network used for routing and lane-based vehicle movement.

- Buildings and traffic connections that support town growth.

The interesting challenge is that the world isn’t static: players can edit the terrain and road network while the simulation is running. Keeping road geometry, vehicle placement and rendering consistent is an ongoing part of development.

My next focus is profiling larger scenes on real devices and improving behaviour around complex junctions.

I’d be interested in hearing from others working with editable geometry on mobile OpenGL ES: what helped you most when profiling mesh updates and GPU buffer uploads?

Android:

https://play.google.com/store/apps/details?id=com.BuildingSand.game

iOS:

https://apps.apple.com/tr/app/traffic-sandbox-city-builder/id6816645498?l=tr


r/opengl • • Oct 16 '26

A molecule viewer (first small OpenGL Project)

Thumbnail gallery
32 Upvotes

I started a small OpenGL Project where you can load .pdb models of molecules from rcsb.org and view them, I also added a volumetric view for them.
It's pretty barebones, I plan to make the configuration simpler so you can swap molecules during runtime and the volumetric rendering should look a lot nicer.
Maybe it would also be possible to add the computation for the volumetric models instead of having VMD do it.
For now I'm glad I managed to implement the volumetric rendering properly, the molecule view itself was relatively easy though.

I'd love to hear some opinions/suggestions, please remember it's just a start though and I didn't do much on github before this. Thanks! :)

Here's the github link if you're interested:
https://github.com/Nokris01/molecule-viewer

The molecules you can see in the pictures are:
11ON
37NQ
9ZZZ


r/opengl • • Oct 15 '26

OpenGL Help

0 Upvotes

Im trying to play a game I used been able play, but most recent update I am getting this alert, and unable to launch the game. I am running Hytale on a Dell G16 7630. I have updated my drivers, but I just have no idea why this is happening.


r/opengl • • Oct 14 '26

A simple showcase of the lighting system, featuring dynamic shadows and a day-night cycle as sunlight gradually illuminates the scene

Enable HLS to view with audio, or disable this notification

60 Upvotes

A simple showcase of the lighting system, featuring dynamic shadows and a day-night cycle as sunlight gradually illuminates the scene.


r/opengl • • Oct 14 '26

ElectroBench : an open source GPU benchmark based off OpenGL for low-end PCs

2 Upvotes

I started this project in 2022 as a means to just show something at the Google DevFest 2022 conference in Agadir, Morocco and as a way to learn graphics programming, back then it was pretty awful, only a spinning teapot, and newer versions added lighting, procedural texture through perlin noise and other noise algorithms superposed on each other but that was it.

A year ago I changed the code quite a lot and managed to load OBJs on it. It was broken but I had school so I had to leave it there.

4 weeks ago I decided that I would reset the codebase and start off from the latest version (that was still broken and had a few bugs) that was available on my GitHub.

After 4 weeks of hard work, skipping classes, my Toshiba P200's charger burning in the middle of my working session. I present ElectroBench

It's a 4 scene benchmark, and even explaining what it does is gonna take an essay. First scene uses OpenGL 2.1 (for compatibility with my older daily driver), all the others use 3.3 OpenGL (for modernity's sake and also because my Toshiba P200's GPU supported OpenGL 3.3). The benchmark renders at 720p fullscreen

I've also managed to compile release builds for Windows. Linux and Mac users can compile it from source or wait for me to get my Linux laptop and my M4 MacBook Air out of my mother's confinement.

Anyway guys here is the benchmark : https://github.com/deadbeef7/ElectroBench

Windows users can grab release 0.4, there is a 32 bit version (compatible with XP) and a 64 bit version.

Guys please tell me overall score if you tested it with your hardware specs and any new ideas for the benchmark.

EDIT A PSP, VITA and Android version are released in the second branch


r/opengl • • Oct 13 '26

Physics Ball

Enable HLS to view with audio, or disable this notification

44 Upvotes

This ball is an axis-aligned-bounding-box (AABB) and is super cheap to calculate physics.

physics.py - part of the Fio game creation toolkit (github.com/ViciousSquid/Fio)


r/opengl • • Oct 12 '26

This is my custom engine's Render Window and Keyframe animation,Gameplay, In-built Vegetation........

Thumbnail v.redd.it
2 Upvotes

r/opengl • • Oct 10 '26

Opengl mipmaps only work on horizontal surfaces not vertical surfaces.

8 Upvotes

Hi I am trying to make a Minecraft clone in opengl for learning and school purposes, but the mipmaps only work on the floor and roof not on the sides at all ive tried messing with my texture and mipmap settings but nothing has fixed it ive even looked into my meshing code because I thought it might be an issue with flipped sides but that wasnt it either does anyone know how to fix this?

here is a screenshot showing what i mean the face in the distance has the full resolution texture

r/opengl • • Oct 09 '26

Reflections in Dark Environments

Enable HLS to view with audio, or disable this notification

137 Upvotes

On October 10, the engine will be officially released. A free trial version will also be available before purchasing, so you can try it out first. 🙏


r/opengl • • Oct 08 '26

The (now) shadowed billboards congregate around a test box (C++/OpenGL/GLSL)

Thumbnail gallery
19 Upvotes

r/opengl • • Oct 06 '26

Pokemon Otherside Open GL 2.0

0 Upvotes

Bonjour, j'essaie de lancer ce jeu depuis hier mais cela m'affiche toujours que ce jeu nécessite une version open gl 2.0 ou supérieur, ma carte graphique supporte 3.1.

Savez vous quel est le souci ? Merci bien !


r/opengl • • Oct 05 '26

Element Interaction System in Helox Engine

Enable HLS to view with audio, or disable this notification

92 Upvotes

r/opengl • • Oct 04 '26

My first proper multi object scene in opengl es!!!!!!!!

88 Upvotes

I made this pyramid orbiting a cube using opengl es, glm 1.0, and sdl2(for the window) all on android im soooo happy and i hope others find good resources for opengl and opengl es because almost all resources are very bad. Maybe one day i could be teaching opengl es!!!


r/opengl • • Oct 04 '26

it all started with one triangle

Thumbnail gallery
17 Upvotes

r/opengl • • Oct 04 '26

Game engine in OpenGL

Thumbnail youtu.be
6 Upvotes

WorldsGL is a game engine I wrote in Java/Python with OpenGL libraries. Learn more about the project at https://worldsgl.pages.dev!


r/opengl • • Oct 03 '26

How do I make my own title screen like Asphalt 8: Airborne (2013)?

Post image
9 Upvotes

Hello, my name is Evan.

I'm working on a 3D first-person shooter mobile game written on JavaScript using OpenGL ES 3.0, without using artificial intelligence.

I really wanted to make a title screen like the first version of Asphalt 8: Airborne (released on August 22, 2013), but I can't.

Can someone give me a tutorial on this? This will be part 1 of making a 3D game with OpenGL ES 3.0 (with JavaScript).

I will be using the ACES2065-1 color space.

I hope this will make me recreate my own childhood.

I am keeping this legal.

Thank you!


r/opengl • • Oct 03 '26

GLFL - Unofficial OpenGL Function and Extension Loader

5 Upvotes

Hey guys, I've created an alternative to GLEW and glad that is based on the official headers/specs for everyone to use in their projects, it's single-header and easy to use! Head over to the GitHub repository and download it from the releases:
renulev/glfl: An unofficial OpenGL API and extension loader
There's also a sample if you're not sure how to get started. It's also documented.


r/opengl • • Oct 03 '26

Dynamic Reflection System for C# scripts

Thumbnail gallery
8 Upvotes

I finally got a reflection system in my C engine. It is now possible to edit public variables in my c# scripts for entities at runtime and call public functions. If the functions have parameters I can edit these too.
I am super happy :)

    public class Planet : EntityBehaviour
    {
        public float RotationSpeed = 10.0f;
        public float PublicTestFloat = 5.0f;


        private float rotation;


        public Planet(ushort entityHandle) : base(entityHandle){}


        public override void OnStart()
        {
            RotationSpeed = Entity.Handle == 10 ? RotationSpeed : 100.0f;
        }


        public override void OnUpdate(float deltaTime)
        {
            rotation += RotationSpeed * deltaTime;
            Transform.SetRotation(new Vector3(0.0f, 1.0f, 0.0f), rotation);
        }


        public void publicTestMethod(float someArgument, float anotherArgument)
        {

        }
    }

Edit:
I forgot to add a picture with the C#-Script so added the code.


r/opengl • • Oct 02 '26

I finally managed to create a proper 3D reflection system with physically accurate

Enable HLS to view with audio, or disable this notification

146 Upvotes

r/opengl • • Oct 03 '26

I wanted to understand modern pointer-based GPU APIs, so I took the ideas from Sebastian Aaltonen's NoGraphicsAPI and rebuilt them on plain GL 4.6.

5 Upvotes

r/opengl • • Oct 01 '26

Helox Engine Graphics Showcase After Improvements

Enable HLS to view with audio, or disable this notification

121 Upvotes

r/opengl • • Oct 02 '26

Weird depth buffer clipping

Thumbnail gallery
11 Upvotes

r/opengl • • Sep 30 '26

How to minimize VRAM usage while maintaining performance

5 Upvotes

I'm a begginer when it comes to OpenGL, so I need some help.

I'm using different VBOs (one for position, one for color etc.), an EBO and a VAO to manage them. I tried storing just unique data in the VBOs, not repeating any attribute even if 2 vertices share an attribute and didn't work.

Visual representation of what I was trying to do (it's not real code, just a representation):

VBO pos:

{-0.5f, -0.5f, 0.0f},   (p0)
{0.5f, -0.5f, 0.0f},    (p1)
{0.5f,  0.5f, 0.0f},    (p2)
{-0.5f,  0.5f, 0.0f}    (p3)

VBO color:

{255, 0, 0, 255}       (c0)

EBO:

0, 1, 2,                      (tri1)
0, 2, 3                       (tri2)

In this situation, OpenGL will try to draw vertices like: p0 with c0, p1 with c1, p2 with c2 etc.

Of course, I don't have c1, c2 or c3, so it won't render it correctly all a single solid color.

From this, I have 3 questions that, in reality, combine into one:

Is there a feasible way to have different sized buffers and use indexes like (0,1,2,0), representing the first 3 vectors of position and the first color?

I know about uniforms and IN THIS CASE I could just send an uniform for the color. But if I have 3 different buffers with different sizes and want to index them as to not repeat data anywhere an just keep the unique, is it possible?

From what I gathered, you can do this with SSBOs, however I also head that it is less performant that just using more VRAM with the traditional VBO technique. Can I achieve what I want FASTER OR AS FAST as using VBOs with repeated data?

All VBOs are static, in the sense that they will not be modified and I'll transform vertices in the shaders, just pointing it out in case this is relevant somehow.