|
|
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> What ho
>
> Here is a slightly more complex example of the brick mesh, with two combined
> pigment functions. If anybody wants a go at it, here's the code (no
> smoothing):
I don't think smoothing is necessary for bricks, since you want some
roughness, but it does mean you need to keep your triangles small to avoid
funny-looking artifacts.
> /* --------- begin SDL --------- */
[CUT]
> object {
> RealBrick(2,1.5,4, 0.5, 50, 10,0.5)
> pigment { color White }
> finish { ambient 0 } }
> /* --------- end SDL --------- */
That's a very minimal texture there, Bill. :) I guess you want to avoid use
of normals, since they slow things down, and tend to look the same at all
distances.
Also, how long is your parsing time? I guess it won't be too bad, if you're
not making hundreds of different bricks. Maybe you can save the mesh to a
file? See
#macro HFCreate_ () in "shapes.inc" for an example.
> All the parameters required can be passed to the macro, except the pigment
> function (I couldn't get it to work for some reason). The macro therefore
> assumes a pre-declared function called fn_brick_surface.
I have vague memories of having problems with something like that, too.
However the manual says:
<Quote>
3.2.1.6.2 Functions and Macros
You can pass functions to macros, how to do this is best explained by an
example:
#macro Foo( Bar, X )
#declare Y = Bar(X);
#declare Z = Bar(Y);
#end
#declare FUNC=function(n){n+2}
Foo(FUNC, 1)
#debug str(Y,5,5)
#debug "n"
#debug str(Z,5,5)
#debug "n"
</Quote>
> It should be noted there is a severe limitation to this technique. Using too
> large a pigment amplitude with too small a curvature radius (rad) can cause
> the surface displacement to diverge too much at the edges, resulting in a
> loss of resolution. This effect is also slightly dependent on the
> resolution setting. Have a play and I'm sure you'll see what I mean...
Your smooth, rounded brick looks like it was cast in concrete to me. Maybe
it does need a normal{} block.
Post a reply to this message
|
|