|
|
Le 17-08-15 à 11:31, Bald Eagle a écrit :
> I've been wondering about methods to render and speed up rendering certain
> shapes - notably isosurfaces (IS) and parametric (PAR) surfaces.
>
> It has been pointed out that scertain methods of describing algebraic surfaces,
> such as the polynomial, are fast, compared to IS and PAR.
There is a polynominal, quadric and quartic primitives.
Here's a unit radius cylinder along the X axis defined as a quadric :
quadric{<0, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1}
And this is a cone :
quadric{<-1, 1, 1>, < 0, 0, 0>, < 0, 0, 0>, 0}
Here's a «folium» shape :
quartic
{< 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
0, 0, -3, 0, 0, 0, 0, -3, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0>
}
And a poly (short for polynominal) defining a «glob» :
poly
{5,
<-0.5, 0, 0, -0.5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0>
}
#declare Sinsurf =
poly
{6,
< 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-1116.226, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 18.8496,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, -1, 0>
}
Look at shapesold.inc and shapesq.inc for more examples.
>
> The obvious question is WHY are some of these methods fast and others slow?
>
> Another question I have is: What method is used to determine the fineness of
> subdivision for calculation of the surface? Is it a bailout sort of thing, or
> is there some link to the pixel-coverage, where nothing finer than a pixel is
> calculated?
That's the role of the «accuracy» parameter found in isosurface and
parametric. The max_gradient parameter also play a capital role. The
subdivision is along the tracing ray from the camera outward, possibly
after some reflection or refraction.
There is no sampling between pixels unless antialiasing kicks in.
>
> Finally - considering a long, continued, and current interest in using meshes as
> CSG objects,
>
> Would it be possible / desirable to define an internal mesh-generation method
> for rendering complex, time-consuming shapes?
> It seems like constructing a mesh of smooth triangles would save a lot of
> calculation for the surface (via interpolation)(but I could be wrong) - and
> doing that as an internal function would be MUCH faster than doing it through
> SDL.
Converting an arbitrary shape into a mesh is absolutely not trivial.
Especially if that shape have any overhangs or holes/bubbles in it.
You may want to take a look at meshmaker.inc
Note that there are no general or universal way to make that conversion.
Many shapes demand custom, specific to them, methods, and it may not
always be accurate.
Post a reply to this message
|
|