POV-Ray : Newsgroups : povray.advanced-users : Make moon ground like tiled textures Server Time
21 Nov 2024 07:27:06 EST (-0500)
  Make moon ground like tiled textures (Message 1 to 4 of 4)  
From: Warren
Subject: Make moon ground like tiled textures
Date: 7 Aug 2022 07:05:00
Message: <web.62ef9bb3d944a28168fd1a5de756b296@news.povray.org>
Hello/Hi

I'm currently trying to make moon ground textures that would fit perfectly for
tile mapping
I tried to achieve this with the following concept, if for example, you use
(let's say) the wrinkles and the crackle pattern like
this:
----
#declare CracklePig =
pigment{ crackle color_map{
[ 0 color srgb 1 ]
[ 0.05 color srgb 0 ]
[ 0.95 color srgb 0 ]
[ 1.0 color srgb 1 ]
} }
#declare WrinklesPig =
pigment{ wrinkles color_map{
[ 0.33 color srgb 0 ]
[ 0.66 color srgb 1 ]
} }

#declare FinalPig =
pigment{ gradient z pigment_map{ [ 0.33 CracklePig ][ 0.66 WrinklesPig ] } }

plane{y, 0 pigment{ FinalPig } }
----
Here, povray will make a smooth transition between the two 'redefined'
CracklePig and WrinklesPig in 'FinalPig'.


I tried to achieved the same with a code like this so that the wrinkles pattern
loops back on z:
----
#macro MakePig(TranslateVect)
    wrinkles translate TranslateVect
#end

#declare FinalPig = pigment{ gradient z pigment_map{
[0 MakePig(< 0, 0, 0 >) ]
[0.2 MakePig(< 0, 0, 0 >) ]
[0.8 MakePig(< 0, 0, 0.8 >) ]
[1.0 MakePig(< 0, 0, 0.8 >) ]

plane{y, 0 pigment{ FinalPig } }
----
But that doesn't work, there is a break in the 'gradient' pattern continuity on
z. Eventually, if that had worked I would have made an 'isosurface' with a
'#declare PlaneFunc = function{ y }' and the above Pigment (with .gray keyword
of course).
So my question is: Is it possible to make some kind of tile texture with fractal
noise patterns like 'wrinkles' that would be perfect for tile mapping ?
Or maybe I'm mistaking about how the fractal noise patterns work ?
Do you have a technique I didn't think about to achieve this ?

I'm attaching a image to give you an example of what I want to achieve (but that
image doesn't work 'well' for tile mapping).

Thank you.


Post a reply to this message

From: Warren
Subject: Re: Make moon ground like tiled textures
Date: 7 Aug 2022 09:00:01
Message: <web.62efb6807a9453dc68fd1a5de756b296@news.povray.org>
I remarked that the image isn't attached in the precedent post
Another try with this one:


Post a reply to this message


Attachments:
Download 'outputimage.png' (211 KB)

Preview of image 'outputimage.png'
outputimage.png


 

From: William F Pokorny
Subject: Re: Make moon ground like tiled textures
Date: 9 Aug 2022 11:37:10
Message: <62f27f26$1@news.povray.org>
On 8/7/22 07:04, Warren wrote:
> Hello/Hi
> 
> I'm currently trying to make moon ground textures that would fit perfectly for
> tile mapping

Unsure exactly what you are after, but a quick way to tile any 3D 
texture is to use warp's repeat and flip as modifiers to the pattern.

warp { repeat x flip x }
warp { repeat y flip y }
warp { repeat z flip z }

If you want to tile any existing image used as a planar image map you'd 
use just:

warp { repeat x flip x }
warp { repeat y flip y }

You can implement other kinds of tiling, but there it comes to working 
out the details yourself.

Bill P.


Post a reply to this message

From: Warren
Subject: Re: Make moon ground like tiled textures
Date: 13 Aug 2022 07:20:00
Message: <web.62f7886b7a9453dc68fd1a5de756b296@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 8/7/22 07:04, Warren wrote:
> > Hello/Hi
> >
> > I'm currently trying to make moon ground textures that would fit perfectly for
> > tile mapping
>
> Unsure exactly what you are after, but a quick way to tile any 3D
> texture is to use warp's repeat and flip as modifiers to the pattern.
>
> warp { repeat x flip x }
> warp { repeat y flip y }
> warp { repeat z flip z }
>
> If you want to tile any existing image used as a planar image map you'd
> use just:
>
> warp { repeat x flip x }
> warp { repeat y flip y }
>
> You can implement other kinds of tiling, but there it comes to working
> out the details yourself.
>
> Bill P.

Your technique/hint works like a charm (with some adaptation), thank you very
much for your help William ;-D .

Here is the final code to make a tile texture (for those interested):
The 'scene.pov' file:
#version 3.7;

global_settings{ assumed_gamma 1.0 }

#declare ViewWidth = 2;
#declare WidthNumber = 6;
#declare HeightNumber = 3;
#declare FinalWidth = ViewWidth * WidthNumber;
#declare FinalHeight = ViewWidth * HeightNumber;

camera{
    orthographic
    location < FinalWidth / 2, 100, FinalHeight / 2 >
    look_at < FinalWidth / 2, 0, FinalHeight / 2 >
    sky z
    direction -100 * y
    right FinalWidth * x
    up FinalHeight * z
}

light_source{ < 1, 2, 1 > * 1000 color srgb 1 }

//Include file to get colors for the rendered texture ( GrayGroundCol and
MarsCol colors )
#include "../../../../includes/colorsMercenaires.inc"

#declare ColorArray = array[2]{ GrayGroundCol, MarsCol }

#declare PlaneFunc = function{ y }

#declare WrinklesFunc = function{ pattern{ wrinkles
                                           warp{ repeat FinalWidth * x flip
FinalWidth * x }
                               warp{ repeat FinalHeight * z flip FinalHeight * z
}
                      }
            }

#declare IsoGround =
isosurface{
 function{ PlaneFunc(x,y,z)
   - WrinklesFunc(x,y,z) * 0.25
 }
 max_gradient 2
    accuracy 0.001
    contained_by{ box{  < -FinalWidth * 2, -1, -FinalHeight * 2 >,
                        < FinalWidth * 2, 0.25, FinalHeight * 2 > } }
}

object{ IsoGround pigment{ ColorArray[ColorIndex] } }
------------------------------------------
And finally the ini file:

+Iscene.pov
+W384
+H192
+a0.3
+OoutputImage.png
Declare=ColorIndex=0
; can be 1 instead of 0 too, according to the color index in color array

-------------------------------------------
The final image is exactly what I wanted for a video game (i.e: perfect for tile
mapping).


Post a reply to this message


Attachments:
Download 'graylargetile.png' (73 KB)

Preview of image 'graylargetile.png'
graylargetile.png


 

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