|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have a torus that I would like to wrap a bitmapped texture around. So, I
have something like
torus {
1, 0.05
pigment {
image_map {
png "image_for_torus.png"
map_type 5 // or even just uv_mapping, since torus {} has it
// ...
}
}
}
Well, this works as advertised. The problem is that the texture image would
need to be 20 times as long as it is high to maintain an equal resolution
in both the U and V directions. if I use a texture 256 pixels high this
implies that I need to make it over 5000 pixels across to get constant
resolution, which seems a bit excessive. I'm using a torus instead of a
mesh to save memory, and using such a large texture means more memory use.
It would be nice to be able to tile it, but the toroidal mapping explicitly
prevents this. Is there a way to do this while keeping the toroidal mapping?
Tom
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Never mind, this seems to work well enough for my purpose:
pigment {
image_map {
png "image_for_torus.png"
map_type 0
interpolate 2
}
scale 0.02 // produces the tiling effect
warp {
toroidal
orientation y // default torus is oriented with the X-Z plane
}
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tom York" <alp### [at] zubenelgenubi34spcom> wrote:
> I have a torus that I would like to wrap a bitmapped texture around. So, I
> have something like
>
> torus {
> 1, 0.05
>
> pigment {
> image_map {
> png "image_for_torus.png"
> map_type 5 // or even just uv_mapping, since torus {} has it
> // ...
> }
> }
> }
>
> Well, this works as advertised. The problem is that the texture image would
> need to be 20 times as long as it is high to maintain an equal resolution
> in both the U and V directions. if I use a texture 256 pixels high this
> implies that I need to make it over 5000 pixels across to get constant
> resolution, which seems a bit excessive. I'm using a torus instead of a
> mesh to save memory, and using such a large texture means more memory use.
> It would be nice to be able to tile it, but the toroidal mapping explicitly
> prevents this. Is there a way to do this while keeping the toroidal mapping?
You can use a tiled image map, but you have to do it in stages. The trick is
to use a function image (3.5.11.16 in the 3.6 docs), also referred to as the
function internal bitmap, in the index.
First, create a pigment from your image using map_type 0. Then create the
pigment for the torus, using the first pigment as the function for the
function image. Something like this (untested!):
#declare PFlat =
pigment {
image_map {
png "image_for_torus.png"
}
}
#declare PTorus =
pigment {
image_map {
function 2000,100 {
pigment {PFlat}
}
map_type 5
}
}
You'll also need to do some scaling (somewhere) to get the 20 repetitions.
I don't know how this will affect memory requirements or rendering speed -
it might work out better to just tile your image first with another
program.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"PM 2Ring" <nomail@nomail> wrote:
> You can use a tiled image map, but you have to do it in stages. The trick is
> to use a function image (3.5.11.16 in the 3.6 docs), also referred to as the
> function internal bitmap, in the index.
I think the principle here is similar to what I came up with, but yours
looks more direct for images. Thanks!
> I don't know how this will affect memory requirements or rendering speed -
> it might work out better to just tile your image first with another
> program.
Oh, very little for this sort of size. I just objected on philosophical
grounds to having to tile a texture by hand! And the advantage of tiling it
in POV is that I could (should the madness take me) easily layer several
copies of the same texture, each with different numbers of repetitions, to
create a more complicated surface.
Thanks,
Tom
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|