r/opengl • • Mar 07 '15

[META] For discussion about Vulkan please also see /r/vulkan

75 Upvotes

The subreddit /r/vulkan has been created by a member of Khronos for the intent purpose of discussing the Vulkan API. Please consider posting Vulkan related links and discussion to this subreddit. Thank you.


r/opengl • • 6h ago

Setup on Intel Mac without Homebrew

7 Upvotes

Does anyone have a nice way to setup OpenGL for Intel Macs? I feel like it became so much more complicated when Homebrew stopped working.

I'm new to OpenGL and I have tried to puzzle together different tutorials just to understand the general idea. From what I have understood, GLFW and GLAD are kind of necessary, and I guess I should setup with CMake from the beginning. I've heard Xcode is simpler, but I have more experience with VS Code from using Windows. So far I've failed my setup multiple times on both.

I know I can download the library files without Homebrew. I just have a hard time understanding what goes where, and the tutorials contain A LOT of manual setup (and every tutorial does it differently).

And that brings up my next question. What's your routine when setting up a new project? Do you have a base folder that you copy? Do you go through the manual setup process every time? Or is there another easier way that I have missed?

I'm excited to learn OpenGL but the setup is really getting in the way.


r/opengl • • 11h ago

Nurbs on GPU

Post image
5 Upvotes

r/opengl • • 1d ago

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

107 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 • • 2d ago

Ragdoll Physics and Blood Particle System

66 Upvotes

r/opengl • • 2d ago

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

2 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 • • 3d ago

A molecule viewer (first small OpenGL Project)

Thumbnail gallery
23 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 • • 5d ago

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

55 Upvotes

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


r/opengl • • 4d ago

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 • • 5d ago

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

1 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.


r/opengl • • 6d ago

Physics Ball

43 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 • • 7d ago

Raspberry

12 Upvotes

r/opengl • • 7d ago

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

Thumbnail v.redd.it
2 Upvotes

r/opengl • • 9d ago

Opengl mipmaps only work on horizontal surfaces not vertical surfaces.

7 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 • • 10d ago

Reflections in Dark Environments

136 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 • • 11d ago

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

Thumbnail gallery
18 Upvotes

r/opengl • • 13d ago

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 • • 15d ago

Element Interaction System in Helox Engine

87 Upvotes

r/opengl • • 15d ago

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 • • 15d ago

it all started with one triangle

Thumbnail gallery
16 Upvotes

r/opengl • • 16d ago

Game engine in OpenGL

Thumbnail youtu.be
5 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 • • 16d ago

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 • • 16d ago

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 • • 16d ago

Dynamic Reflection System for C# scripts

Thumbnail gallery
7 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 • • 17d ago

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

144 Upvotes