 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
After the release of Granite_21 by Thomas de Groot and his collaborators, I
hesitate to share my amateurish attempt at a granite texture. The quality of the
results and the levels of sophistication do not compare (Thomas's granite is far
better than anything I can achieve). However, the approach I took did happen to
lend itself somewhat well to making the veins in the rock so with that in mind
I'll go ahead and show some examples.
The basic technique is to make an array of colors, possibly by sampling a
photograph, then create a multi-layered texture consisting of color_maps that
are partly colored with random array entries, and partly transparent. Increasing
the brightness of just one of the color array entries has the effect of
"lighting up" the layers above it. Selecting different colors to brighten can
create dramatically different and sometimes surprising results.
The image attached to this post is the final product for the project I was
working on. The veins are necessarily boring. The next two posts are
developmental experiments and will show the lighting effect more intensely.
I'll post the source code in case anyone is interested but be warned, it's a
little messy.
Have a great day!
Best regards,
Dave Blandston
Post a reply to this message
Attachments:
Download 'granitetest0.jpg' (699 KB)
Preview of image 'granitetest0.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Another example...
Post a reply to this message
Attachments:
Download 'granitetest1.jpg' (657 KB)
Preview of image 'granitetest1.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I made a brief attempt to add iridescence. With some fine-tuning it might
work...
Post a reply to this message
Attachments:
Download 'granitetest2.jpg' (85 KB)
Preview of image 'granitetest2.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Op 25-12-2021 om 09:07 schreef Dave Blandston:
> After the release of Granite_21 by Thomas de Groot and his collaborators, I
> hesitate to share my amateurish attempt at a granite texture. The quality of the
> results and the levels of sophistication do not compare (Thomas's granite is far
> better than anything I can achieve). However, the approach I took did happen to
> lend itself somewhat well to making the veins in the rock so with that in mind
> I'll go ahead and show some examples.
>
No need to be shy :-) Different approaches to identical goals are to be
promoted strongly.
> The basic technique is to make an array of colors, possibly by sampling a
> photograph, then create a multi-layered texture consisting of color_maps that
> are partly colored with random array entries, and partly transparent. Increasing
> the brightness of just one of the color array entries has the effect of
> "lighting up" the layers above it. Selecting different colors to brighten can
> create dramatically different and sometimes surprising results.
>
This, sir, is brilliant! I declare your end result to be better than
mine, especially in close up. The individual grains are much more
natural looking. Very, very well done indeed.
> The image attached to this post is the final product for the project I was
> working on. The veins are necessarily boring. The next two posts are
> developmental experiments and will show the lighting effect more intensely.
>
The veins could use some width variations over their length.
> I'll post the source code in case anyone is interested but be warned, it's a
> little messy.
>
I am certainly interested!
> Have a great day!
>
You provided one! ;-)
--
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> wrote:
> The veins could use some width variations over their length.
Oh you caught me being lazy! The variable width feature will be easy to add and
I agree that it's necessary. Thanks for the kind words and suggestion! You're
under-rating Granite_21 though because the color distribution is excellent and
the surface has exactly the right bumpiness, which I know required amazing
knowledge and skill to produce.
By the way, I must confess that by brightening one of the color entries
(actually color pairs), I was expecting to get brightly-colored flakes without
affecting the other layers - the actual result was quite a surprise. Depending
on which color pair one chooses to brighten, the brightness factor may need to
be quite high if that particular color happens to be buried under several other
layers. There's lots of room for improvement!
Sorry for the messy state of the source code. One thing to note is that render
time can be improved by reducing the number of layers. The reason I set it so
high is that when I used a bright green base layer (<.7, 1, 0>) as a test, it
still showed through a little even with 100 layers.
Warmest regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Op 25/12/2021 om 20:24 schreef Dave Blandston:
> Thomas de Groot <tho### [at] degroot org> wrote:
>> The veins could use some width variations over their length.
>
>
> Oh you caught me being lazy! The variable width feature will be easy to add and
> I agree that it's necessary. Thanks for the kind words and suggestion! You're
> under-rating Granite_21 though because the color distribution is excellent and
> the surface has exactly the right bumpiness, which I know required amazing
> knowledge and skill to produce.
>
Well, well, well, are we going to outcompete each other in praise words
now? ;-) But seriously, comparing the grain build-up/aspect of the two
approaches in close up, I consider yours definitely as better, more
natural, looking. I need to dive into your code to see how you achieved
that, because it was my ultimate if - imo - partly failed goal.
> By the way, I must confess that by brightening one of the color entries
> (actually color pairs), I was expecting to get brightly-colored flakes without
> affecting the other layers - the actual result was quite a surprise. Depending
> on which color pair one chooses to brighten, the brightness factor may need to
> be quite high if that particular color happens to be buried under several other
> layers. There's lots of room for improvement!
>
That is an interesting notion. Investigation is in order.
> Sorry for the messy state of the source code. One thing to note is that render
> time can be improved by reducing the number of layers. The reason I set it so
> high is that when I used a bright green base layer (<.7, 1, 0>) as a test, it
> still showed through a little even with 100 layers.
>
I am not surprised. Layering does not improve render speed.
> Warmest regards,
>
And returned. Have a nice and peaceful Christmas (extended to all you
POV-Ray ladies and gentlemen out there in the big world)
--
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> wrote:
> I need to dive into your code to see how you achieved
> that
I cleaned up the code a little and added some comments so it's easier to see
what variables need to be set. The improved code is posted as a reply to the
original post in the "povray.text.scene-files" section.
Kind regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Dave Blandston" <IsN### [at] protonmail ch> wrote:
> Thomas de Groot <tho### [at] degroot org> wrote:
> > I need to dive into your code to see how you achieved
> > that
>
>
> I cleaned up the code a little and added some comments so it's easier to see
> what variables need to be set. The improved code is posted as a reply to the
> original post in the "povray.text.scene-files" section.
>
> Kind regards,
> Dave Blandston
both approaches look pretty complementary, and I hope they could somewhat merge?
I really like the white veins with iridescence. To make it really fully
functional, it would be great if it could also add some such quartzy "freckles"
smaller and scattered away from the veins(sorry for my unscientific vocabulary)
but maybe just some warp / turbulence would end up providing that ?
This is great !
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Mr" <nomail@nomail> wrote:
> both approaches look pretty complementary, and I hope they could somewhat merge?
>
> I really like the white veins with iridescence. To make it really fully
> functional, it would be great if it could also add some such quartzy "freckles"
> smaller and scattered away from the veins(sorry for my unscientific vocabulary)
> but maybe just some warp / turbulence would end up providing that ?
Good ideas! Yes, adding flecks is possible. That could be accomplished with a
texture_map or with CSG objects.
I've been working on other stuff and haven't experimented further with
iridescence but I think it might be possible to do much better than the example
image.
Have a wonderful day!
-Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Op 27/12/2021 om 11:48 schreef Dave Blandston:
> "Mr" <nomail@nomail> wrote:
>> both approaches look pretty complementary, and I hope they could somewhat merge?
>>
Indeed. Especially the trick of using colour pairs is a smart one. If
Dave agrees I would like somehow to integrate that in Granite 21, when I
can get to it.
>> I really like the white veins with iridescence. To make it really fully
>> functional, it would be great if it could also add some such quartzy "freckles"
>> smaller and scattered away from the veins(sorry for my unscientific vocabulary)
>> but maybe just some warp / turbulence would end up providing that ?
>
>
> Good ideas! Yes, adding flecks is possible. That could be accomplished with a
> texture_map or with CSG objects.
>
> I've been working on other stuff and haven't experimented further with
> iridescence but I think it might be possible to do much better than the example
> image.
>
Dave, I have started to play with your code. Is there a reason why you
chose to use hex colours? I find them rather counter-intuitive.
--
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> wrote:
> If
> Dave agrees I would like somehow to integrate that in Granite 21, when I
> can get to it.
>
> Is there a reason why you chose to use hex colours?
Please feel free to use the code in whatever way you wish!
There's no reason to keep the hex colors. The reason I used them is because I
use the color picker tool in Paint.net to sample colors from pictures and it's
much easier and quicker to copy and paste a single hexadecimal color code from
Paint.net to POV-Ray instead of three separate RGB values. If one set of colors
is used for the stone and a second set of colors is used for the veins then
there could be quite a number of copy-and-pastes.
Have an awesome day!
Kind regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Dave Blandston" <IsN### [at] protonmail ch> wrote:
> Thomas de Groot <tho### [at] degroot org> wrote:
> >
> > Is there a reason why you chose to use hex colours?
>
> ...The reason I used them is because I
> use the color picker tool in Paint.net to sample colors from pictures,,,
Ah, a fellow Paint.net user ;-) I'm currently running Windows 10; my previous
go-to app for graphics work was an *old* version of Photoshop (which ran under
Windows XP and even 7 with some fiddling), so it is taking me awhile to learn
workarounds for some of PS's more advanced features.
> I made a brief attempt to add iridescence. With some fine-tuning it might
> work...
Your result is really beautiful, and those veins look...real! That's a great
technique you've come up with; I plan to look at your code, thanks for posting
it.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Kenneth" <kdw### [at] gmail com> wrote:
> Ah, a fellow Paint.net user ;-) I'm currently running Windows 10; my previous
> go-to app for graphics work was an *old* version of Photoshop (which ran under
> Windows XP and even 7 with some fiddling), so it is taking me awhile to learn
> workarounds for some of PS's more advanced features.
I bought the last version of Photo Shop before it became subscription-only and
it's invaluable of course but I prefer the speed and simplicity of Paint.net
whenever possible, which I find is most of the time.
> Your result is really beautiful, and those veins look...real! That's a great
> technique you've come up with; I plan to look at your code, thanks for posting
> it.
Thanks for the generous compliment, just be warned: trial-and-error is
necessary. The final result depends on how the texture layers randomly stack up.
The current code is not at all sophisticated in it's ability to be controlled in
a predictable manner. However, POV-Ray is a wonderful thing and that can
certainly be accomplished!
One more thing that might be worth exploring is the selection of color(s) that
make up the transparent portion of each layer. Currently, the transparent
portions are set to Black or White (via the variable "WhiteLevel"). Using a
value greater than one or less than zero is also interesting.
There are lots of possibilities to explore. I discovered that layered textures
don't work quite the way I thought they did, they work better than I thought.
Thank you once again POV-Ray programmers!
Kind regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
So here we go.
I took my Granite_21 array for Dakota Red and extracted colour pairs. I
also changed the reflection block because I guess the original
reflection is way too strong. I used the reflection as given in
Granite_21. A couple of further, inconsequential, changes et voilà.
This is the finish block I used:
finish {
diffuse albedo 0.5 brilliance 1.5
specular albedo 0.9 roughness 0.0025
fresnel on
reflection {0.1 fresnel on}
conserve_energy
}
I used 10 layers and scaled the final texture on the object. I could
also have used much more layers (e.g. 100) and scale the texture
somewhat less, with a similar result but a bit more confused imo.
Again, this is a great piece of work, Dave! I need to dig deeper now. ;-)
--
Thomas
Post a reply to this message
Attachments:
Download 'db_granite_test2_1.jpg' (85 KB)
Preview of image 'db_granite_test2_1.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> wrote:
> I took my Granite_21 array for Dakota Red and extracted colour pairs. I
> also changed the reflection block because I guess the original
> reflection is way too strong. I used the reflection as given in
> Granite_21. A couple of further, inconsequential, changes et voilą.
You would be shocked at what a mess I've made of the lighting and texturing in
the scene that this came from so yes the finish would need a lot of fixing. I've
always had trouble with that part of POV-Ray...
> I used 10 layers and scaled the final texture on the object. I could
> also have used much more layers (e.g. 100) and scale the texture
> somewhat less, with a similar result but a bit more confused imo.
Ten layers is much more reasonable than a hundred and your excellent results
prove it. I admit that a hundred layers is a bit of overkill. (Sometimes I tend
to be a bit of a perfectionist. I don't quite have OCD, but I do have CDO which
is similar, but with the letters in alphabetical order like they're supposed to
be.)
I've been using this sample image as a Granite_21 reference point:
https://news.povray.org/povray.binaries.images/attachment/%3C6089814e%40news.povray.org%3E/dakotagrains_sn_test.jpg
This one represents near perfection in my opinion (the color samples I used came
from that picture, by the way). But I agree, both methods produce great results
and I'm more excited than ever regarding Granite_21. Thanks for sharing your
preliminary results!
Kind regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Op 31-12-2021 om 06:44 schreef Dave Blandston:
> Thomas de Groot <tho### [at] degroot org> wrote:
>> I took my Granite_21 array for Dakota Red and extracted colour pairs. I
>> also changed the reflection block because I guess the original
>> reflection is way too strong. I used the reflection as given in
>> Granite_21. A couple of further, inconsequential, changes et voilà.
>
> You would be shocked at what a mess I've made of the lighting and texturing in
> the scene that this came from so yes the finish would need a lot of fixing. I've
> always had trouble with that part of POV-Ray...
>
I agree. Sometimes finish can be straightforward, but especially with
reflections, there are tricky things to take care of.
>> I used 10 layers and scaled the final texture on the object. I could
>> also have used much more layers (e.g. 100) and scale the texture
>> somewhat less, with a similar result but a bit more confused imo.
>
> Ten layers is much more reasonable than a hundred and your excellent results
> prove it. I admit that a hundred layers is a bit of overkill. (Sometimes I tend
> to be a bit of a perfectionist. I don't quite have OCD, but I do have CDO which
> is similar, but with the letters in alphabetical order like they're supposed to
> be.)
>
In fact, I can imagine cases where a hundred layers would be be alright.
> I've been using this sample image as a Granite_21 reference point:
>
https://news.povray.org/povray.binaries.images/attachment/%3C6089814e%40news.povray.org%3E/dakotagrains_sn_test.jpg
> This one represents near perfection in my opinion (the color samples I used came
> from that picture, by the way). But I agree, both methods produce great results
> and I'm more excited than ever regarding Granite_21. Thanks for sharing your
> preliminary results!
>
The attached image shows, side by side, the granite as rendered with
your code (and 100 layers) at left, and as rendered with Granite_21, at
right. Both methods imo are valid, depending on what you want to
achieve. I focussed much more on the creation of individual grains
(which clearly has its drawback and limitations) while I think your
method is almost more intuitive/natural looking. In any case, I like it
quite a lot.
Best wishes for the New Year, take care! Extended to all Povers!
--
Thomas
Post a reply to this message
Attachments:
Download 'db_granite_test2_4-5.jpg' (239 KB)
Preview of image 'db_granite_test2_4-5.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
My finish suggestion was not entirely correct. Better to use the
following (as a material, btw):
#local S = .2;
#declare StoneColor =
material {
interior {ior 1.6}
texture {
StoneColor
finish {
diffuse albedo 0.5 brilliance 1.5
specular albedo 0.9*0.5 roughness 0.0025 //roughness 0.005 =
less proeminent
fresnel on
reflection {0.01 0.1 fresnel on}
conserve_energy
}
normal {granite .025 scale <S, S, S>}
}
}
--
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> wrote:
> The attached image shows, side by side, the granite as rendered with
> your code (and 100 layers) at left, and as rendered with Granite_21, at
> right. Both methods imo are valid, depending on what you want to
> achieve. I focussed much more on the creation of individual grains
> (which clearly has its drawback and limitations) while I think your
> method is almost more intuitive/natural looking. In any case, I like it
> quite a lot.
Applying your material made a big improvement in the area of realism. Thanks for
sharing it!
And Happy New Year to everyone!
Best regards,
Dave Blandston
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2021-12-31 à 10:41, Thomas de Groot a écrit :
> Op 31-12-2021 om 06:44 schreef Dave Blandston:
>> Thomas de Groot <tho### [at] degroot org> wrote:
>>> I took my Granite_21 array for Dakota Red and extracted colour pairs. I
>>> also changed the reflection block because I guess the original
>>> reflection is way too strong. I used the reflection as given in
>>> Granite_21. A couple of further, inconsequential, changes et voilà.
>>
>> You would be shocked at what a mess I've made of the lighting and
>> texturing in
>> the scene that this came from so yes the finish would need a lot of
>> fixing. I've
>> always had trouble with that part of POV-Ray...
>>
> I agree. Sometimes finish can be straightforward, but especially with
> reflections, there are tricky things to take care of.
>
>>> I used 10 layers and scaled the final texture on the object. I could
>>> also have used much more layers (e.g. 100) and scale the texture
>>> somewhat less, with a similar result but a bit more confused imo.
>>
>> Ten layers is much more reasonable than a hundred and your excellent
>> results
>> prove it. I admit that a hundred layers is a bit of overkill.
>> (Sometimes I tend
>> to be a bit of a perfectionist. I don't quite have OCD, but I do have
>> CDO which
>> is similar, but with the letters in alphabetical order like they're
>> supposed to
>> be.)
>>
> In fact, I can imagine cases where a hundred layers would be be alright.
>
>> I've been using this sample image as a Granite_21 reference point:
>>
https://news.povray.org/povray.binaries.images/attachment/%3C6089814e%40news.povray.org%3E/dakotagrains_sn_test.jpg
>>
>> This one represents near perfection in my opinion (the color samples I
>> used came
>> from that picture, by the way). But I agree, both methods produce
>> great results
>> and I'm more excited than ever regarding Granite_21. Thanks for
>> sharing your
>> preliminary results!
>>
> The attached image shows, side by side, the granite as rendered with
> your code (and 100 layers) at left, and as rendered with Granite_21, at
> right. Both methods imo are valid, depending on what you want to
> achieve. I focussed much more on the creation of individual grains
> (which clearly has its drawback and limitations) while I think your
> method is almost more intuitive/natural looking. In any case, I like it
> quite a lot.
>
> Best wishes for the New Year, take care! Extended to all Povers!
>
The left one hints of a big piece while the one on the right fits better
foe a small one.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alain Martel <kua### [at] videotron ca> wrote:
> The left one hints of a big piece while the one on the right fits better
> foe a small one.
Interesting point.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
What an amazing journey these stone textures have been! I'm pretty happy to see
that a completely unrelated project has been woven into this, and with the bonus
that there are iridescent mineral veins to add in as well!
Good work, both of you for taking this another step further forward.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> What an amazing journey these stone textures have been! I'm pretty happy to see
> that a completely unrelated project has been woven into this, and with the bonus
> that there are iridescent mineral veins to add in as well!
>
> Good work, both of you for taking this another step further forward.
Kind of like the Fractint "Stone Soup Group..."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |