Renderer idea: express a mesh as an f(x,y.z) function

Any renderer will always render out polygons. So, perhaps rendertime will encrease, if your mesh of vector3s will have more poligons than normal mesh.

Added:

Renderman may render out such mesh of vector3s, but renderman is not ray tracer renderer.

POV-Ray handles mathematical primitives like spheres and superellipsoids. A mesh is not something special: it is nothing more a set of planar surfaces of given extents.

Implicit surfaces could be a very useful addition to Blender, especially for scientific visualization.

Using math to define your surfaces seems like an ideal use for povray,
see: http://paulbourke.net/exhibition/scc5/final.html

edit be sure to look at some of the ones at the bottom of the page and check the short version.

Blender comes with povray render integration - and its possible to mix in your own POV-code into the files blender writes - so perhaps this can work for you.

I should add, that using math to define shapes is really interesting, but IMHO this is just not something blender-internal or cycles will ever support (unless you count using math to define a shape, then tessellating into geometry which could be supported).

This is wrong.
Search for raymarching, sphere tracing, signed distance fields etc and you will see, that the technology already is there to render complex shapes just inside the fragment shader. (see my 2 examples, I sent before).

from the net:
“Iñigo Quílez posted a recent presentation on the techniques used in the<em>

Slisesix (2009) rgba demo. By procedurally generating a distance field representation of the scene, a fast, space-skipping raycast can be performed. Using a distance field representation allows other tricks such as fast AO and soft shadow techniques because information such as the distance and direction of the closest occluders are implicit in the representation.”

This was 2009, in the meantime more complex shapes can be rendered in realtime on the GPU.

OP - that essentially the way POV ray works

They can do that because they had beziers as input.

What the original poster wants is to take any arbitrary triangle mesh as input and turn it into a math function. Now, here the question already is, what should that function look like when evaluated? Should it go through the vertices or should it only approximate them like a CC subdivison? Should a flat polygon be represented as a flat polygon? Should there be anything curved in the function, and if so, what determines what is flat and what is curved?

If you want it all flat and touching all vertices, then a triangle mesh is already a piecewise linear function f(x,y,z) that perfectly matches the requirements and is fast to evaluate.

Nurbs and SubDs and Bezier patches only handle simple interpolations between a set of given static points. The control points that define the mesh are not a mathematical function. Nurbs and SubDs do not define topology. I think it’s a given that when we are talking about a model, we are referring to an array of static control points - not the method used to generate a surface from these points. Saying “its all just math” is ignoring the issue.

Triangle meshes are not expressed as functions. We use math functions to generate some simple primitives, but the function is sampled by a program in order to generate an array of static positions. The resulting model is not a function. POVray uses these functions to sample simple primitives at rendertime, but as far as i know there is no “detailed human character” primitive.

What the original poster is implying is a pure mathematical function, ie no control points. There’s his mesh, and then you press a button and it becomes f(x,y,z,a,b,c…). There’s a huge difference between a simple curve interpolation between point A and B, and a fully detailed character between point A and B. Sure, it’s maybe theoretically possible, but as a previous poster has already mentioned the gigantic equation would probably take up several times more memory than the equivalent mesh model would.

Do you consider a sphere definable by a mathematical function? That requires the specification of a center and a radius. The center and radius are not mathematical functions either. But they become part of a mathematical function when plugged into the sphere equation. Similarly, the control points of a subdivision surface (etc.) become part of a mathematical function when plugged into the maths of subdivision surfaces.

Or to come at it from another direction, any class of function that can describe arbitrary complex surfaces is going to have elements that can separated out and considered as data rather than as part of the function. My feeling is that you are making a distinction based on whether that data is normally created by an artist or not.

What the original poster is implying is a pure mathematical function, ie no control points. There’s his mesh, and then you press a button and it becomes f(x,y,z,a,b,c…).

Okay, here’s what I don’t get. What do you mean by “pure mathematical”. Because, e.g., piecewise functions are absolutely considered standard math, and provide a trivial mechanism for creating a “(x,y,z) = f(u,v)” style function from an arbitrary triangular mesh, or any collection of nurbs patches, or even a combination of both:

Or are you trying to suggest that we are limiting ourselves to e.g. isosurfaces in this discussion?

Whose functions are of the form “n = f(x,y,z)”, where the surface is defined as a collection of points where n is constant. This is also relatively trivial to specify arbitrary complex surfaces with, using voxels for example.

There’s a huge difference between a simple curve interpolation between point A and B, and a fully detailed character between point A and B. Sure, it’s maybe theoretically possible, but as a previous poster has already mentioned the gigantic equation would probably take up several times more memory than the equivalent mesh model would.

My point in bringing all of these things up is that the discussion as it currently stands is extremely ill-defined. The original OP was very hand-wavy about “functions”. My intent was to point out that we already use math functions, and therefore some specificity was in order if he wanted to distinguish his idea from the great deal of literature already out there. For example, what kind of function? And how would such a function be specified?

You are correct to note, however, that at least isosurfaces generally end up using more memory for specifying most complex surfaces. Moreover, it’s a lot trickier to specify things like arbitrary deformations over time, for rendering things like motion blur.

Agreed, see my comment above. I don’t think we’re actually disagreeing.

I was coming at it from a different standpoint, which is that triangles are usually used to approximate things like nurbs, subdivision surfaces, etc. (sculpting aside, not many people model directly with polygons anymore). If the OP’s intent was to find a function that approximates the resulting triangle mesh more simply, why not just refrain from tesselating to triangles in the first place, and use the definitions of nurbs/subdiv/etc. directly? Then it’s not even an approximation, and you get the benefit of less memory usage, etc.

I think any surface that we could model with blender can be described mathematically by a single function using a suitable superposition of orthogonal basis functions that span the space containing the surface. jpeg images are an example of how a seemingly large data set can be approximated efficiently by truncating a list of orthogonal function coefficients in a way that the most significant contributions are used and the rest ignored. Triangular meshes are also an approximation of most surfaces and not intrinsically any more accurate than approximating with, say, a best fit series of Legendre Polynomials.

Expressions like these are used to describe more than just a position of a surface in space, but also to encode electric and magnetic field vectors, probability wave functions of charge carriers in quantum mechanics, field strengths of light in laser cavities, etc. You can add as many variables as you want on top of the x,y & z coordinates, like electron spin, UV map color, whatever you need to model.

Thanks. I really didn’t mean to ruffle your feathers, skw. I know absolutely nothing about this type of thing.

Finding whether a ray “strikes” a surface may or may not take longer with a continuous function representation rather than a table of discreet polygons. That’s a problem for someone else to solve.

That’s a tad condescending. Let me think… Of course a sphere function is a function. But, again, there is a difference between a sphere function and the model of a sphere, its not similar.

A function does not describe arbitrary surfaces ; functions are a specific relation between ordered sets. If that relation is arbitrary, then there is really no function to speak of. Functions may sample or approximate that surface given a set of parameters, like your isosurface example, or simply do a linear interpolation but i don’t think it is correct to say that the functions themselves describe arbitrary surfaces. I mean that’s what modeling is, isn’t it : describing the surface.

Anyhow, this is all in the context of the OP wanting to do away with geometry altogether, so going on about functions defining the in-betweens is just moot.

Okay, here’s what I don’t get. What do you mean by “pure mathematical”.

From the original post :“If I’m correct, meshes are not much more than arrays of vector3s. Nurbs on the other hand are 3D functions based on the spline function that make the face. This makes nurbs much faster at high resolution.
So why don’t we use this in a renderer? Characters for example have a lot of smooth and curvy parts, so it should be relatively easy to calculate a 3D function which can describe an entire character.”

From that post the OP is one of two things : He is either A) completely unaware that nurbs and subDs are routinely used to model characters every day and thought he would share this brilliant discovery with us or B) he is a little unfamiliar with mathematics and thought a character could be easily converted to a f(x) equation where a point could be sampled by solving for x rather than intersecting with static geometry or geometry generated from a static hull.

As far as i can tell most everyone, myself included, understood version B and therefor the discussion went that way.

I don’t think it was ever in question that we already use functions. You seem to have jumped into this discussion arbitrarily deciding that everyone didn’t know what they were or how they were used…

I mean, honestly, what do people think these kinds of surfaces are, if not mathematical descriptions (expressible as functions if you like)?
:confused:

Anyways, this thread has devolved into semantics and posturing, so i’ll let you guys have at it.

It has been tried many times before, and the conclusion typically is that tessellating is easier, faster and more flexible. When using a multiresolution geometry cache, memory consumption is not a problem either.

Also, it’s hard to add arbitrary displacement maps to a complex ray/primitive intersection. Even the arguably most common routine for displacement mapped triangles (http://www.cs.utah.edu/~bes/papers/height/paper.html) ends up doing on-the-fly subdivisions and does not handle vector displacement.

Hasn’t this been solved already?

f(x, y, z) == 42

there is a script to make mesh from a 3D math equations in the addons
but not the opposite!

salutations

Q:Can we model a human body with just a math function?
A:Yes, that is possible.
Q:Can we discuss this?
A:No, let’s talk about triangles.

I would like to point out that the mathematical definition of function is the following:

f(x) = y is defined as the set of pairs { (x[SUB]i[/SUB], y[SUB]i[/SUB]) } with the added condition that if x[SUB]i[/SUB] == x[SUB]j[/SUB] y[SUB]i[/SUB] == y[SUB]j[/SUB] (i.e. no multiple values for the same input value).

which in general has infinite elements so people use more compact definitions like sin.

As far as mathematics is involved, an OBJ file with the coordinates and the indication of how to assemble points into faces is a function :evilgrin: so the original poster question is solved by saying: triangulate the whole surface (getting lots of planes limited by points in space), ensure that there are no coindicent/intersecting faces and call it a day. It is not the kind of function you see in school textbooks but it is a function.