POV-Ray : Newsgroups : povray.general : Repeating texture sprite Server Time
23 Dec 2024 07:41:07 EST (-0500)
  Repeating texture sprite (Message 1 to 10 of 25)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Mike Horvath
Subject: Repeating texture sprite
Date: 29 Feb 2016 00:36:36
Message: <56d3d8e4$1@news.povray.org>
Can anyone recommend a way of creating sprites like these?

http://www.gamedev.net/page/resources/_/technical/game-programming/tilemap-based-game-techniques-handling-terrai-r934

The sprites need to join up together smoothly at the edges so you don't 
see a big seam between them. I was thinking of using the intersection of 
an squarish isosurface and a plane, but that will not necessarily line 
up at the edges.

Thoughts?


Mike


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 02:05:01
Message: <web.56d3ed363999a40fd6b6fe10@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> Can anyone recommend a way of creating sprites like these?
>
>
http://www.gamedev.net/page/resources/_/technical/game-programming/tilemap-based-game-techniques-handling-terrai-r934

>
> The sprites need to join up together smoothly at the edges so you don't
> see a big seam between them. I was thinking of using the intersection of
> an squarish isosurface and a plane, but that will not necessarily line
> up at the edges.
>
> Thoughts?
>
>
> Mike

1) Determine your terrain types
   e.g. desert, plains, beach, tundra, taiga, forest, boreal... etc.
2) make a 3x3 grid, and create a radial transition between each type
3) slice up the resulting image into tiles
4) create a map using large tiles, say 16x16, you might look at the diamond
square algorithm.  Limit your shades of grey to the number of different biomes

alternatively, you might use a 2d cellular automata: Split the tiles into
categories - center (can only border on it's own type), north edge (can only
connect to a south edge or a center of the border type...

https://www.youtube.com/watch?v=MFvsRvo_78Y

Regards,
A.D.B.


Post a reply to this message

From: Mike Horvath
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 06:47:28
Message: <56d42fd0$1@news.povray.org>
On 2/29/2016 2:03 AM, Anthony D. Baye wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> Can anyone recommend a way of creating sprites like these?
>>
>>
http://www.gamedev.net/page/resources/_/technical/game-programming/tilemap-based-game-techniques-handling-terrai-r934
>
>>
>> The sprites need to join up together smoothly at the edges so you don't
>> see a big seam between them. I was thinking of using the intersection of
>> an squarish isosurface and a plane, but that will not necessarily line
>> up at the edges.
>>
>> Thoughts?
>>
>>
>> Mike
>
> 1) Determine your terrain types
>     e.g. desert, plains, beach, tundra, taiga, forest, boreal... etc.
> 2) make a 3x3 grid, and create a radial transition between each type
> 3) slice up the resulting image into tiles
> 4) create a map using large tiles, say 16x16, you might look at the diamond
> square algorithm.  Limit your shades of grey to the number of different biomes

I don't quite get what you're saying. For instance, why would I want to 
use a radial texture map?

Also, does the diamond square algorithm repeat at its edges?

Mike

>
> alternatively, you might use a 2d cellular automata: Split the tiles into
> categories - center (can only border on it's own type), north edge (can only
> connect to a south edge or a center of the border type...
>
> https://www.youtube.com/watch?v=MFvsRvo_78Y
>
> Regards,
> A.D.B.
>
>


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 08:25:00
Message: <web.56d4458a3999a405e7df57c0@news.povray.org>
Not _quite_ following what you need.
Did you need to make these things:
http://uploads.gamedev.net/monthly_06_2011/ccs-8549-0-57863900-1307467523_thumb.gif
 ?


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 09:20:00
Message: <web.56d4534c3999a405e7df57c0@news.povray.org>
Argh.
Sorry.  I started reading this before enough, or any, coffee was consumed.

Anthony - that is some wicked cool stuff right there.
Thanks for that - I really enjoyed watching that guy bang out a nicely aligned
tile set in no time at all.   Very educational!

Mike - I think the two concepts are separate, but related.

The diamond-square algorithm can get you a nice terrain:

http://www.paulboxley.com/blog/2011/03/terrain-generation-mark-one
http://www.playfuljs.com/realistic-terrain-in-130-lines/
http://www.javaworld.com/article/2076745/learn-java/3d-graphic-java--render-fractal-landscapes.html

And it won't tile _if you generate it completely randomly_ .

So maybe what you do is take a cue from the video showing how it's done in
Photoshop and use that to keep the opposite edges of the large square the same.
Whatever's at 0,0 is what ought to be at 128,0.   Whatever's at 32,0 is what
32,128 ought to be.   That way if you did that double-half-displacement thing,
the edges would be identical.
You could probably do that at the time of generation or maybe even as a
post-generation interpolation across a wider swath.

I think if you check out the guy's tile set with the dirt and grass, you'll see
that it's a radial pattern / texture - akin to a circle in a square, but not
quite circumscribed.   The edges always match, and you get a nice solid center
tile.

If I'm following Anthony with his idea of generating shades of grey - then maybe
he's suggesting using a texture map.  Make one greyscale tile set, and then use
POV-Ray to put the right terrain on the different greys to generate the
transitions.   (I admit, I haven't thought it out completely, but I think that
might be what he's suggesting)


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 09:45:01
Message: <web.56d458f63999a40fd6b6fe10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Argh.
> Sorry.  I started reading this before enough, or any, coffee was consumed.
>
> Anthony - that is some wicked cool stuff right there.
> Thanks for that - I really enjoyed watching that guy bang out a nicely aligned
> tile set in no time at all.   Very educational!
>
> Mike - I think the two concepts are separate, but related.
>
> The diamond-square algorithm can get you a nice terrain:
>
> http://www.paulboxley.com/blog/2011/03/terrain-generation-mark-one
> http://www.playfuljs.com/realistic-terrain-in-130-lines/
>
http://www.javaworld.com/article/2076745/learn-java/3d-graphic-java--render-fractal-landscapes.html
>
> And it won't tile _if you generate it completely randomly_ .
>
> So maybe what you do is take a cue from the video showing how it's done in
> Photoshop and use that to keep the opposite edges of the large square the same.
> Whatever's at 0,0 is what ought to be at 128,0.   Whatever's at 32,0 is what
> 32,128 ought to be.   That way if you did that double-half-displacement thing,
> the edges would be identical.
> You could probably do that at the time of generation or maybe even as a
> post-generation interpolation across a wider swath.
>

The diamond square will tile if you wrap the calculation over the edges.

> I think if you check out the guy's tile set with the dirt and grass, you'll see
> that it's a radial pattern / texture - akin to a circle in a square, but not
> quite circumscribed.   The edges always match, and you get a nice solid center
> tile.
>
> If I'm following Anthony with his idea of generating shades of grey - then maybe
> he's suggesting using a texture map.  Make one greyscale tile set, and then use
> POV-Ray to put the right terrain on the different greys to generate the
> transitions.   (I admit, I haven't thought it out completely, but I think that
> might be what he's suggesting)

That's pretty much it.

Regards,
A.D.B.


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 10:50:00
Message: <web.56d468a63999a405e7df57c0@news.povray.org>
http://www.bluh.org/code-the-diamond-square-algorithm/

discusses "wrapping" over the edge.

http://www.mapeditor.org/    looked interesting if you're doing that kind of
work.


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 19:30:06
Message: <web.56d4e18b3999a40fd6b6fe10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> http://www.bluh.org/code-the-diamond-square-algorithm/
>
> discusses "wrapping" over the edge.
>
> http://www.mapeditor.org/    looked interesting if you're doing that kind of
> work.

I was thinking that if you assigned each tile a shade of gray, you could use the
value of each pixel to tell you what tiles to place.

here's some old code I wrote for the diamond square algorithm:
https://www.dropbox.com/s/wbr4h93jssm6pfn/dsquare.tar.gz?dl=0

comments are almost non-existant, and it's somewhat messy, but it's functional.
I included the makefile so you can build it easily.

usage is lScape5 width height

really, I could have just used one parameter, since the image has to be square.
Also, the dimensions have to be one pixel higher than a power of 2 for it to
work: eg. 257x257 or 513x513

Regards,
A.D.B.


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 22:05:01
Message: <web.56d5066b3999a405e7df57c0@news.povray.org>
I also just found this, from ... 1998

http://news.povray.org/povray.general/message/%3C01bde695%2434006a80%246a0e8dc3%40default%3E/#%3C01bde695%2434006a80%24
6a0e8dc3%40default%3E

Does anyone have a copy of this include file squirreled away on their hard
drive?
TdG probably has it, but it might take him all week to find it...   :D

Sounds pretty interesting though.


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Repeating texture sprite
Date: 29 Feb 2016 22:55:00
Message: <web.56d511733999a40fd6b6fe10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I also just found this, from ... 1998
>
>
http://news.povray.org/povray.general/message/%3C01bde695%2434006a80%246a0e8dc3%40default%3E/#%3C01bde695%2434006a80%
24
> 6a0e8dc3%40default%3E
>
> Does anyone have a copy of this include file squirreled away on their hard
> drive?
> TdG probably has it, but it might take him all week to find it...   :D
>
> Sounds pretty interesting though.

http://www.reocities.com/SiliconValley/Lakes/1434/tilegen.html

Regards,
A.D.B.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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