logoalt Hacker News

Cutting Up Curved Things

43 pointsby ectoyesterday at 10:34 PM8 commentsview on HN

Comments

joefouriertoday at 2:31 AM

Not go to all “ackchually” but modern GPUs can render in many other ways than rasterising triangles, and they can absolutely draw a cylinder without any tessellation involved. You can use the analytical ray tracing formula, or signed distance fields for a practical way to easily build complex scenes purely with maths: https://iquilezles.org/articles/distfunctions/

Now of course triangles are usually the most practical way to render objects but it just bugs me when someone says something like “Every smooth surface you've ever seen on a screen was actually tiny flat triangles” when it’s patently false, ray tracing a sphere is pretty much the Hello World of computer graphics and no triangles are involved.

Edit: for CADs, direct ray tracing of NURBS surfaces on the GPU exists and lets you render smooth objects with no triangles involved whatsoever, although I’m not sure if any mainstream software uses that method.

show 1 reply
OgsyedIEtoday at 1:50 AM

It is probably useful to mention that many triangulation algorithms that people may think of after a couple minutes of effort without referencing existing work struggle to produce anything reasonable when given a curved object that has spiky points adjacent to curves, such as in the simple case of a cone.

Algorithms that can solve these triangulations with no additional resource usage are widespread nowadays, but they were a tough problem in the 70s and 80s.

The trick is to maximise the minimum angle inside all triangles, so that no triangle has a very small angle, in combination with carefully choosing the starting points for the triangulation.

show 1 reply
ivanjermakovtoday at 11:08 AM

My GPU knows what a cyliner is. Just not in the render pipeline.

aanetyesterday at 11:50 PM

What a beautiful website / blog. Loved the explanation, and the site as well.

Well done!!

<3

show 1 reply