Terrain Textures

Improving the artwork in Warzone2100 - not for mod discussions
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Terrain Textures

Post by cybersphinx »

MaNGusT wrote:ok, 512 was a mistake but also I tried to replace an old 128x128 decal by a new one 128x128 and in the game with standard zoom it looks blurred while the all new terrain textures in the background look good
Hm, can you post that, to test if it's not a problem of the engine?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Terrain Textures

Post by Per »

I do not have much opinion on what the max size of texture decals should be, but I would like to point out that the number of pixels that you can see at once in a rendering is not the limit at which point an increase in texture resolution ceases to have an impact to the crispness of the rendering. This is because each application of a texture to the scene is interpolated, and higher base resolution has increasing effect the more the texture is tilted in regards to the viewer. However, on the other hand, if you try to cram a too high detail texture on a too small area, it will look horrible because the details will be seen partially and mixed up.
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Terrain Textures

Post by MaNGusT »

And at maximum zoom, a tile is ~256 pixels wide.
I noticed that when I zoom in to max, decals increase their size but aren't visible after the borders of the tile.
cybersphinx wrote:Hm, can you post that, to test if it's not a problem of the engine?
Of course. :)
You do not have the required permissions to view the files attached to this post.
Image
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Terrain Textures

Post by cybersphinx »

Per wrote:I do not have much opinion on what the max size of texture decals should be, but I would like to point out that the number of pixels that you can see at once in a rendering is not the limit at which point an increase in texture resolution ceases to have an impact to the crispness of the rendering. This is because each application of a texture to the scene is interpolated, and higher base resolution has increasing effect the more the texture is tilted in regards to the viewer.
Hm, but when I look at a tile from above so it shows at 1:1 and then tilt it to the back (as happens with Warzone's camera), I squash the texture pixels in a smaller area. Not sure where more pixels would do any good there. I guess around 1:1 the pixels might get smudged together a bit, but as I said, I'm don't think that at usual zoom levels more than 128 is needed. It might sure make a difference at higher zoom levels, but for example the attached crater tiles are 49KB are for 128, 190 KB for 256, and 665 KB for 512. That's roughly an increase in size of 300% for the next level, and the result will only be visible at the lowest zoom levels.
MaNGusT wrote:I noticed that when I zoom in to max, decals increase their size but aren't visible after the borders of the tile.
Decals are one tile, not sure how easy that can be changed. But if they change size relative to the terrain, that sound wrong.
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Terrain Textures

Post by MaNGusT »

Decals are one tile, not sure how easy that can be changed. But if they change size relative to the terrain, that sound wrong.
look at the borders of the decal. looks like it has a bigger size than the tile or doesn't fit the tile, may be tile size is 120x120 or something similar? That happens for 64 decals too, so I think it's a bug.
Untitled.png
crater256.png
You do not have the required permissions to view the files attached to this post.
Image
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Terrain Textures

Post by cybersphinx »

Oh, that is probably Buginator's "lets cut off the tile borders to prevent seams" hack. I've intended for quite some time already to fix that the proper way, but haven't gotten around to it yet...
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Terrain Textures

Post by Zarel »

That's... a lot of border to cut off. Shouldn't we be cutting off just two pixels or so?
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Terrain Textures

Post by Buginator »

Ok, take one tile like so:
128.png
And now, we zoom in like so:
wz2100-20100803_223510-CAM_1END.png
The more you zoom out, then you get:
wz2100-20100803_223350-CAM_1END.jpg
and so on for 32 & 16 ...

Hope that clears things up.
Oh, and the game is currently hardcoded for 128x128 max for decals.
You do not have the required permissions to view the files attached to this post.
and it ends here.
User avatar
MaNGusT
Art contributor
Posts: 1154
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Terrain Textures

Post by MaNGusT »

Buginator wrote:Hope that clears things up.
Oh, and the game is currently hardcoded for 128x128 max for decals.
OK. why do we cut off the tiles?
Image
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Terrain Textures

Post by Zarel »

So around 9 pixels are being cut off from a 128x128 tile. Why?
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Terrain Textures

Post by lav_coyote25 »

because no one wants to fix it properly. right? :3 :3 :3 :3 :)
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Terrain Textures

Post by Zarel »

No, I'm asking why the decision was made to make the buffer zone that big specifically. It seems much higher than necessary.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Terrain Textures

Post by Buginator »

MaNGusT wrote:
Buginator wrote:Hope that clears things up.
Oh, and the game is currently hardcoded for 128x128 max for decals.
OK. why do we cut off the tiles?
It is the way we handle sampling and filters.
lav_coyote25 wrote:because no one wants to fix it properly. right? :3 :3 :3 :3 :)
It is a proper fix, is it the only way to do it ? No.
Zarel wrote:No, I'm asking why the decision was made to make the buffer zone that big specifically. It seems much higher than necessary.
Here, read this.
http://www.sjbaker.org/steve/omniv/tiling_textures.html that explains a bit more about this.

Oh, and I am not sure the way it is currently done is needed in trunk, since we do things differently than in 2.x

For those of you that forgot, here was the issue before: viewtopic.php?t=3203
and it ends here.
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Terrain Textures

Post by Safety0ff »

Buginator wrote:Here, read this.
http://www.sjbaker.org/steve/omniv/tiling_textures.html that explains a bit more about this.
Another reference (though some pages are missing): http://books.google.com/books?id=H4eYq7-2YhYC&pg=PA274

The other way to fix it would be to change the way the mosaics are created, which would give the proper spacing between tiles, the tradeoff is that the tiles won't be as dense in texture memory.

I wonder if it is possible to get away with using one pixel borders at all levels. :hmm:
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Terrain Textures

Post by cybersphinx »

Safety0ff wrote:I wonder if it is possible to get away with using one pixel borders at all levels. :hmm:
In theory, that works. But afaik, you need the same texture coordinates for all mipmap levels, so you need the lowest mipmap level expanded up (does that make sense?) regarding the space needed.