Models by MaNGusT (AR)

Improving the artwork in Warzone2100 - not for mod discussions
User avatar
MaNGusT
Art contributor
Posts: 1111
Joined: 22 Sep 2006, 10:31
Location: Polar region, Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT » 05 Jul 2020, 16:39

Found a way to make contours on terrain textures trsansitions. What do you think?
ezgif-2-9f09e75058d0.gif
ezgif-2-11e83bdfa137.gif
just looks not that flat :ninja:
Image

Cyp
Evitcani
Evitcani
Posts: 780
Joined: 17 Jan 2010, 23:35

Re: Models by MaNGusT (AR)

Post by Cyp » 06 Jul 2020, 08:36

The blend factors for all terrain types should probably sum to 1, so it doesn't give light/dark bands.

User avatar
MaNGusT
Art contributor
Posts: 1111
Joined: 22 Sep 2006, 10:31
Location: Polar region, Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT » 06 Jul 2020, 15:31

Cyp wrote:
06 Jul 2020, 08:36
The blend factors for all terrain types should probably sum to 1, so it doesn't give light/dark bands.
Just wanted to outline textures transitions or make it sharper.
UPD: now it only darkens transitions.
ezgif.com-crop.gif
Image

aliswe
Trained
Trained
Posts: 63
Joined: 01 Apr 2020, 22:11

Re: Models by MaNGusT (AR)

Post by aliswe » 31 Aug 2020, 00:14

I guess the last one looks better than the original, as it makes it more interesting.

nick87720z
Trained
Trained
Posts: 104
Joined: 25 Feb 2014, 16:37

Re: Models by MaNGusT (AR)

Post by nick87720z » 07 Dec 2020, 14:16

MaNGusT wrote:
06 Jul 2020, 15:31
Cyp wrote:
06 Jul 2020, 08:36
The blend factors for all terrain types should probably sum to 1, so it doesn't give light/dark bands.
Just wanted to outline textures transitions or make it sharper.
UPD: now it only darkens transitions.
ezgif.com-crop.gif
This is more about coding, but for above post.

I'm not sure if correctly understood point of this post. It seems for me that it's about blending problem. I had some experience, while playing with cairo graphics, trying to solve some common artifacts, affecting any composited graphics, be it 2d or 3d. Some notes may be useless if those issues are already handled properly (I'm totally out of dev context here).

1. Unexpected transparency border between two stiched surfaces. Originaly I remember very sharp artifacts, appearing if antialiasing is not applied to some edjes (afaik, bilinear..anisotropic options are about texture filtering, which is not same as antialiasing).
But even if shaping AA is applied, uncareful compositing also leads to artifacts, though less visible. It is certain to happen in such naive rendering way, when objects are rendered one by one, with full antialiasing (including shape AA), then composited in mix blending mode. Reason - shaping AA is not translucency. If two surfaces share same pixel, their colors don't mix as with translucency. They sum. And that's not alpha-based additive blending mode. Alpha channel here is just another channel, like R,G,B, which must be summed - simply, without any multipliers (well - assuming, at least for premultiplied RGBA format). Exact shaping alpha values represent coverage for proper object.
In naive mode, when stiching in mixing mode, each color part is mixed with background, with final result getting unexpected transparency where it should not be.

I could propose following rendering sequence for solution, with not so deep required modifications:
- render shape into separate texture. Shaping AA must be disabled, but what is important - binary shape mask should include all pixels with any non-zero fulling, not just those with coverage >=0.5.
- draw shape surface to stiching surface in additive blending (as described above). If done correctly, overlapping pixels at edges will sum, forming what you need. Even for transparent materials, even if they have different translucency.

NOTE: any compositing, required by material properties (including translucency) must be done _before_ stiching. If stiched surfaces have dufferent transparency - breaking this rule will break some proportions.

I would also propose this way:
- detect all pixels, covered by any visible edges (not behind opaque objects). Add then to mask.
- render everything out of mask in whatever you like (naive) mode
- render pixels in mask in special mode, with shaping AA as finishing step, just before to _add_ to common result.

There could be cheaper solution for specific case when one of two stiched surfaces is opaque. Stack opaque surf above transparent and extend transparent one to at least one pixel at output device scale.

1.1. Not sure that uncovered, but still worthy to mention - if some point or line has width <1px, it should be cast to =1px, but with alpha correction, very similar to shaping (and of course with subpixel positioning with proper shaping AA). Well... I'm not sure, if such careful rendering is mandatory for games - at least some antialiasing filters easily negate such problem, though they also make picture somewhat blurry.

2. To above post. If textures fade one to other, they are better be opaque (without effects like shadows, light). For mixing mode bottom texture must be opaque everywhere, with above one fading via alpha. Probably additive stiching approach could be used too, but not sure whether such resource waste is worthy.

Edit: Ohh, I really did not get point of that post. If sharpened contours are intentional - more like art effect. I'm sure, that both sharp and soft transitions would be ok (sharpness also could be non-boolean ranged parameter). Or may be just transition distance.

User avatar
MaNGusT
Art contributor
Posts: 1111
Joined: 22 Sep 2006, 10:31
Location: Polar region, Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT » 07 Dec 2020, 21:07

nick87720z wrote:
07 Dec 2020, 14:16
Edit: Ohh, I really did not get point of that post.
I welcome such flow of thoughts :D
I think, the result I did want to get is something you have described above. 25%(or even less) of mixed textures should be overlapped with 50% transparancy. :)
As you can see, I failed. Mixed parts are darkened.
Image

Post Reply