Mirroring Decals/Props/Units

Interesting mapping tools and mapping help.

Moderator: Morax

Re: Mirroring Decals/Props/Units

Postby nine2 » 16 Apr 2017, 03:42

We'll just mirror the normal as well.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Mirroring Decals/Props/Units

Postby b2ag » 16 Apr 2017, 18:47

Anihilnine wrote:We'll just mirror the normal as well.


You gave a really good hint here. I successfully fixed wrong normals by swapping channel green and alpha for the mirrored decals. Thanks!

EDIT:

Current WIP-Version:
https://pastebin.com/kNctKNMq
Features:
- mirrors decals, props and units positions
- mirrors decal albedos and normals
- rotates props to look better after position is mirrored
- replaces unit types with mirror version for a few walls
- mirrors heightmap (only left-right yet)
Requirements:
- python-lupa (to read in "_save.lua")
- ImageMagick (to transfrom decals and heightmap)
- python 3 (maybe even 3.5 or 3.6)
Limitations:
- only left-right and diagonal top-left to bottom-right mirror options are tested/implemented
- you have to find and change the hard-coded path to my env.scd file to use decal texture mirror
- script could miss out on units in places I've never seen in the one _save.lua I've used for testing

Have fun!

PS: This huge file should be split up into at least three files, but probably even more :oops:
b2ag
Crusader
 
Posts: 17
Joined: 02 Apr 2017, 10:58
Has liked: 6 times
Been liked: 9 times
FAF User Name: b2ag

Re: Mirroring Decals/Props/Units

Postby b2ag » 04 May 2017, 02:34

Script made it's way to Github: https://github.com/b2ag/scmap_mirror_tool
b2ag
Crusader
 
Posts: 17
Joined: 02 Apr 2017, 10:58
Has liked: 6 times
Been liked: 9 times
FAF User Name: b2ag

Re: Mirroring Decals/Props/Units

Postby nine2 » 05 May 2017, 05:28

So I guess the mirrored version of each decal needs to get added to faf codebase now right?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Mirroring Decals/Props/Units

Postby b2ag » 17 May 2017, 22:09

Anihilnine wrote:So I guess the mirrored version of each decal needs to get added to faf codebase now right?

Currently the script places the mirror versions of decals in a sub folder of the map folder. To prevent having two mirrored versions for the same decal when used in two different maps, we would need to add them to faf codebase to save some space, yes.
I'm not yet satisfied with mirrored normals for decals, because swapping 8 bit alpha and 6 bit green channel can result in a serious amount of artifacts. I plan to save normal uncompressed or something to get rid of these artifacts, but didn't tried it yet. Also I'm currently looking into mirroring meshes of units (scm files) :roll:
b2ag
Crusader
 
Posts: 17
Joined: 02 Apr 2017, 10:58
Has liked: 6 times
Been liked: 9 times
FAF User Name: b2ag

Previous

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest