r/opengl

▲ 75 r/opengl

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

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!!!

u/Fishfrothemeditrean — 11 days ago
▲ 81 r/opengl+1 crossposts

it all started with one triangle

Hey guys :)

Last week I was so happy to create my own triangle and see it on the screen. This time I wanted to go further and see what else was possible. I did my homework and experimented with colorful triangles, color interpolation, and squares. 3D shapes like cubes or pyramids were a bit too much for me for now (I saw that vector and matrix multiplication is involved 😰 Maybe something for the future).
So I looked for some small 2D projects I could try to copy to practice my skills. I came across an older post with a style I really liked (“glslViewer” by patriciogonzalezvivo on GitHub). I decided to implement "Game of Life" in a similar style.
To make it more challenging I also added some font rendering using hardcoded bitmaps for the digits. That took quite some time and a lot of sketches on paper 😄
For now I am happy with the result and would love to hear your feedback and recommendations on what I could improve.

A few more details about the project:
- The number in the top left shows the number of “lives”
- The number in the top right shows the number of updates
- The number in the bottom right shows the current time
- I press the "R" key to create a new randomized array
- I press the "U" key to update the game

I would also like to say: a big THANK YOU for letting me join the Triangle Club and for the daily inspiration in this subreddit :)

Triangle Club: I know there aren’t any visible triangles in this project but aren’t all shapes somehow constructed from triangles? I hope you’ll accept this project 😄

For this project I used again glad (OpenGL) and RGFW (GLFW alternative).

u/piiodda — 10 days ago
▲ 129 r/opengl

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

u/Health_engine — 13 days ago
▲ 81 r/opengl+1 crossposts

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.

  • The whole GPU heap is one persistent, coherent-mapped SSBO. A gpu_ptr<T> is a u32 byte offset into it.
  • Every draw gets exactly one root pointer (uniform uint Root). Vertices, matrices and textures are all reached through it.
  • No vertex attributes. The vertex shader pulls data from the heap using gl_VertexID.
  • Bindless textures (ARB_bindless_texture) are stored in the heap as uvec2.
  • One *_shared.h header is compiled as both C++ and GLSL, so no offsets are written by hand in the shaders.

Flat lighting is computed from the dFdx/dFdy of world position, so there are no normals in the vertex data.

The most interesting finding was what GL can't express: bindless only gives you texture+sampler pairs, fixed when the texture is created, and there are no placed resources.

Next up: indirect draws, and roots chosen by the GPU via gl_DrawID.

Repo: https://github.com/theaveasso/jagfx

Feedback welcome, especially on the heap and sync design.

u/gr3yfi5h — 12 days ago
▲ 9 r/opengl

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

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!

u/LittleFurryMonsterId — 12 days ago
▲ 4 r/opengl

GLFL - Unofficial OpenGL Function and Extension Loader

https://preview.redd.it/rkw1e5qzoath1.png?width=609&format=png&auto=webp&s=a6fc9bd8d3658d8e4ab172e3a98c179231eca0a8

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.

reddit.com
u/Renulev — 12 days ago
▲ 6 r/opengl

Dynamic Reflection System for C# scripts

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.

u/yxcvbnm098 — 12 days ago