POV-Ray : Newsgroups : povray.binaries.images : Bricks Library Example (wip) Server Time
27 Apr 2024 05:52:32 EDT (-0400)
  Bricks Library Example (wip) (Message 1 to 4 of 4)  
From: Chris R
Subject: Bricks Library Example (wip)
Date: 12 Jan 2024 09:45:00
Message: <web.65a14f4a7b00538217021f505cc1b6e@news.povray.org>
I took a little break developing the brick library to start a scene using it.
In all of my code-development life, I have found that creating libraries has to
be a constant interplay of creating the abstraction, using it, and then fine
tuning it for new use cases.

This scene shows a corner of a brick garden wall using the English Bond layout.
There are a total of 4 isosurfaces: one for the bricks on each wall, and one for
the mortar on each wall.

The library system takes care of generating the isosurface functions based on
various inputs, including:
   - Wall dimensions (length, number of courses, half-brick thickness)
   - Wall end types (flush or corner)
   - Brick and mortar sizes
   - Brick shape function

The system then generates a dictionary called a "Layout" that includes functions
that given an <x,y,z> coordinate figure out the origin (left, bottom, front
corner) of the brick/mortar containing that point, the size of the brick, and an
ordinal index into the wall for that brick.  The system uses these to generate
the isosurface functions, but they are also available for the modeler to use for
other purposes.

While creating this scene I decided to add some jitter to the brick locations to
keep them from lining up in an abnormally perfect way.  Originally I took the
isosurface function generated by the system for the bricks and wrapped it in
another function that added some noise to the position, but used the brick
origin functions in the layout so that the noise would be the same for all
points in the brick.  I quickly discovered that I needed to apply this same
jitter to the mortar isosurface function so the mortar joints would line up
correctly, and I needed it for the texture utility that ensures that bricks can
have random textures, but a single brick texture is smooth and consistent.  So,
I decided to add jitter as a first class element of the system.

There is still a fair amount of modeling code beyond calls to the system macros
for this scene.  Most of it is adapting the system's supplied brick shape
functions and mortar joint functions by adding textural noise to them, including
the cracks, as well as defining the textures for the bricks and the mortar.

I plan to develop this scene further and keep it as an example when I eventually
publish the brick library code.  I'm still working out the best way to do that.
I am finding I have to clean up a lot of library code I use so that it doesn't
end up pulling in my entire POV modeling tree.


-- Chris R.
-- Happily rendering since 2014


Post a reply to this message


Attachments:
Download 'corner_v2_2024-01-11.png' (845 KB)

Preview of image 'corner_v2_2024-01-11.png'
corner_v2_2024-01-11.png


 

From: 19100
Subject: Re: Bricks Library Example (wip)
Date: 12 Jan 2024 11:10:00
Message: <web.65a1634f880c46f4c37391ebedfc8715@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> I took a little break developing the brick library to start a scene using it.
> In all of my code-development life, I have found that creating libraries has to
> be a constant interplay of creating the abstraction, using it, and then fine
> tuning it for new use cases.
>
> This scene shows a corner of a brick garden wall using the English Bond layout.
> There are a total of 4 isosurfaces: one for the bricks on each wall, and one for
> the mortar on each wall.
>
> The library system takes care of generating the isosurface functions based on
> various inputs, including:
>    - Wall dimensions (length, number of courses, half-brick thickness)
>    - Wall end types (flush or corner)
>    - Brick and mortar sizes
>    - Brick shape function
>
> The system then generates a dictionary called a "Layout" that includes functions
> that given an <x,y,z> coordinate figure out the origin (left, bottom, front
> corner) of the brick/mortar containing that point, the size of the brick, and an
> ordinal index into the wall for that brick.  The system uses these to generate
> the isosurface functions, but they are also available for the modeler to use for
> other purposes.
>
> While creating this scene I decided to add some jitter to the brick locations to
> keep them from lining up in an abnormally perfect way.  Originally I took the
> isosurface function generated by the system for the bricks and wrapped it in
> another function that added some noise to the position, but used the brick
> origin functions in the layout so that the noise would be the same for all
> points in the brick.  I quickly discovered that I needed to apply this same
> jitter to the mortar isosurface function so the mortar joints would line up
> correctly, and I needed it for the texture utility that ensures that bricks can
> have random textures, but a single brick texture is smooth and consistent.  So,
> I decided to add jitter as a first class element of the system.
>
> There is still a fair amount of modeling code beyond calls to the system macros
> for this scene.  Most of it is adapting the system's supplied brick shape
> functions and mortar joint functions by adding textural noise to them, including
> the cracks, as well as defining the textures for the bricks and the mortar.
>
> I plan to develop this scene further and keep it as an example when I eventually
> publish the brick library code.  I'm still working out the best way to do that.
> I am finding I have to clean up a lot of library code I use so that it doesn't
> end up pulling in my entire POV modeling tree.
>
>
> -- Chris R.
> -- Happily rendering since 2014

Looking quite realistic so far, very good!


Post a reply to this message

From: s day
Subject: Re: Bricks Library Example (wip)
Date: 12 Jan 2024 11:55:00
Message: <web.65a16de8880c46f4bab418d46a8f0b95@news.povray.org>
This looks great, and not an idea I had thought of before, I have always just
used individual bricks placed by macros where I need the depth/realism that
image maps/normals/patterns cannot supply.

I imagine this will create a wall a lot quicker (code wise) as my macros are
very specific to the task they are being used for, what are the render speeds
like for the isosurface?

Sean


Post a reply to this message

From: Chris R
Subject: Re: Bricks Library Example (wip)
Date: 12 Jan 2024 13:00:00
Message: <web.65a17e03880c46f417021f505cc1b6e@news.povray.org>
"s.day" <s.d### [at] uelacuk> wrote:
> This looks great, and not an idea I had thought of before, I have always just
> used individual bricks placed by macros where I need the depth/realism that
> image maps/normals/patterns cannot supply.
>
> I imagine this will create a wall a lot quicker (code wise) as my macros are
> very specific to the task they are being used for, what are the render speeds
> like for the isosurface?
>
> Sean

This was done with pretty moderate anti-aliasing and the only light source is a
simulation of the sun.  At that it was about 100 pps and took about an hour or
so on my laptop.

-- Chris R.
-- Happily rendering since 2014


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.