Graphics engine

Simie
Posts: 2
Joined: Mon Jun 20, 2011 12:31 am

Re: Development progress images

Postby Simie » Mon Jun 20, 2011 12:35 am

Hi blejdaq,

Continuing my questions from the AoK heaven forums here (to prevent filling up the other thread).

You said you are using the AoK diamond tiles. How are you using these with a standard terrain heightmap like this?
Image

Surely they would look pretty odd if you just tiled them without transforming them in some way?


Simie

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Development progress images

Postby blejdaq » Mon Jun 20, 2011 1:26 am

Hi Simie.

I tried to explain it to you in the AoK Graphics thread but let's repeat:

Image

A polygon has 4 vertices, each vertex has position (world coordinates, when making 2D engine all your Z = 0) and texture coordinates. If you elevate some of the polygon's vertices you only move its world Y coordinate and keep the texture coordinates and let hw rasterizer do all the dirty work for you. Your engine looks like it's using 3 dimensions so when elevating a tile, just raise the tile's vertex's Z coordinate and keep the texture coordinates. It should do the work.

Simie
Posts: 2
Joined: Mon Jun 20, 2011 12:31 am

Re: Development progress images

Postby Simie » Mon Jun 20, 2011 11:48 am

blejdaq wrote:Hi Simie.

I tried to explain it to you in the AoK Graphics thread but let's repeat:

Image

A polygon has 4 vertices, each vertex has position (world coordinates, when making 2D engine all your Z = 0) and texture coordinates. If you elevate some of the polygon's vertices you only move its world Y coordinate and keep the texture coordinates and let hw rasterizer do all the dirty work for you. Your engine looks like it's using 3 dimensions so when elevating a tile, just raise the tile's vertex's Z coordinate and keep the texture coordinates. It should do the work.


Hey blejdaq,

I understand the method behind modifying the vertex coords to create the elevation effect (the screenshot I showed you uses it). The problem I have is that the AoK tiles are already in isometric perspective, if they are simply used as a texture for the terrain it looks pretty crazy. Do you use quads orientated to face the screen or 3D terrain with the tiles applied onto them in some way?


Sorry if I'm missing something, graphics programming is not my forté, and thanks for the info so far.


Simie


EDIT:

Here is an example of what I'm talking about...

Image


EDIT2:


Aha! I get what you were saying now. I was assuming that the orange border in your diagram was the quad for some reason. It's much clearer now :-)

Jon321
Posts: 4
Joined: Mon Jun 20, 2011 12:48 pm

Re: Development progress images

Postby Jon321 » Mon Jun 20, 2011 12:52 pm

How are isometric tile images stored in memory? if you but into a square image format, wont half the image be blank? wonder is it possible to use the slp "commands" to draw isometric tiles each frame...

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Graphics engine

Postby blejdaq » Mon Jun 20, 2011 2:16 pm

@Simie, i'm glad it's finally clear :)

@Jon321, it was good idea back in times when there wasn't much available memory. Today it would be difficult for DirectX/OpenGL to understand your data format i guess.


Return to “Technical discussion”

Who is online

Users browsing this forum: No registered users and 19 guests

cron