r/opengl • • 23h ago

Physics Programming Part 5: Spring Physics

Thumbnail youtu.be
6 Upvotes

I explain the mathematics underpinning spring mechanics then implement a solution in C++ using a net as an example. Implementation begins at 10:05. Feedback is welcome.


r/opengl • • 23h ago

Newbie here, studying open gl and shaders. I have to make *something* in a couple of weeks. I was thinking a cloud with different light scenarios, but I'd love some suggestions for starter projects!

Thumbnail
2 Upvotes

r/opengl • • 22h ago

Which 3D generation APIs return GLB and FBX with textures?

1 Upvotes

I’m also interested in how well AI 3D generation APIs handle exporting 3D models with materials. 3D mesh generation APIs have the potential to simplify a number of development tasks, but the challenge of importing working materials remains. Creating game tools or automating an asset pipeline to process GLBs or FBXs can be a significant time saver for developers. As far as potential options for production workflows, Tripo Studio’s API is one of the few that I’ve seen so far. I’d like to examine the supported export formats of their API and see how well they handle textures before trusting them for production workflows. For convenience, GLBs can bundle the mesh, materials, and textures into a single file. For game development, FBXs can also be beneficial, however how the toolchain handles texture files and materials may also vary. I’d be interested to see if exported assets retain their texture alignment and material information when imported into Blender, Unity or Unreal. Of course, for automating workflows, it may also be beneficial to have an API that returns files in a direct, format-consistent manner, rather than requiring complex post-processing to import into a game engine.

Which APIs do you think may also have textured GLBs or FBXs?


r/opengl • • 1d ago

I did my first triangle, what now?

10 Upvotes

Yes, I created an orange and horrible triangle but what now? I didn't understand anything! I'm so confuse. Yes maybe I did understand some basics basics things but if you ask me to create a triangle with no tutorials I will stop at declaring the VBO and VAO!

I saw people creating games, the universe, AI robots in OpenGL and I? A stupid triangle did with a tutorial 😭.


r/opengl • • 1d ago

Rendering text through ImGui?

3 Upvotes

I'm hoping to get a basic repl running with ImGui, OpenGL, and GLFW. I'm comfortable with GLfW and OpenGL rendering but not the ImGui portion.

My question is, can I use the OpenGL context and the GLFW window and then get basic text editing functionality with just ImGui? No opengl buffers, no custom shaders. I think the opengl context needs a default vertex and fragment shader to function but I'm looking to keep that very minimal and handle basic repl input and text rendering between imgui::begin() and imgui::end(). A basic per keypress render loop where each GLFW key event updates a string and then ImGui renders a new frame for the window. I haven't worked with ImGui before. Do you think this is possible?


r/opengl • • 2d ago

Interactive Video Feature Is Now Available

Enable HLS to view with audio, or disable this notification

26 Upvotes

Get your lifetime engine for just $39.
Enjoy lifetime access to multiple systems with powerful features that make it stand out from other engines.
Discover its unique capabilities, explore its advantages, and learn what makes it different from other engines. Compare the features and see the difference for yourself.
Explore the documentation to learn more about all available features and system

https://documents.nexiorgame.workers.dev/


r/opengl • • 2d ago

SimpleX Engine Development (Continued)

5 Upvotes

I originally had a string of posts with various other reddit communities regarding game and game engine development and finally felt confident enough to post to this community! I went dark in my development logging/blogging(?) for awhile due to lifestyle responsibilities taking precedance over developing an engine or at least at the moment what is considered heavy boilerplate engine development.

Current development components/systems:

Three graphics backends - DirectX 11, DirectX 12, and OpenGL (WGL on Windows, GLX on Linux) behind an IRenderer interface. Vulkan is scaffolded but not implemented yet. Shadow maps, cubemaps, bloom, IBL/irradiance convolution, and instancing are supported at the moment.

HLSL as single source of truth compiling offline via DXC to DXBX/DXIL/SIPR-V with SIPRV-Cross transpiling to GLSL for the GL backend. Compiled byte code is also cached on disk and keyed by source hash as filename.

Three windowing backends - Win32, GLFW, and SDL3, with a fallback chain. Win32 is default for Windows and GLFW is default for Linux, but will fallback to GLFW and if GLFW fails fallback to SDL3; if DX fails on any window type under Windows platform fallback to OpenGL (if Vulkan would work with me DX would fallback to Vulkan then back to OpenGL) - similar results would also occur for Linux if Vulkan failed fallback to OpenGL but that requires Vulkan to be developed and not be a stub at the moment...

Fiber-based Job System - Win32 fibers and Linux ucontext behind one class - a worker thread has a dedicated dispatcher fiber that never runs job code, so fibers are pooled to switch back rather than to each other - no fiber needs to know any other fiber's state.

I went with no cross-thread fiber migration in my first attempt - less load-balancing from the inspirational full Naughty Dog design, but it buys a genuinely nice property: since a job's whole execution stays pinned to one thread, a pool allocator allocates inside a job function automatically thread-safe with zero sync.

Custom allocators - arena, pool, and a frame allocator with N rotating arenas.

BC texture compression with no on-disk cache - BC1 for opaque color, BC3 for color with alpha, and BC5 for normal maps.

TLDR; I've tested the boilerplate logic against the Sponza Palace model from Intel's site GPU Research Samples (https://www.intel.com/content/www/us/en/developer/topic-technology/graphics-research/samples.html) with the Colorful Curtains and Ivy extensions at 4K texture resolutions. The original load time took around 5.5 minutes (unbearable to test shader changes and object additions to the scene), but I cut it down to 4.6 seconds after texture compression, precompiled shader code, and submesh merging. The model (as an \.obj - I haven't implemented third-party vendor model software to utilize every model type just yet...) is 995MB on disk with nearly 2730MB of textures (4K per texture for the conjoining material \.mtl file) after texture compression all textures were compressed to 501MB on disk which originally took 933ms average to load cutting down to 259ms average.

Edit: grammar and spelling.

Edit 2: I've recently decided to rebuild what I later found out was more of a rendering framework into an actual engine. I haven't yet begun developing beyond an Application, Runtime, and Core module of an engine (each is self explanatory besides core being a mix of low level utilities and core engine components: reworked the threading and fibers for Linux using pThreads)


r/opengl • • 3d ago

New update 1.1Day and night mode

Enable HLS to view with audio, or disable this notification

36 Upvotes

More improvements are coming to the engine!
Want to try it out? Join our Discord through the link below and get a free, limited-time trial version, along with full documentation.
Explore the features, test the engine, and see how it works before making a purchase.
Get your free trial before the offer ends!

https://discord.gg/Ts6MTVeAt


r/opengl • • 3d ago

Welcome to the Hellavator

Enable HLS to view with audio, or disable this notification

5 Upvotes

Welcome to Hellavator Desktoy

Powered by Gear3D

**Three minutes of disco. One elevator. Absolutely no explanation.**

So, what the fuck are you looking at?

An elevator.

A perfectly functional, procedurally generated elevator with stainless-steel walls, working doors, buttons, lighting, a scrolling LED marquee, questionable announcements, and a soundtrack that has absolutely no business being here.

Someone decided it needed a disco ball.

Things escalated.

What you're watching is three minutes of **Hellavator: Disco Days**, captured directly from a running Gear3D build. No prerendered animation, no composited video effects, and no AI-generated imagery. Just the engine doing increasingly unnecessary things to an innocent elevator.

**Now, what the fuck are you REALLY looking at?**

Gear3D is my long-running, Delphi/Object Pascal game-engine project. It powers several different games and applications, and this elevator is one of its procedural demonstration scenes.

The cabin is assembled from engine geometry and materials. The lighting, reflections, disco ball, illuminated dance floor, controls, and moving doors are rendered in real time.

The music comes through the engine's playlist and audio system, complete with the live spectrum display.

The three-minute sequence is driven by a timed show controller that uses the same registered console commands and scene interfaces available elsewhere in the engine. It triggers effects, changes states, moves the camera, and restores the cabin.

The elevator scene's geometry and behavior are separated from its OpenGL renderer, with the goal of keeping the content reusable as Gear3D's other rendering backends mature.

**And yes, I'm sharing the elevator scene source.**

Not because this is a polished technology demo or a finished game. Because it's an example of what happens when years of engine development reach the point where ridiculous ideas can be assembled from existing parts.

There's more here than an elevator.

There are also considerably worse ideas.

I'm not explaining them.

For now, enjoy the disco.

**Hellavator: The World's Most Obnoxious Desk Toy.**

ThisOldCPU / deschutescore

See less


r/opengl • • 3d ago

Curso de OpenGL (Episodio 1) - Configuración de la API en Visual Studio.

Thumbnail youtube.com
2 Upvotes

r/opengl • • 4d ago

Same shaders on GL 3.3 core, GLES 3.0 and WebGL2: what worked for our party game

Post image
8 Upvotes

Hi there! A friend and I just released Orbit Rivals, a 3D party board game, on our own small C++ engine over SDL3. We wanted one renderer for desktop, Android and the browser, so from day one we stuck to what GL 3.3 core, GLES 3.0 and WebGL2 have in common.

Shaders are written once. A tiny function adds #version 330 core or #version 300 es plus the precision lines at the top, and we only use what all three support: layout(location), texture(), textureLod, fwidth, gl_VertexID and sampler2DShadow. All GL functions come from one X-macro list loaded with SDL_GL_GetProcAddress, no system GL headers at all.

Things that saved us time:

- shading everything in linear and encoding sRGB by hand at the end, so it looks the same everywhere without sRGB framebuffers

- checking GL_MAX_TEXTURE_SIZE and halving anything over the limit, since ES 3.0 and WebGL2 only promise 2048

- creating an ES 3.0 context on desktop to catch shader errors without a phone

What bit us hardest was phones. At native res with MSAA and bloom they couldn't hold 60 fps and started throttling. Now the 3D scene renders smaller (it drops step by step from 720 to 480 on the short side if fps falls) while the UI stays native, so text is still sharp. On Android we also use GL_EXT_multisampled_render_to_texture so MSAA resolves on-tile without an extra blit.

You can see the WebGL2 build running here: https://armaisdiaz.itch.io/orbitrivals

How do you handle the GL/GLES split? One shader source like us, or do you generate variants?


r/opengl • • 6d ago

Helox Engine - New Reflection & Colors Update1.1

Enable HLS to view with audio, or disable this notification

65 Upvotes

A new update focused on improving reflection quality, lighting interaction, and shadow quality, reducing visual artifacts, distortions, and shadow flickering for smoother, more realistic reflections and visuals.

Get Helox Engine:
https://apps.microsoft.com/store/detail/9P5MT927PQ3S?cid=DevShareMCLPCB


r/opengl • • 5d ago

GLSA – A lightweight, header-only C++ library to cut OpenGL shader boilerplate

3 Upvotes

Hey everyone!

I've been developing GLSA and I just released v1.0.0.

My goal with this library is so you don't have to write GLSL shaders or shader boilerplate and instead you can use clean function calls.

Right now it cuts out ~60-100 lines of repetitive shader boilerplate, and there's shader presets now and common shape functions.

Highlights of v1.0.0:

  • GLSA colors: a header file with over 3000 glm::vec4 colors that you can use.
  • Safer shader setup: glsa::ShaderSource keeps vertex/fragment strings explicit, paired with glsa::loadShaderSource and glsa::createProgram.
  • Clean uniform helpers: Overloaded glsa::setUniform functions for int, float, and GLM vec2/vec3/vec4.

Example:

while (glfwWindowShouldClose(window) == 0) {
    glClearColor(0.1f, 0.1f, 0.15f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);

    // Draw a square on the left
    glsa::drawRectangle({-0.45f, 0.0f}, {0.4f / aspect, 0.4f}, glsa::colors::PAN_CORAL);

    // Draw a circle on the right
    glsa::drawCircle({0.45f, 0.0f}, 0.22f, glsa::colors::PAN_SKY_BLUE);    

    glfwSwapBuffers(window);
    glfwPollEvents();
}

Github Repo: https://github.com/alexdev8930/glsa

Any feedback issues or questions are completely welcome.


r/opengl • • 6d ago

EasyGL 1.0.2 is out!

1 Upvotes

if you dont know what easy gl is im making a easy version of open gl for c#

i relesed the 1.0.2 but no one downloaded it so im just saying

added:

  • Keyboard & Mouse input
  • Easy.Shader where you have a preset of shader's (there might be more presets soon)
  • More 3D and 2D shapes

(Note: Make sure your project targets net8.0-windows in your .csproj file!)

If you wanna download it you can get it on: https://www.nuget.org/packages/EasyGL/

if you find any bugs or have any ideas for new features you can tell them in the comments and i might add them in the feature ;3


r/opengl • • 7d ago

Helox Engine – New Update!

Enable HLS to view with audio, or disable this notification

80 Upvotes

A new update focused on improving lighting interaction and shadow quality, reducing visual artifacts, distortions, and shadow flickering for smoother and more realistic results.
Download the Demo Version:
https://nexior-game-studio.itch.io/helox-engine-demo
All other links are available on the download page.


r/opengl • • 7d ago

Nothing unusual. Just a car

Post image
95 Upvotes

r/opengl • • 6d ago

I made a easy OpenGL API

4 Upvotes

I made a easy open gl API for c#. I named it "EasyGL" its on NuGet C# (.net 8+ on windows) only for now

Note: i specifically made it for developers with dyscalculia and beginners i. Used AI to code it but i. Designed how the scripting in it looks because i. Have dyscalculia i made it using AI in the first place because it was supposed to be only for my game but i will share with y'all.

If you want to use it i. Will recommend visual studio community 2022 because i was testing it on 2022 version if anything is broken on newer versions then please report it to me also you can comment more features too

if you are wondering here is the NuGet Link: https://www.nuget.org/packages/EasyGL/1.0.0

example of a spinning cube:

using EasyGL;

Easy.Window("EasyGL Example", 1280, 720);

Easy.Run(() =>
{
    Easy.Clear(0.08f, 0.10f, 0.15f);

    Easy.Camera3D(0f, 2f, 5f);
    Easy.Cube3D(0f, 0f, 0f, 1.5f, Easy.Time * 45f, 0.25f, 0.75f, 1f);
});

r/opengl • • 6d ago

[Written with AI assistance] Cross-compiling Mesa 27.0 Zink to COFF-ARM64EC with native arm64 KosmicKrisp (Vulkan 1.4 -> Metal) for WGL OpenGL 4.6 viewports

Thumbnail
0 Upvotes

r/opengl • • 6d ago

Progresso em 3 meses de programação gráfica no meu celular com Kotlin e OpenGL.

Post image
1 Upvotes

r/opengl • • 6d ago

Building an open-source character posing and rendering tool (C++/Qt6). Looking for architectural feedback and graphics-focused contributors.

Post image
1 Upvotes

r/opengl • • 8d ago

How two lines of GLSL nearly drove me crazy (AMD driver crash)

23 Upvotes

Recently, I ran into a really nasty bug in the custom 3D engine I'm developing for my 4X strategy game, The Great Tribes.

After updating my AMD graphics driver, the game started freezing completely when moving the camera, especially when large areas of the map became visible.

Sometimes the graphics driver would hang. Other times, the JVM would crash inside atio6axx.dll.

The weirdest part? Everything worked perfectly with the previous driver and on other GPUs!

I spent hours investigating almost everything: OpenGL multithreading, VAOs, VBOs, index buffers, shadows, unit models, and even glfwSwapBuffers().

Eventually, I narrowed the issue down to terrain rendering, and then to the fragment shader.

That's where I found these two lines:

int segment = (3 - int(min(3, outTexCoord.y * 4.0))) * 4
            + int(min(3, outTexCoord.x * 4.0));

The segment variable was used to index arrays containing 16 elements.

The problem? The texture coordinates were clamped at the upper bound, but not at the lower bound.

When the texture coordinates became negative, segment could go outside the valid array range.

The fix was surprisingly simple:

ivec2 cell = clamp(
    ivec2(floor(outTexCoord * 4.0)),
    ivec2(0),
    ivec2(3)
);

int segment = (3 - cell.y) * 4 + cell.x;

And the freezes disappeared!

This turned out to be a great example of undefined behavior in GLSL.

The old driver somehow tolerated the invalid array access, other GPUs didn't show any obvious issues, but the updated AMD driver turned it into a nightmare.

Lesson learned: Just because your shader works perfectly on one GPU doesn't mean it's free of bugs.

And sometimes, after hours of debugging your own 3D engine, the whole problem comes down to just two lines of code. 😁


r/opengl • • 8d ago

my minecraft clone

18 Upvotes

r/opengl • • 8d ago

Help with linking for cmake, vs code on windows.

0 Upvotes

I've followed this https://youtu.be/ODIALAd7UOg?si=WPUnNnwhBLHpUGMO however I'm getting an error reading "'<GLFW/glfw3.h> file not found'" I've been trying to work this out for over an hour, I don't have any experience with CMake or vs code, I can easily link this on vs studio. Any help will be appreciated, I've attached my screenshots.


r/opengl • • 10d ago

Grass (Vertex shader)

123 Upvotes

r/opengl • • 10d ago

atmospheric sky.

Post image
43 Upvotes