Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain tiles perspective merging #141

Closed
franciscod opened this issue Nov 7, 2014 · 12 comments
Closed

Terrain tiles perspective merging #141

franciscod opened this issue Nov 7, 2014 · 12 comments
Labels
area: renderer Concerns our graphics renderer improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects

Comments

@franciscod
Copy link
Contributor

franciscod commented Nov 7, 2014

Let's say i have the following terrain texture made by A Bad Guy (notice the colour dots in the alpha space)
15001 slp

The alpha space is outside the rhombus, so it'd be okay... right?

1415339142

NOPE! THE DOTS TRY TO REACH GABEN!

Basically each tile wastes half the space.

We should fix this 😀

@lilezek
Copy link

lilezek commented Nov 7, 2014

Does anyone what those dots are made for? Is it a bug from the media conversion? Or there are there in the original AOE?

@franciscod
Copy link
Contributor Author

i put them on the terrain file just for checking this bug :D

@mic-e
Copy link
Member

mic-e commented Nov 7, 2014

Hm... mmmaybe it's your own fault for placing the dots in the first place.

Regardless, speaking about terrain-preprocessing, maybe it would be best to store the terrain as one single rhombus.

@franciscod
Copy link
Contributor Author

that is a valid point too: we want to allow the modders to overflow the
conventional rhombus like i did with the dots?

@TheJJ
Copy link
Member

TheJJ commented Nov 8, 2014

Currently, half the space is wasted for drawing the terrain. I'd really like to merge the texture to one square sprite which is then rendered in perspective to achieve the rhombus form again. This whould allow rendering same terrain areas with the same texture and even make use of the texture-unit's overflow wrapper that just repeats the texture.

@mic-e
Copy link
Member

mic-e commented Nov 8, 2014

I don't think we'll be able to achieve the pixel-by-pixel stock look with perspective rendering.

@mic-e
Copy link
Member

mic-e commented Nov 8, 2014

openage_2014-11-08_02-11-32_00

@franciscod
Copy link
Contributor Author

nice idea mic-e!

@goto-bus-stop
Copy link
Contributor

I'd really like to merge the texture to one square sprite which is then rendered in perspective to achieve the rhombus form again.

This is exactly what HD Edition does: (although it does ship with the old, now unused terrain.drs)

Age2HD terrain textures

@lilezek
Copy link

lilezek commented Nov 11, 2014

@goto-bus-stop As mic-e said in irc, the goal is avoiding the need of applying any transform. With his example (the image with the drawing) you need to cut the texture, but you don't need to apply any other transform.

@TheJJ TheJJ added lang: c++ Done in C++ code improvement Enhancement of an existing component labels Feb 7, 2015
@TheJJ
Copy link
Member

TheJJ commented Aug 16, 2015

We could do perspective rendering of the terrain in theory with the new renderer (#287), but i'll try to implement the single-quad idea. Otherwise we'd have to transform the original terrain tiles to be non-perspective to render them perspectively again later.
Perspective rendering would be required though once aoe:hd removes the legacy files and just ships the terrain textures directly (which will happen one day..)

So I'll prepare perspective terrain rendering (but for that the coordinate system has to be improved..) but implement the above squaring of the terrain tiles.

Then again, to implement the terrain blending in the shader efficiently, rendering the terrain as a non-perspective plane makes it much easier to split at tile boundaries. Rendering the resulting fragments perspectively makes it look right again but is no more effort then.

@TheJJ TheJJ mentioned this issue Aug 16, 2015
42 tasks
@TheJJ TheJJ changed the title Terrain tiles should be masked on loading Terrain tiles perspective merging Aug 16, 2015
@TheJJ TheJJ moved this from TODO to input in renderer Feb 15, 2017
@TheJJ TheJJ added the area: renderer Concerns our graphics renderer label Apr 21, 2017
@TheJJ TheJJ moved this from input to todo in renderer May 2, 2018
@Vtec234 Vtec234 mentioned this issue Jun 30, 2018
@heinezen
Copy link
Member

heinezen commented Apr 2, 2023

Implemented in #1497

@heinezen heinezen closed this as completed Apr 2, 2023
renderer automation moved this from todo to done Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
No open projects
renderer
  
done
Development

No branches or pull requests

6 participants