POV-Ray : Newsgroups : povray.general : material_map Server Time
17 Nov 2024 21:22:06 EST (-0500)
  material_map (Message 1 to 4 of 4)  
From: Rafal 'Raf256' Maj
Subject: material_map
Date: 30 Dec 2002 06:09:35
Message: <Xns92F47B6B6CB33raf256com@204.213.191.226>
Can I scale only image that is used in material_map leaving all used 
textures unchanged ? 
I.e. I have 

box { ... 
  texture {
    material_map { png "..."
      texture { A }
      texture { B }
    }
  } 
}

textures A & B are i.e. bozo. And now I want to streach image to cover 
entire box but WITHOUT changing scale of texture A and B I have to do :

  texture { #local S=<2,3,1>;
    material_map { png "..."
      texture { A scale 1/S }
      texture { B scale 1/S }
    }
    scale S
  } 

and if I want to use other transforms - it gets more complicated and little 
uncomfortable IMHO


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Philippe Debar
Subject: Re: material_map
Date: 30 Dec 2002 06:57:42
Message: <3e1034b6$1@news.povray.org>
You could declare your transform and use the transform{MyTransform
inverse}syntax in child textures. I seem to remember there is a keyword that
makes the child texture independant from the parent's modifiers, but I could
not find it. Maybe it was a MegaPov feature ?

Povingly,


Philippe


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: material_map
Date: 30 Dec 2002 07:04:19
Message: <3e103643@news.povray.org>
Rafal 'Raf256' Maj wrote:

> Can I scale only image that is used in material_map leaving all used
> textures unchanged ?

You could use an image_pattern inside a pigment_pattern instead, it can 
essentially do everything a material_map can, but it is more versatile. 
Something like this should work:

texture {
  pigment_pattern {
    image_pattern { png "img.png" /*...*/ }
    // Do your transformations here
  }
  // Given an 8-bit grayscale image, this 
  // simulates the material_map behaviour.
  texture_map {
    [0 Tex1 ]
    [1/256 Tex1 ]
    [1/256 Tex2 ]
    [2/256 Tex2 ]
    [2/256 Tex3 ]
    [3/256 Tex3 ]
    // ...
  }
}


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: material_map
Date: 30 Dec 2002 07:07:02
Message: <3e1036e5@news.povray.org>
Philippe Debar wrote:

> I seem to remember there is a keyword that makes the child texture
> independant from the parent's modifiers, but I could not find it. 
> Maybe it was a MegaPov feature ?

Yep, the reset_children keyword. IIRC it was deprecated in favor of 
pigment_pattern during the development of 3.5.


Post a reply to this message

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