|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Does anyone know how I can apply a normal map (like this
https://imgur.com/a/GbE7K8K) to an object and have it actually behave like a
normal map (i.e. adjust the normal of the surface by it's RGB value).
Bump map doesn't do the right thing, I feel like it might be to do with
slope_map but I can't get it to take an image.
I can't believe it wouldn't be possible.
Any help would be much appreciated.
Thanks,
cloudyroo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"cloudyroo" <nomail@nomail> wrote:
> Does anyone know how I can apply a normal map (like this
> https://imgur.com/a/GbE7K8K) to an object and have it actually behave like a
> normal map (i.e. adjust the normal of the surface by it's RGB value).
> Bump map doesn't do the right thing, I feel like it might be to do with
> slope_map but I can't get it to take an image.
> I can't believe it wouldn't be possible.
> Any help would be much appreciated.
> Thanks,
> cloudyroo
Real quick (untested)
based on
http://www.povray.org/documentation/view/3.7.0/337/
and
http://www.povray.org/documentation/view/3.6.1/378/
#declare FOO = function {
pigment
{
image_map
{
[BITMAP_TYPE] "bitmap[.ext]"
[IMAGE_MAP_MODS...]
}
[PIGMENT_MODFIERS...]
}
}
and then do:
normal { // <----switched to normal instead of pigment here
function { FOO(x,y,z).green }
[PIGMENT_MODIFIERS...]
}
There may be a quicker / neater way to do it with a function pattern or pattern
function ..... but I'd use those as keywords to search the docs and the forum
posts.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17-1-2019 12:30, Bald Eagle wrote:
> Real quick (untested)
Brilliant! Why did I never think of that? :-)
> There may be a quicker / neater way to do it with a function pattern or pattern
> function ..... but I'd use those as keywords to search the docs and the forum
> posts.
>
I suppose so. Going to follow that hint...
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17-1-2019 12:30, Bald Eagle wrote:
> There may be a quicker / neater way to do it with a function pattern or pattern
> function ..... but I'd use those as keywords to search the docs and the forum
> posts.
>
>
Following up on the initial query by cloudyroo, I tried to get this to
work as a function pattern in a normal block but without success... :-/
I must admit that something escapes me and/or I misunderstand the
docs... Neither found any info in the forum posts... I seem not to have
my day ;-)
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 19.01.2019 um 13:25 schrieb Thomas de Groot:
> On 17-1-2019 12:30, Bald Eagle wrote:
>> There may be a quicker / neater way to do it with a function pattern
>> or pattern
>> function ..... but I'd use those as keywords to search the docs and
>> the forum
>> posts.
>>
>>
> Following up on the initial query by cloudyroo, I tried to get this to
> work as a function pattern in a normal block but without success... :-/
>
> I must admit that something escapes me and/or I misunderstand the
> docs... Neither found any info in the forum posts... I seem not to have
> my day ;-)
This is not a bump map (in which brightness is interpreted as height,
and the normal is defined by the gradient in the image) but a normal map
(in which the three colour channels are interpreted directly as the
coordinates ot the normal vectors).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thomas de Groot <tho### [at] degrootorg> wrote:
> >
> Following up on the initial query by cloudyroo, I tried to get this to
> work as a function pattern in a normal block but without success... :-/
>
> I must admit that something escapes me and/or I misunderstand the
> docs... Neither found any info in the forum posts... I seem not to have
> my day ;-)
>
Try this set-up (using the image_map that the OP linked to in his original
post):
#declare NORM_FUNCTION =
function{
pigment{image_map{png "D9AsKLH.png" interpolate 2} scale 2}
};
box{0,1.5
texture{
pigment{rgb .5}
finish{ambient .1 diffuse .7 phong .7 phong_size 5}
normal{
function{NORM_FUNCTION(x,y,z).blue} // also try (y,y,x)
normal_map{
[0.5 bumps scale .15 bump_size 5]
[0.5 granite scale .2 bump_size 5]
}
}
}
}
Some of these values are exaggerated, for effect. I do see the normal pattern on
the box, but only on the front face; a function made from an image_map is only
meaningful in x and y, not z, since the image_map is not '3-dimensional' like
POV-Ray's built-in patterns are.
Since the use of the function requires a color component to be chosen, I used
.blue
because the blue color in this particular image_map is the dominant one, with
the most gradations. Using .red, .green, or .gray shows practically no effect.
I don't presently know how to use the *complete* range of colors in the image,
as a way to pick out the normal patterns in the normal_map-- like, red for
bumps, green for granite, and blue for a third normal pattern. It would *seem*
to be possible, though, with some SDL/function tricks(?)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> ...a function made from an image_map is only
> meaningful in x and y, not z, since the image_map is not '3-dimensional'
> like POV-Ray's built-in patterns are.
>
Sorry, that's not quite true: The image_map function has 'infinite' depth in z
(just like an image_map when used as a PIGMENT.) Change the object to a sphere
to see what I mean.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> Since the use of the function requires a color component to be chosen, I used
> .blue
> because the blue color in this particular image_map is the dominant one, with
> the most gradations. Using .red, .green, or .gray shows practically no effect.
>
> I don't presently know how to use the *complete* range of colors in the image,
> as a way to pick out the normal patterns in the normal_map-- like, red for
> bumps, green for granite, and blue for a third normal pattern. It would *seem*
> to be possible, though, with some SDL/function tricks(?)
I started coding a function this morning, and just got back to it now.
Glad to see ole' Kenneth Walker is keeping his Northern namesake on his toes
with the speedy competition. ;)
Try some of this out, and see what you think:
#declare Type = 1;
#switch (Type)
#case (0)
box {<0, 0, 0>, <1, 1, 0.1>
texture {pigment {Blue*0.5} finish {specular 0.4}}
normal {bump_map {png "PovLogo.png" once} bump_size 2}
}
#break
#case (1)
#declare BumpMap = function {pigment {image_map {png "PovLogo.png"} }};
box {<0, 0, 0>, <1, 1, 0.1>
texture {pigment {Blue*0.5} finish {specular 0.4}}
//normal {function { BumpMap (x, y, z).gray}}
normal {
function {
BumpMap (x, y, z).red +
BumpMap (x, y, z).green +
BumpMap (x, y, z).blue}
}
}
#break
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 19-1-2019 20:40, Bald Eagle wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
>> Since the use of the function requires a color component to be chosen, I used
>> .blue
>> because the blue color in this particular image_map is the dominant one, with
>> the most gradations. Using .red, .green, or .gray shows practically no effect.
>>
>> I don't presently know how to use the *complete* range of colors in the image,
>> as a way to pick out the normal patterns in the normal_map-- like, red for
>> bumps, green for granite, and blue for a third normal pattern. It would *seem*
>> to be possible, though, with some SDL/function tricks(?)
>
>
> I started coding a function this morning, and just got back to it now.
> Glad to see ole' Kenneth Walker is keeping his Northern namesake on his toes
> with the speedy competition. ;)
>
> Try some of this out, and see what you think:
>
>
> #declare Type = 1;
> #switch (Type)
>
> #case (0)
> box {<0, 0, 0>, <1, 1, 0.1>
> texture {pigment {Blue*0.5} finish {specular 0.4}}
> normal {bump_map {png "PovLogo.png" once} bump_size 2}
>
> }
> #break
>
> #case (1)
>
> #declare BumpMap = function {pigment {image_map {png "PovLogo.png"} }};
>
>
> box {<0, 0, 0>, <1, 1, 0.1>
> texture {pigment {Blue*0.5} finish {specular 0.4}}
> //normal {function { BumpMap (x, y, z).gray}}
> normal {
> function {
> BumpMap (x, y, z).red +
> BumpMap (x, y, z).green +
> BumpMap (x, y, z).blue}
> }
> }
>
> #break
> #end
>
>
Sorry, I am afraid I made myself not too clear or, more probably, I
mis-read Bald Eagle's initial answer (the last paragraph). I certainly
got a fine working normal, but got lost with that 'function pattern'
hint at the end and went looking for function_patterns... :-)
What I did, and what worked fine was this:
#local NormalMap =
function {
pigment {
image_map {
jpeg "MyImage.jpg" gamma 1
}
}
}
sphere {
0, 1
pigment {rgb 1}
normal {
function {NormalMap(x,y,z).grey} 1.5
scale 0.5
}
finish {
diffuse 1
}
}
Note that I replaced the '.red' by '.grey' which gives a better render.
What also works fine here is '.hf' by the way. And so it seems, we were
all (Kenneth, Bald Eagle, Clipka, me) on the same wavelength.
However, Bald Eagle's
function {
NormalMap(x,y,z).red +
NormalMap(x,y,z).green +
NormalMap(x,y,z).blue
} 1.5
gives a much better result and thus may be preferred.
Kenneth's suggestion to use the three colours for three different
normals may be worth investigating further...
Now, that was a nice little experimental session. Keeps me on my toes.
Thanks all!
--
Thomas
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:5c442a26$1@news.povray.org Thomas de Groot wrote:
> However, Bald Eagle's
>
> function {
> NormalMap(x,y,z).red +
> NormalMap(x,y,z).green +
> NormalMap(x,y,z).blue
> } 1.5
>
> gives a much better result and thus may be preferred.
>
.gray and .hf = 0.3 * red + 0.59 * green + 0.11 * blue, so yes there's
quite a difference to be expected.
ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|