POV-Ray : Newsgroups : povray.general : Using png to normal uv mapping Server Time
4 Aug 2024 10:19:14 EDT (-0400)
  Using png to normal uv mapping (Message 1 to 8 of 8)  
From: Manuel
Subject: Using png to normal uv mapping
Date: 16 Jun 2003 07:42:39
Message: <3eedad2f@news.povray.org>
I want map an obj using uv coordinates.
I try this texture, but it give me a black object:

#declare foo=
texture

     uv_mapping pigment {  image_map {png "texture.png"  map_type 0
interpolate 0}}
     uv_mapping  normal { bump_map {png "texturebump.png" bump_size 5.0}}
     }


Can you tell me a correct sample?
Where is the error?

Thanks,

          Manuel


Post a reply to this message

From: Warp
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 08:45:47
Message: <3eedbbfb@news.povray.org>
Manuel <man### [at] tinit> wrote:
> I try this texture, but it give me a black object:

  Only certain objects support uv-mapping, and some of them require
uv-vectors to work correctly.
  Without seeing how you are using the texture in question it's difficult
to tell what's wrong.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Manuel
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 09:02:03
Message: <3eedbfcb$1@news.povray.org>
>   Only certain objects support uv-mapping, and some of them require
> uv-vectors to work correctly.
>   Without seeing how you are using the texture in question it's difficult
> to tell what's wrong.


Ok, excuse me...now I've extract the problem.
In the code below, if you change the

uv_mapping normal

to

normal

the scene work...use a generic png 200x200 pixel.
The texture.png is RGB, while
the texturebump is grayscale, both made in Gimp.


------------------SAMPLE SCENE UV PROBLEM------------------

#include "finish.inc"
#include "colors.inc"


#declare foo =
texture

     uv_mapping pigment {  image_map {png "texture.png"  map_type 0
interpolate 0}}
     uv_mapping normal { bump_map {png "texturebump.png" bump_size 5.0}}
     }

#declare  Cube  =
mesh

triangle {
    <1.0, -1.0, 0.999999940395>,
    <1.0, -1.0, -1.0>,
    <-1.00000011921, -1.0, -0.999999821186>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.0599999986589,
0.0900000035763>,<0.490000009537, 0.0900000035763>}
triangle {
    <1.0, -1.0, 0.999999940395>,
    <-1.00000011921, -1.0, -0.999999821186>,
    <-0.999999642372, -1.0, 1.00000035763>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.490000009537,
0.0900000035763>,<0.899999976158, 0.0900000035763>}
triangle {
    <-1.00000011921, -1.0, -0.999999821186>,
    <-1.00000035763, 1.0, -0.999999642372>,
    <-0.999999940395, 1.0, 1.0>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.490000009537,
0.930000007153>,<0.899999976158, 0.930000007153>}
triangle {
    <-1.00000011921, -1.0, -0.999999821186>,
    <-0.999999940395, 1.0, 1.0>,
    <-0.999999642372, -1.0, 1.00000035763>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.899999976158,
0.930000007153>,<0.899999976158, 0.0900000035763>}
}


light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <-0.617158889771, -0.680260896683, -0.0853833779693>
}
light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <0.996681690216, 1.01759016514, 0.654029071331>
}
light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <1.34552943707, -1.31237447262, -0.207159176469>
}
camera {
     perspective
     location <7, 1.66473960876, -3.36465549469>
     look_at <-0.082584125588, 0.339812439545, 0.723255069236>

     focal_point <-0.082584125588, 0.339812439545, 0.723255069236>
     right <1.33, 0, 0>
     up <0, 1, 0>
     angle 46.1092074856
}

object   {  Cube
     scale <1.0, 1.0, 1.0>
     rotate <0.0, 44.9999978371, 0.0>
     translate <0.0, 0.0, 0.0>
     texture {foo}
}


Post a reply to this message

From: Warp
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 10:50:39
Message: <3eedd93f@news.povray.org>
Does the bump mapping work ok (ie. taking into account UV information)
when you specify the uv_mapping keyword only once at the beginning of
the texture declaration? It's difficult to see from the given example
if the image looks like it should or not.

  If it works ok, then I think this is just some kind of bug in the parser.
If the uv_mapping keyword appears twice in the texture block, it seems
to reset the previous pigment definition. (If you leave the second
uv_mapping only, it causes an error message.)

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Manuel
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 14:53:03
Message: <3eee120f@news.povray.org>
>   If it works ok, then I think this is just some kind of bug in the
parser.
> If the uv_mapping keyword appears twice in the texture block, it seems
> to reset the previous pigment definition. (If you leave the second
> uv_mapping only, it causes an error message.)


You mean this can be a bug in povray3.5 ??


Post a reply to this message

From: Warp
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 15:23:28
Message: <3eee1930@news.povray.org>
Manuel <man### [at] tinit> wrote:
> You mean this can be a bug in povray3.5 ??

  Yes, as far as I can see it, it may well be.
  It would still be good to know if the normals work ok when uv_mapping
is specified only once. Can you check it please?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Manuel
Subject: Re: Using png to normal uv mapping
Date: 16 Jun 2003 16:22:21
Message: <3eee26fd@news.povray.org>
>   Yes, as far as I can see it, it may well be.
>   It would still be good to know if the normals work ok when uv_mapping
> is specified only once. Can you check it please?

If I write

#declare pluto =
texture

     uv_mapping pigment {White}
      normal { bump_map {png "texturebump.png" bump_size 5.0}}
     }

it work.


Post a reply to this message

From: Manuel
Subject: Re: Using png to normal uv mapping
Date: 18 Jun 2003 18:31:32
Message: <3ef0e844$1@news.povray.org>
In the segnalation of bug in povray.bugreports,
I see the phrase:

"When the second 'uv_mapping' is uncommented in the code below,
instead of giving an error message, the pigment is reset (POV-Ray
warns that "No pigment type given")."

This mean the uv_mapping bump after uv_mapping pigment
must give an error message?
If yes, why in the povray manual, in the section 6.7.7, the
legal sintax is:
------------------------QUOTE FROM MANUAL--------------------
texture {
 uv_mapping pigment{PIGMENT_BODY} | pigment{uv_mapping PIGMENT_BODY}
 uv_mapping normal {NORMAL_BODY } | normal {uv_mapping NORMAL_BODY }
 uv_mapping texture{TEXTURE_BODY} | texture{uv_mapping TEXTURE_BODY)
}
------------------------END QUOTE--------------------It seem legal a second
uv_mapping declaration.I'm confused.Thanks, and excuse me for my multiple
post of UVbug.Regards,             Manuel


Post a reply to this message

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