Hacker News
points by yunnpp 3 days ago | 0 comments
I've learned more graphics writing software rasterizers and ray tracers than using any APIs. If the goal is to teach GPU rendering specifically, then OpenGL is indeed more amenable to teaching than the others. But if the goal is to teach graphics and rendering concepts, then OpenGL et al are just miserable and counter-productive.
[–] FrostKiwi 3 days ago
Disagree. Trying to express all of graphics and rendering through the lens of OpenGL will of course fail and doing 3D rendering itself via raytracing is simply not possible in rasterization focused OpenGL without dirty workarounds. That is obvious.

A fundamental shift in thinking that got me into high performance graphics programming and parallelized image processing, the "Aha" Moment, is being forced to express how to calculate the final pixel independently, without having access to neighboring pixels of the same output buffer, confined to the straight jacket of the fragment shader. OpenGL with it's combination of hand-holding and relative simplicity as compared to Vulkan and limits of a predefined shader pipeline as compared to a pure software implementation is exactly the thing that I needed to get into graphics programming. It's an excellent jump in point I think.

[–] leecommamichael 3 days ago
The way I’m interpreting their post is, you could far more easily teach things like introductory projective geometry without a GPU.
[–] yunnpp 2 days ago
Yes, that is what I meant, thanks.
[–] mvx64 2 days ago
Agree. But compared to the new APIs, OpenGL is better in that regard. I would argue that legacy OpenGL is even better.

You can implement in software whatever you want and just handwave specific parts to GL, like rasterization. The rest of the boilerplate code will be minimal.

In new APIs you are bound to write 100s of lines of boilerplate code to get to the point. In the time you should be learning about barycentric coordinates, you are still learning about descriptor sets. And still, you don't learn about rasterization, texture mapping, clipping, face culling, because they are still fixed pipeline.

The only problem with learning with 100% cpu rendering is that you need some patience before seeing beautiful stuff because you need to learn/implement everything up until that point.

[–] dahart 2 days ago
Unfortunately, the goal with OpengGL is not to teach graphics and rendering concepts. Same goes for DirectX, Vulkan, WebGL, etc. These APIs are being designed primarily for performance, not for ease of learning. For teaching and learning, it’s a great idea to start with rasterization & ray tracing in software first! That can teach you the graphics concepts first, and also provide good motivation to learn a graphics API if you want it to go faster.
[–] throw23423 2 days ago
> I've learned more graphics writing software rasterizers and ray tracers than using any APIs.

Could you recommend any resources for learning that?

[–] yunnpp 2 days ago
For rasterization, I would recommend: https://pikuma.com/courses/learn-3d-computer-graphics-progra...

If the video format is not for you, I would at least follow the contents, then look up the individual pieces. The black book has a number of them: https://www.jagregory.com/abrash-black-book/

For ray tracing, Ray Tracing from the Ground Up: https://www.amazon.in/Ray-Tracing-Ground-Kevin-Suffern/dp/15...

Then people will jump in to say that the PBRT book (https://www.pbrt.org/) is a better or more comprehensive source, and it is true, but my opinion is that From the Ground Up is easier to get started with.