r/GraphicsProgramming

Is a texture more than just an image?

Up until now I thought of textures as images. But when learning about framebuffers, I learned that you can use a renderbuffer for depth/stencil stuff, which led me to think, "okay, you can use a texture for a color buffer, which is like an image, and this new thing called a renderbuffer for depth/stencil, since those aren't just images". But it also said you could also use a texture for depth/stencil, if you really wanted to. Which made me think: "ah, I guess thinking of textures as images was too narrow and it's better to think of textures as a way to hold data that can be sampled from in the shaders." But then I look up the page for textures and it uses the term "image" constantly, which has left me confused...

> A texture is an OpenGL Object that contains one or more images that all have the same image format.

I must be missing some fundamental understanding that's leaving me confused here. Any help??

reddit.com
u/ProgrammingQuestio — 16 hours ago
▲ 485 r/GraphicsProgramming+2 crossposts

Faking infinite vegetation at distance in Unreal Engine with a single 512px texture.

We’ve all run into the issue where Unreal Engine landscapes look gorgeous up close, but completely lose their soul and turn flat near the horizon. Brute-forcing grass density or heavy displacements kills performance, so I spent the last few months looking for a loophole.

I ended up creating DistanceLushGrass, an early-stage, plug-and-apply material function that restores that lost distance depth.

Instead of adding geometry, it uses a spatially aware, temporally stable screen-space noise to hold volumetric detail. Because it relies on a single 512px texture footprint, the performance impact is almost unnoticeable and it works on top of any existing landscape shader.

It’s still a work in progress, but I wanted to share the concept. How do you guys usually handle the "flat distance" curse in your own projects? If anyone has questions about the screen-space noise setup, fire away!

u/RefrigeratorLower894 — 23 hours ago
▲ 15 r/GraphicsProgramming+3 crossposts

CyberVGA update.

I've just finished implementing screen spaced grass effect in my octree renderer.

It works only with materials tagged with "terrain" and it generates and distributes grass blades on the fly using screen spaced 4x4 Bayer Matrix as threshold, for now a hard-coded density parameter, global wind vector for animated sway effect and triangles' UV for screen placement and 1/z information for perspective correction.

What do you think?

u/exp_function — 15 hours ago

Computer Graphics vs Embedded Systems for a Master’s in Germany: Which Has Better Career Prospects?

I’m an IT bachelor’s student planning to pursue a master’s degree in Germany under my university scholarship program or self funding and hopefully work there afterward.

My main interest is computer graphics programming. I’m currently learning C++ and OpenGL, and what attracts me to graphics is precisely the difficult low-level and mathematical side of it. I’m interested in rendering and GPU programming

However, I’m concerned about the job market it's currently very rough. I’ve been considering master’s programs in computer graphics/visual computing, but I could also potentially move toward embedded systems, computer engineering, or software-heavy robotics. Embedded systems also interests me, but graphics is definitely the field I’m more passionate about.

My priority is not really max salary possible . my main concern is getting a first skilled job in Germany after graduation and building a stable long-term career there, my limiter is the 18 months visa deadline I can't stay indefinitely with finding a suitable job for skilled work visa.

For people working in Germany or elsewhere in Europe:

How difficult is it realistically for a new graduate with a relevant master’s degree and good projects to enter graphics programming?

Would a visual computing or graphics-focused master’s significantly limit my fallback options compared with an embedded systems or computer engineering master’s?

Is it realistic to build a profile around graphics while maintaining enough C++/systems/GPU skills to apply to adjacent fields if I cannot find a graphics position immediately?

I’m really interested in answers from people currently working in graphics, embedded systems, robotics, GPU computing, simulation, computer vision, or C++ systems programming in Europe or anyone I just need a different prospective .

reddit.com
u/Klippross — 19 hours ago
▲ 11 r/GraphicsProgramming+2 crossposts

Like Rubik's Cube, but easier: Color Sort in 3D Tower Puzzle

Color Sort in 3D Tower Puzzle is a unique 3D color sorting puzzle and brain teaser that combines rotation mechanics, sliding puzzle elements, and spatial thinking into one addictive experience!

Rotate, slide, and match colored tiles around a cylindrical Tower. Use the empty space to move tiles vertically like in a classic sliding puzzle 15x, while rotating rows to align colors. Sort all tiles so that every vertical column contains only one color, plate or ancient shields.

Give it try and download Color Sort in 3D Tower Puzzle now!

u/Seusoa — 1 day ago

Are buffers attachments? Or are these different concepts?

From the learnopengl.com lesson on framebuffers:

> For a framebuffer to be complete the following requirements have to be satisfied:

> We have to attach at least one buffer (color, depth or stencil buffer).

> There should be at least one color attachment.

> All attachments should be complete as well (reserved memory).

> Each buffer should have the same number of samples.

I'm confused by the first two points. Are these separate concepts? Or overlapping? If the buffer that's attached to satisfy the first requirement is the color buffer, then does this also satisfy the second requirement? in other words, is the color buffer the same as "a color attachment"? Or are those different concepts?

reddit.com
u/ProgrammingQuestio — 21 hours ago
▲ 952 r/GraphicsProgramming+3 crossposts

I made a 3D map of a actual local universe you can fly through using real data from cosmic survey

Hey all. I’ve been working on this for a while and finally put it online, so I’m sharing it here.

It’s called Know the Universe. You fly through the cosmic web: the actual large-scale structure of the nearby universe, with its filaments, voids, and clusters. The galaxies are not procedural or faked. They are ~43,500 real galaxies from the 2MRS redshift survey. I take their RA, Dec, and redshift, convert them to Cartesian megaparsecs with a Hubble-law distance, and that point cloud is what you fly through.

Every dot is a galaxy and we can see up to 1Bn years.

There are a lot of visual settings and shaders to help visualize the cosmic web.

u/SizeEfficient2631 — 2 days ago

Storing SH coefficients. Texture vs Buffer

Very large scenes may require 1000s of SH probes which means a lot of coefficients that need to be stored and read from a pixel shader.

I'm wondering if there is a consensus on the most efficient way to store the coefficients themselves: uncompressed floats in some large array buffer, or as compressed pixels in a texture.

For an order 3 SH we need to store 16 float3 coefficients, which in my mind maps perfectly to a single BC block, so by ordering the 4x4 pixel blocks spatially in a BC6h SF16 texture we get an efficiency of 1 byte per float3 coefficient vs the 4 bytes per coeff for a buffer.

However when using a texture we have to go through the texture sampling hardware. So the question is if it's worth it: does the lower memory bandwidth make up for an additional 16 texture lookups per pixel per sampled probe, or would we get better performance just indexing into a structured buffer?

reddit.com
u/Avelina9X — 1 day ago

Good books with a lot of image explanations to learn

What books can you recommend to buy to learn about computer graphics going from basic to advanced? I find if there is a lot image explanation then just pure text its easier for me to understand.

reddit.com
u/Mariusdotdev — 2 days ago
▲ 28 r/GraphicsProgramming+1 crossposts

I built a GPU-driven voxel engine in C++23 with binary greedy meshing and GPU frustum culling

Hey all,

I've been working on a voxel engine in my free time for about a year now, and figured it's at a point where it's worth sharing.

The core idea is pushing as much work onto the GPU as possible: a compute shader evaluates chunk visibility every frame, pushes visible cached meshes straight into an indirect draw buffer, and kicks off meshing requests for anything not yet cached (rendered the following frame). Meshes themselves come from a binary greedy meshing algorithm that merges contiguous voxel faces into compressed 2-byte quads, backed by a lock-free VRAM mesh cache with FIFO paging.

Some other bits:

  • AZDO rendering: persistent mapped buffers, multi-draw indirect, DSA
  • Triple-buffered indirect command buffer to avoid CPU/GPU write-read conflicts
  • 3D ring buffer for chunk streaming, only loads incoming planes as the camera crosses chunk boundaries, so it never rebuilds the whole volume
  • Pluggable world generation via a ChunkGeneratorStrategy interface
  • DDA-based voxel ray-casting for voxel picking

https://reddit.com/link/1uo83t0/video/5jdp8nqv4gbh1/player

Status/caveats, to be upfront:

  • This is a solo hobby project, developed on and off (it's not production-grade)
  • There are known bugs, and it may not run correctly under every configuration
  • Some of the test suite currently fails — I haven't gotten to fixing everything yet
  • It's currently NVIDIA-only (uses NvOptimusEnablement to force the dGPU on hybrid laptops); other vendors haven't been tested and may not work

If you're curious about any of the implementation details (meshing, culling, cache design, etc.) Repo's here: https://github.com/omar-owis/VoxelEngine

reddit.com
u/GeologistAvailable71 — 2 days ago
▲ 1 r/GraphicsProgramming+1 crossposts

Which Rust libraries should I use for OpenGL engine (beginner)

Hello, I'm totally new in graphics programming, I would like to make a 3D graphics engine in Rust but I d'ont know which library I should use ;

- Glow

- Kiss3D

- Bevy

- GL crate

- Glium

I d'ont know which one choose, if you can give an advice !

Thanks

reddit.com
u/Louloubiwan — 2 days ago
▲ 89 r/GraphicsProgramming+11 crossposts

Progress on my threejs Voxel engine

I've fully redone the engine for my game AresRPG, I aim for an immersive world! this is a browser based MMORPG on Sui

u/Sceat — 3 days ago
▲ 10 r/GraphicsProgramming+1 crossposts

How would you make two raymarched fireballs collide and merge?

Hello, I’m trying to make two raymarched procedural fireballs collide and merge, similar to this Shadertoy fireball: https://www.shadertoy.com/view/WcK3Rt I don’t want to simply overlay two copies; I’d like the fire volumes to feel like they actually affect each other.

Is the right approach to model each fireball as an SDF/density field, duplicate it with two centers, and combine them with smooth union / a contact reaction term? Or is there a better way to think about this?

reddit.com
u/Alternative_Yam_1638 — 2 days ago
▲ 2 r/GraphicsProgramming+1 crossposts

Struggling to clear the framebuffer

Im writing a software renderer in C++ using glm and raylib, and i recently tried to draw a spinning triangle. The problem is that when i launched it the triangle leaves a trail of previously drawn triangles.

https://preview.redd.it/5plfv6kkhbbh1.png?width=804&format=png&auto=webp&s=6d1a6479e6b6c142f7c58572afd62bc904557ba8

I tried to fix it by rasterizing to a framebuffer and then drawing that framebuffer instead of drawing the pixels directly and using ClearBackground to refresh the screen, but doing it that way has still the same problem. ¿Why im having this problem even though im clearing the framebuffer?

EDIT: Now im using textures to draw the pixels to the screen instead of drawing them using DrawRectangle, but it still doesnt work.

This is the code for the rasterizer (sorry for sharing it like this, i havent uploaded this to github yet):

https://pastebin.com/Ns2LiSXv

The header file:

https://pastebin.com/xf5JhqFR

reddit.com
u/Otherwise-Pear2054 — 2 days ago

Nora Kinetics - SFX (Driven Spatially by GPU)

Hi folks! I've made more progress on Nora Kinetics - a physics engine / sandbox that I've been working on for about a year.

I finally finished a song and I've got the SFX working in the way I've been envisioning. I'm hoping you all will have some feedback for it as I continue to tune. It sounds best with headphones!

Under the hood, the little interactive segments are all communicating their position, collision force, etc via compute shaders on the GPU (they are byproducts of the solver).

Basically, the position and collision force of every single segment is known every frame. Another compute shader comes through and quickly sorts them into a priority queue based on how close they are to the camera and how fast their collisions are. This gives a decent balance between letting the player hear lots of movement farther away, but then also hearing collisions closer to the camera. The overall effect is something close to ASMR (I'm hoping) and processing time is about 140μs with 250,000 segments.

The system is highly tunable, so in this video (recorded on my Mac), the segments are sharing a ring buffer with 48 different voices and up to 1000 segments can be making noise per frame. On iPhone, I knock that down to 24 voices and 500 segments to get a good balance of performance and sound.

I'll be posting more videos on my channel here soon! I'm working on a full gameplay walkthrough as well as a "making of" video, showing how the game has changed over the last year.

Thanks for watching!

https://www.youtube.com/@NoraKinetics

u/CodeSamurai — 3 days ago

I hef to ask

Since the graphics libraries are maintained by manufacturers of gpus, eg Nvidia, AMD, PlayStation having their own APIs, what does a person looking to learn how to make a game engine need to look out for?

2.Is it better to learn DirectX over Vulkan. Don’t mind the complexity, but the practicality.

reddit.com
u/Fair_Peach_7840 — 4 days ago

Does anyone know the origin of the term "lerp"?

I'm not looking for what it means (linear interpolation), but rather who coined the term or where it first appeared? Any historical traces or anecdotes?

reddit.com
u/tebjan — 4 days ago