News for hackers. Stuff that matters.
Re:Sphere Rendering by azornathogron on Wednesday June 05, 2024 @02:22AM (#40581901)
GPUs don't rasterise line-by-line like old software renderers, and they basically only know how to rasterise triangles. If you're rendering on GPU then I think the approach in the article is pretty good, despite its apparent complexity.

This is a great series of blog posts about how GPU based rendering is structured (long but excellent if you're interested):

https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...

Part 6 is about rasterisation.

Re:Sphere Rendering by chrisjj on Wednesday June 05, 2024 @03:41PM (#40589555)
> GPUs ... basically only know how to rasterise triangles.

www.shadertoy.com would like a word.

Re:Sphere Rendering by azornathogron on Wednesday June 05, 2024 @06:41PM (#40591476)
Pixel shaders are covered in parts 8 and 9 of the blog series I linked to.

What aspect of shadertoy disagrees with what I wrote?

Re:Sphere Rendering by chrisjj on Wednesday June 05, 2024 @10:26PM (#40592794)
All of it that shows rendering beyond what GPUs "only know".
Re:Sphere Rendering by azornathogron on Thursday June 06, 2024 @02:40AM (#40594266)
I said "rasterisation", not "rendering".

Rasterisation is one specific step of the rendering process (+). GPUs rasterise triangles. If you're writing a software renderer you can include algorithms to directly rasterise other shapes such as circles, which is what started this whole thread. But if you're rendering with a GPU and relying on its built in rasterisation then triangles is where you start, even if circles is what you ultimately want.

(+) It's also possible to render without the rasterisation step at all - for example, a pure ray tracing based renderer doesn't have an explicit rasterisation step as it's normally thought of in graphics terms.

Re:Sphere Rendering by chrisjj on Friday June 07, 2024 @06:46AM (#40607301)
Ah, so you meant the only rasterisation they know is triangles. OK, got you.