POV-Ray : Newsgroups : povray.binaries.images : What about repeat and offset with image / bump maps? : Re: What about repeat and offset with image / bump maps? Server Time
5 Nov 2024 20:17:16 EST (-0500)
  Re: What about repeat and offset with image / bump maps?  
From: Kenneth
Date: 3 Mar 2023 02:05:00
Message: <web.64019b999e80f4689b4924336e066e29@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> As we were playing around with image_maps and height_fields, I was
> reminded there is support for the keywords 'repeat' and 'offset' in the
> image_map and bump_map code.
>
They're still there in v3.8, in the docs at "3.6.2.5.5 Warp"

I remembered 'repeat' and 'offset', but not 'flip'.
>
> Attached an image with traditional 'once' map on the left. In the middle
> using repeat <2,2> (how many/much in 1x1) and offset <0.5,0.5>
> (accounting for 2x repeats in 1x1).

The  middle image shows only one smaller image_map; should there be two instead?

I just tried this warp {repeat...} stuff on the function height_fields that
we've been discussing recently-- to try another way to eliminate the 'mirror
flipping in z' of the HF result. It WORKS! (with a certain configuration of the
warp items that's not yet understandable to me)-- and successfully takes the
place of the (1-y) fix that's required when the function is used later. The same
warp construction works for BOTH an image_map-to-function-to-HF, as well as
typical patterns like 'onion' and granite' (the only patterns I've tested so
far). Thanks for suggesting this; now we have *multiple* ways to fix the HF
mirroring flaw.

Example 1:
#declare somb =
function{
     pigment{
         image_map{png "...MY_IMAGE..." once}
         warp{repeat -y offset -y flip -y} // OR warp{repeat -x flip y}
            }
        }

Example 2:
#declare somb =
function{
     pigment{
         granite scale 2
         warp{repeat -y offset -y flip -y}
            }
        }


Post a reply to this message

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