POV-Ray : Newsgroups : povray.binaries.images : Wood grain : Re: Wood grain Server Time
28 May 2024 23:09:08 EDT (-0400)
  Re: Wood grain  
From: Chris R
Date: 1 May 2023 11:00:00
Message: <web.644fd30a6808bc7793c0941a5cc1b6e@news.povray.org>
"Mike Miller" <mil### [at] gmailcom> wrote:
> "Chris R" <car### [at] comcastnet> wrote:
> > Maybe this is an obvious trick to some of the veterans here, but I thought it
> > was an interesting way to get good color maps for wood, so here it goes.
> >
> > I was working on some wood flooring for a scene and found a site called
> > wood-database.com that has images and information on lots of different types of
> > wood, including images of lumber made from the types of wood.
> >
> > I downloaded an image of the wood I wanted to replicate in my scene, (the lower
> > left inset in the image below), and imported it into GIMP.  In the Colors/Info
> > menu there is a "Smooth Palette" option that creates a palette of the colors in
> > the image, (seen to the right of the inset).  I exported that as a JPEG and then
> > used some macros I created to pull out the POV-ray colors from the image.  I
> > have used both interpolation and non-interpolation for different effects.  I
> > then use those colors, in the order given, to create the color map for the wood
> > texture.
> >
> > Coming up with the wood pigment and warps is still mostly trial and error, but
> > the sample is actually pretty close.
> >
> > The three boards are rendered using variations on the color map.  The center one
> > is non-translated and unaltered.  The right has been lightened, and the grain
> > was selected randomly from a normal-sized pine tree.  The left was grayed by
> > aging, and also randomly selected.
> >
> > In this particular example, I only sampled the colors from a single ring of the
> > wood pattern.  For others, the colors vary across rings, so it works better to
> > use all of the colors in the color map, but scale the pigment so the ring sizes
> > stay the same.
> >
> > Anyway, I'm finding this is a lot easier than my usual hit or miss method of
> > creating a wood colormap, and allows for greater variation in the colors, which
> > enhances realism.
> >
> >
> > -- Chris R.
> That's excellent Chris. Nice work. I came close to writing a macro to do the
> same - generate a pov color_map from a given image. Mind sharing the macro? :)
> Mike.

I am doing some more experiments and cleaning up the code.  I'll get around to
posting it eventually after I look at some of the suggestions from below as
well.  The version I have right now just creates a pigment function using an
image_map from the palette jpeg, and then scans it from <0,0,0> to <1,0,0> in
steps based on the size of the color map I want to generate.  It then just dumps
the colors it found using #debug as a color_map {} and I copy and paste from the
message window into my code.

There's a bunch of things to clean up based on failed experiments.

-- Chris R.

Post a reply to this message

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