|
 |
William F Pokorny <ano### [at] anonymous org> 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'

|
 |