1
$\begingroup$

I was wondering what is the reason to implement shapes like spheres with triangles instead of a mathematical equation? This could allow perfectly round spheres and not kind of spherical with some levels of subdivision surface. Not to mention the significant boost in rendering time.

$\endgroup$
  • 1
    $\begingroup$ Lots of misconceptions in your question. Rendering would depend on the final amount of triangles, regardless of generation method. Blender does have NURBS based primitives and they are seldomly used because they present non of the advantages you claim, since at the end of the day those mathematical formulas are still used to generate triangles anyway $\endgroup$ – Duarte Farrajota Ramos Feb 28 '19 at 17:05
  • $\begingroup$ As far as I know PovRay bases its shapes upon equations $\endgroup$ – WhatAMesh Feb 28 '19 at 21:05
2
$\begingroup$

Creating an "equation" for rendering non-simple objects, such as a tank model, for instance, is much more difficult, especially when it comes to ray-tracing and shading. While for instance a sphere from an equation would be very simple, a sphere next to a complex object would be difficult, and its better to build complicated meshes out of polygons. The reason you can't have math-based meshes next to polygon-based meshes together is because they use different ways of rendering, as well as to keep everything consistent. This is my understanding of it, anyways, and people can correct me if I am mistaken.

$\endgroup$
2
$\begingroup$

It comes down to the complexity of math involved and to the design of compute hardware:

  • dealing with curved surfaces requires lots of complicated math - intersections of B-splines and Nurbs surfaces can lead to some cubic quartic or even more complicated math. Solution to those equations is not trivial. On the other hand representing planar triangles and lines requires only simple linear algebra.

  • the computer hardware under the surface is very dumb - can basically only add and multiply. Doing linear algebra is very efficient and fast, because it is hardware accelerated by special instructions that take advantage of how transistors and memory in the chip is designed. Doing more complicated math on computer is very slow and often the results are achieved by an iterative approximation method to some degree of precision.

So instead of using the proper math to deal with ideal surfaces and using iteration to get an approximated math solution, we approximate the surfaces instead and get the precise solution in single computation of linear algebra (usually as precise as 32bit floats allow).

Because there is a lot of simple cores that can do such task, we can compute millions of small triangles in real-time, triangles smaller than the pixels on screen.

Computer hardware is full of linear algebra units because it is universal, you can use it to do any task. A specialized unit that solves a cubic equation would not be utilized every time and would also occupy more space on the chip, but it would do the task much faster than a unit that computes linear equations. Today we start seeing some specialized hardware to accelerate non-linear tasks, like RT cores (does intersections of rays with BVH trees) or tensor cores (does inferencing of neural networks)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.