Back

Implementing a tiny CPU rasterizer (2024)

78 points5 dayslisyarus.github.io
delta_p_delta_x4 hours ago

This is a great resource. Some others along the same lines:

TinyRenderer: https://haqr.eu/tinyrenderer/

ScratchAPixel: https://www.scratchapixel.com/index.html

3D Computer Graphics Programming by Pikuma (paid): https://pikuma.com/courses/learn-3d-computer-graphics-progra...

Ray-tracing:

Ray Tracing in One Weekend: https://raytracing.github.io/

Ray Tracing Gems: https://www.realtimerendering.com/raytracinggems/

Physically Based Rendering, 4th Edition: https://pbr-book.org/

Both:

Computer Graphics from Scratch: https://gabrielgambetta.com/computer-graphics-from-scratch/

I'll also link a comment[1] I made a while back about learning 3D graphics. There's no better teacher than manually implementing the rasterisation and ray-tracing pipelines.

[1]: https://news.ycombinator.com/item?id=46410210#46416135

ggambetta4 hours ago

May I add Computer Graphics From Scratch, which covers both rasterization and raytracing? https://gabrielgambetta.com/computer-graphics-from-scratch/i...

I have to admit I'm quite surprised by how eerily similar this website feels to my book. The chapter structure, the sequencing of the concepts, the examples and diagrams, even the "why" section (mine https://gabrielgambetta.com/computer-graphics-from-scratch/0... - theirs https://lisyarus.github.io/blog/posts/implementing-a-tiny-cp...)

I don't know what to make of this. Maybe there's nothing to it. But I feel uneasy :(

delta_p_delta_x4 hours ago

Ah yes, great book; thanks for pointing it out. Added to the list.

As for similarity, I think the sections you've highlighted are broadly similar, but I can't detect any phrase-for-phrase copy-pasting that is typical of LLM or thesaurus find-replace. I feel that the topic layout and the motivations for any tutorial or course covering the same subject matter will eventually converge to the same broad ideas.

The website's sequence of steps is also a bit different compared to your book's. And most telling, the code, diagrams, and maths in the website are all different (such assets are usually an instant giveaway of plagiarism). You've got pseudocode; the website uses the C++ standard library to a great extent.

If it were me, I might rest a little easier :)

lisyarus2 hours ago

Hi! Blog post author here. I have heard the "Computer Graphics from Scratch" book before, but I haven't read it myself, so it would be quite hard for me to plagiarize it. I guess some similarities are expected when talking about a well-established topic.

Levitating26 minutes ago

I can vouch for scratchapixel, it taught me the basics of 3d projection

gopla3 hours ago

An additional resource on rasterisation, using the scan conversion technique:

https://kristoffer-dyrkorn.github.io/scanline-rasterizer/

nottorp34 minutes ago

With the discrete GPUs pricing themselves out of the consumer space, we may actually need to switch back to software rendering :)

feelamee3 hours ago

> Triangles are easy to rasterize

sure, rasterizing triangle is not so hard, but.. you know, rasterizing rectangle is far far easier

qingcharles2 hours ago

Rasterizing triangles is a nightmare, especially if performance is a goal. One of the biggest issues is getting abutting triangles to render so you don't have overlapping pixels or gaps.

I did this stuff for a living 30 years ago. Just this week I had Deep Think create a 3D engine with triangle rasterizer in 16-bit x86 for the original IBM XT.

nottorp33 minutes ago

> One of the biggest issues is getting abutting triangles to render so you don't have overlapping pixels or gaps. > I did this stuff for a living 30 years ago.

So you did CAD or something like that? Since that matters far less in games.

maximilianburke3 hours ago

…as long as all points are co-planar.