Hacker News new | past | comments | ask | show | jobs | submit login

Could someone suggest a good book/article(s) about 3d software rendering from scratch. I want to use just plain WIN API or SDL to make let's say a 3d rendered cube. Is "Computer Graphics: Principles and Practice" 2nd edition is all that I need or do you recommend other books?



The suggested site https://LearningOpenGl.com is great and I've seen similar websites for Vulkan and WebGPU.

I also recommend grabbing the suggested book, Real Time Rendering, along. I've found it to be great learning material, having a well detailed chapter dedicated for all the effects used in modern renderers. Works great as a reference though it doesn't have any code samples. Doesn't concern itself too much about API details. In my learning flow, I go through a chapter and try to implement one of the techniques mentioned for the effect; usually referencing one of these web resources.


yeah, I heard about this site. But I need a book about software 3d rendering. I want to build something very simple but without any apis and libraries such as opengl or directx. And Real-Time Rendering 4th chapter is seems like what I need.


I'd be curious to hear others chime in, but I feel like the situation is very similar to this article talking about games. Do you want to get pixels to the screen/file? Shaders and materials (authoring or implementing)? How commercial renderers are organized? My job is mostly using commercial tools, but a lot of us have made toy renderers, read books, and taken classes to reimplement the fundamentals.

It's been awhile, but a few common, imho approachable, sources are:

https://github.com/ssloy/tinyrenderer/wiki - a rasterizer that starts with drawing a line

https://raytracing.github.io/ - a basic raytracer that incrementally adds features

https://www.pbrt.org/ - I've heard good things from people who have gone through the whole book. I haven't taken the dive, but thumbed through it and jumped around.

I wouldn't dismiss realtime stuff, either. Often, the concepts are similar but the feedback loop is much faster. I liked the UE4 docs on shaders talking about pbrt and the simplifications they chose when implementing it. There's a bunch of resources out there. I don't think single source is comprehensive. I say, start with something simple and find resources on specific things you want to know more about.


Let's just say that I want to create text file with 3d coordinates of an object (cube or sphere), and my software renderer shoould read this file and display it on the screen. And I can zoom in/out, change coordinates of vertecies with a mouse, rotate and move it. This cube can be wired or colored and if it wired I want to see which edges are visible and which are not. And to render this cube I want to use only setpixel/drawline functions from win api or sdl. Thanks for the links.


That sounds like a fun challenge. If you're constraining yourself to use as few libraries as possible, I'd go with OBJ [1] for the 3d mesh and PPM [2] for writing images. It's easy to implement a bare bones reader/writer and some OSes (like macOS) can show them in the file browser. Raytracing in One Weekend goes over PPM. There are a bunch of header-only libraries that handle different file formats like stb_image [3]. I usually end up using those when I start dealing with textures or UI elements. I don't use Windows so I haven't used their APIs for projects like this. I'd usually go for imgui or SDL (like you mentioned). tinyracaster, a sibling project of tinyrenderer, touches on those [4]. I liked LazyFoo's SDL tutorial [5]. Good luck!

[1] https://en.wikipedia.org/wiki/Wavefront_.obj_file

[2] https://en.wikipedia.org/wiki/Netpbm#PPM_example

[3] https://github.com/nothings/stb

[4] https://github.com/ssloy/tinyraycaster/wiki/Part-4:-SDL

[5] https://lazyfoo.net/tutorials/SDL/index.php


Yeah, I know about ppm but I didn't know about .obj files. That's great. And sdl is a good crossplatform choice because linux doesn't have similar to win api GDI. Thanks for the links.


I highly recommend this course "3D Graphics Programming from Scratch"[0] to dive into software rendering. It uses the SDL and basically starts from first principles.

https://courses.pikuma.com/courses/learn-computer-graphics-p...


yes. It seems like that is what I looking for, thanks.


This online article series is quite good for Vulkan on Rust: https://hoj-senna.github.io/ashen-aetna/


Seems like some chapters on perspectives is what I need. But I guess I have to buy a book about 3d math for game development.


Try pikuma.com. It covers a complete software renderer from scratch using C and SDL.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: