Low Level Graphics programming in rust

Are there libraries to handle low-level graphics, so that I can deal directly with pixels?

The reason for this is that I recently learned that graphics can be fully customized through low-level programming to build applications that perform graphics-related functions very efficiently.

For example, zbrush, the famous and most effective sculpting program in its field, deals with low-level graphics to achieve the impressive results that we see from it.
It's just an example to illustrate the importance of low-level graphics programming.

I was also wondering if low-level graphics programming is used to write custom graphics drivers for the graphics card

I also hope that you can suggest some sources for learning low-level graphics programming, its methods and algorithms

Are there libraries to handle low-level graphics, so that I can deal directly with pixels?

There are libraries for putting up a window that you can copy pixels into directly:

However, it is important to understand that high performance generally does not come from writing a program that addresses individual pixels. In most applications, if you want to “ perform graphics-related functions very efficiently”, that means you want to use the GPU, and while you certainly do write programs that operate on pixels (fragment shaders), you do so in a way that is much different from “give me access to the pixels”. GPUs are massively parallel and this demands a different style of programming.

If you want to pursue this direction instead, the obvious choice is wgpu, which gives you a safe, clean Rust API to use the capabilities of your GPU. (There are alternatives that are arguably better in one way or another, but wgpu is definitely the flagship choice.)

I was also wondering if low-level graphics programming is used to write custom graphics drivers for the graphics card

Well, writing drivers is low-level but that doesn't mean it's the same kind of “low-level” as managing pixels. GPUs mostly have proprietary architectures, so “custom drivers” is often more of a reverse-engineering task than a graphics task. In any case, there is rarely reason to write new drivers for performance; it's done either because you work for the GPU maker, or because the GPU maker hasn't written satisfactory drivers for your platform.

I also hope that you can suggest some sources for learning low-level graphics programming, its methods and algorithms

Computer graphics is a huge field, and there isn't one kind of “low-level”, so you have to pick where to start. A classic recommendation if you are new to graphics is Ray Tracing in One Weekend, which will teach you how to write a raytracer, a kind of program that can make images given a definition of the scene as geometric objects. (Your link claims that ZBrush is using ray tracing; I don't know if that's true or speculation/oversimplification.) CPU raytracers are not the path to high-efficiency graphics, but they are a great way to learn how to get from data structures to a semi-realistic picture. Once you have that experience, you will have more concepts with which to ask more specific questions.

I don't know of a specifically Rust recommendation, though. Learn Wgpu will get you started with wgpu but that isn't really teaching you about methods, just about what the parts of a hello-world look like.

9 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.