[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Blended tile systems
On Oct 14, 2008, at 1:25 AM, Knapp wrote:
I think you are talking about something very similar to "texture
splatting",
described in excellent detail here:
[..]
of time for each texture tile.
Does this make more sense now?
Sure, using texture splatting would give a bit more of a naturalistic
look. It accomplishes much the same thing, you use arbitrarily large
textures for each type or terrain and "splat" them onto whichever
tiles have the terrain type corresponding to the texture. Adjacent
tiles of the same type are seamless and the individual tile "squares"
are not obvious. Using OpenGL means I don't do "blitting" per-se, I
just calculate the mesh vertices and texture coordinates. The latter
are basically just continuous. Then the texture for each tile type is
laid down masked by a "splat" texture that only lets it show through
in the appropriate places. I don't draw each tile individually,
instead chunks of tiles are drawn at once, with nearly all of work
happening in the hardware. Since you are redrawing the same mesh
repeatedly, you get nearly ideal throughput from the graphics card
which typically has caches that optimize this case.
[..]
Are you talking 2d or 3d?
The map is strictly 2d, but the rendering is 3d. The textures do not
have any depth by themselves (e.g., there are no mountain or canyon
like textures), instead height variations are represented by the
height of the tile mesh. Note that you need not do it this way, you
could instead have a simpler flat mesh and shade the textures to give
the illusion of height like in your example.
It does support arbitrarily large maps by dividing the mesh and
textures
into chunks, so it can draw only the visible chunks. It does not
support
more advanced features like automagic LOD control, which isn't
useful for an
iso game not drawn in perspective.
I don't have a screenshot of the current code handy, but I could
post one if
you like.
You mean a screen shot of the pictures the code makes right? Yes, I
would love to see that.
Here's an example screenshot. Note this map is fairly flat and doesn't
really show off all of the different terrain types, but it gives you
the general idea:
http://picasaweb.google.com/casey.duncan/Mechazoid#5257032978315813906
-Casey