POV-Ray : Newsgroups : povray.binaries.images : Wood grain Server Time
21 Dec 2024 11:59:48 EST (-0500)
  Wood grain (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Chris R
Subject: Wood grain
Date: 28 Apr 2023 13:50:00
Message: <web.644c0643f7029a0993c0941a5cc1b6e@news.povray.org>
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.


Post a reply to this message


Attachments:
Download 'woodgrains.jpg' (357 KB)

Preview of image 'woodgrains.jpg'
woodgrains.jpg


 

From: Mike Miller
Subject: Re: Wood grain
Date: 28 Apr 2023 18:35:00
Message: <web.644c49626808bc7759197626dabc9342@news.povray.org>
"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.


Post a reply to this message

From: Kenneth
Subject: Re: Wood grain
Date: 28 Apr 2023 19:15:00
Message: <web.644c52a76808bc779b4924336e066e29@news.povray.org>
That a really clever technique, and your results speak for themselves-- the wood
looks very natural! I assume you used eval_pigment in your macro, to pick out
the colors from the color-palette JPEG.

My go-to app for image editing is the freebie paint.net; unfortunately, it does
not have such a palette producer built-in, like GIMP does. I need to search for
a similar plug-in for it.

Nice work, and inspiring!


Post a reply to this message

From: Bald Eagle
Subject: Re: Wood grain
Date: 28 Apr 2023 20:20:00
Message: <web.644c61dc6808bc771f9dae3025979125@news.povray.org>
Very nice.


I wrote some similar macro stuff way back:

http://news.povray.org/povray.binaries.images/thread/%3C58cfcd53%241%40news.povray.org%3E/

I also made some numerical patterns to see what parts of each pattern correspond
to what values in the color map

http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a7774f01a0c102c5cafe28e0@news.povray.org%3E/

as well as the recent color map editor thing:


http://news.povray.org/povray.advanced-users/thread/%3Cweb.63ed381961f8e3fb1f9dae3025979125%40news.povray.org%3E/


Hope some of that helps / inspires...

- BW


Post a reply to this message

From: jr
Subject: Re: Wood grain
Date: 29 Apr 2023 02:00:01
Message: <web.644cb20f6808bc7758c093306cde94f1@news.povray.org>
hi,

"Kenneth" <kdw### [at] gmailcom> wrote:
> ...
> My go-to app for image editing is the freebie paint.net; unfortunately, it does
> not have such a palette producer built-in, like GIMP does. I need to search for
> a similar plug-in for it.

their website shows MS Windows versions, download or via MS store.


regards, jr.


Post a reply to this message

From: ingo
Subject: Re: Wood grain
Date: 29 Apr 2023 02:10:00
Message: <web.644cb49e6808bc7717bac71e8ffb8ce3@news.povray.org>
"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.

They look good.

A way to colorize wood is to use the same technique that is used in printing. A
wood is not printed in ymck but in spot colours on a coloured base. In general
only three ink colours are needed.

It starts with how the design is built. The first layer is just density
modulation without detail. The second layer give the general idea of the design
and the last layer gives the fine detail like the grain. All inks are lasure
inks, they are transparent.

The main colour of the design is defined by the base film colour. The first
layer is printed "tone in tone" and darker than the base colour, and has the
opposite "temperature". Cool gray vs warm gray. The next layer can be more
contrasting and the grain layer can be even more contrasting. For an oak you can
go very dark brown or even white for a white wash effect. The mixing of all the
colours, as they are transparent, gives a very rich and natural look.

To make a floor all that one needs to do to get some variation is to slightly
randomize the base colour per board.

ingo


Post a reply to this message

From: Chris R
Subject: Re: Wood grain
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

From: Chris R
Subject: Re: Wood grain
Date: 1 May 2023 11:00:00
Message: <web.644fd3d26808bc7793c0941a5cc1b6e@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> That a really clever technique, and your results speak for themselves-- the wood
> looks very natural! I assume you used eval_pigment in your macro, to pick out
> the colors from the color-palette JPEG.
>
> My go-to app for image editing is the freebie paint.net; unfortunately, it does
> not have such a palette producer built-in, like GIMP does. I need to search for
> a similar plug-in for it.
>
> Nice work, and inspiring!

Actually, I rolled my own version of eval_pigment by creating a pigment function
and then just calling it repeatedly as I moved along the palette jpeg.  I wasn't
worried about speed since this is something I do in the modeling stage rather
than the rendering stage.  (To be honest, I didn't look to see if there was
something built in to do this already...)

-- Chris R.


Post a reply to this message

From: Chris R
Subject: Re: Wood grain
Date: 1 May 2023 11:05:00
Message: <web.644fd4816808bc7793c0941a5cc1b6e@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Very nice.
>
>
> I wrote some similar macro stuff way back:
>
>
http://news.povray.org/povray.binaries.images/thread/%3C58cfcd53%241%40news.povray.org%3E/
>
> I also made some numerical patterns to see what parts of each pattern correspond
> to what values in the color map
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a7774f01a0c102c5cafe28e0@news.povray.org%3E/
>
> as well as the recent color map editor thing:
>
>
>
http://news.povray.org/povray.advanced-users/thread/%3Cweb.63ed381961f8e3fb1f9dae3025979125%40news.povray.org%3E/
>
>
> Hope some of that helps / inspires...
>
> - BW

Thanks, I will look into this.  I should probably make it a habit to just search
the newsgroups for your posts before I start writing code.  :-)

-- Chris R.


Post a reply to this message

From: Bald Eagle
Subject: Re: Wood grain
Date: 1 May 2023 13:25:00
Message: <web.644ff5b76808bc771f9dae3025979125@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:

> Thanks, I will look into this.  I should probably make it a habit to just search
> the newsgroups for your posts before I start writing code.  :-)


:D  tbh, I do the same thing a lot.
Heck, I even wind up rewriting a lot of my own code.

It _IS_ a good thing when people make their own attempts, since they might solve
things that I got wrong or others thought "impossible".  "I didn't know I
couldn't do that - - - so I just did it."

Also, you might wind up doing the same thing but approaching the end goal in a
different way, which might lead to improvements in speed / efficiency /
photorealism.

I generally find that the difficult part is not acquiring the pallette of colors
to interpolate with the color_map, but doing it in such a way that it winds up
resembling what I'm trying to model with a procedural pattern.

If you look into optical illusions, it becomes immediately apparent that the
actual color value employed matters far less than the visual context that your
brain interprets it in.

And that's where things get challenging, and it becomes more art and less math,
science, and engineering.

I DO particularly like the suggestion to use layered textures with filter - some
sort of commercial algorithm to make laminated faux woodgrain would be a great
basis for a realistic wood texture.


- BW


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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