r/GraphicsProgramming

Dx11 first triangle

I'm not sure how you guys feel about triangles around here, but here is my first triangle made in D3D11!!

I'm planning to make a little mini project in DX11 and see how I like it over OpenGL. So far I like it more despite needing 3x the amount of code (mostly boilerplate thankfully) for this beautiful little guy.

I'll probably post more about my little project further down the line. If anyone has any tips on how I should structure a DX11 project over an OpenGL one that's always appreciated.

u/Uiwum — 5 days ago
▲ 18 r/GraphicsProgramming+4 crossposts

My game´s not exactly horror, but it has bit of dark atmosphere in some levels, so maybe it´ll be appreciated here.

Game engine is mine own, that's why this simplistic-retro look.

u/Dante268 — 5 days ago
▲ 670 r/GraphicsProgramming+1 crossposts

From Zero to Understanding Rasterization

u/egehancry — 10 days ago
▲ 81 r/GraphicsProgramming+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

From Zero to Understanding Ray Tracing - Part 3 (reflections)

u/egehancry — 14 days ago
▲ 81 r/GraphicsProgramming+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

Trampoline

XPBD softbody simulation in POPs using Gauss-Seidel @ 60fps and 70 shader passes (can't do substepping in same shader pass)

When TouchDesigner introduced POPs one of the first things I tried making was an xpbd soft-body sim, and it looked like this and this. Since then, I've rewritten it multiple times and watched ten minute-physics' tutorials over and over. Many simulation explosions later, it turned out that my very first solver was (mostly) correct, but I was colouring the graph and building the tet constraints in the wrong way..

Resources:

Ten Minute Physics

Eric Arnebäck's blog

Vivace

XPBD paper + earlier PBD paper from Macklin

u/matigekunst — 14 days ago

How do techniques like bindless rendering (descriptor indexing) on the hardware level?

How do gpus bind 1000 of textures at once, and why was this not possible in the past. Are there resources for that?

reddit.com
u/abocado21 — 14 days ago