Jump to content

[ktools] How is ktech --atlas supposed to work?


Recommended Posts

Hi all. So from the help output:

Quote

    --atlas  <path>

         Name of the atlas to be generated

How exactly should that work? My understanding is that since a texture's image width and height must be powers of 2, the atlas xml file is there to specify which part of the image is the part that should actuallly be "active" (respond to mouse clicks and occlude the rest of the game).

My expectation is that ktech would automatically get the first/last row/columm with a pixel of non-zero opacity and set the atlas values accordingly. But using a source image like the one attached, the atlas is always generated with values:

u1="0.000976562" u2="0.999023" v1="0.000976562" v2="0.999023"

Am I missing something?

ui_magicpouch_3x3.png

Edited by myxal
fix brainfart/clarification
Link to comment
Share on other sites

10 hours ago, myxal said:

the atlas xml file is there to specify which part of the image is the part that should actuallly be "active" (respond to mouse clicks and occlude the rest of the game)

The opaque parts are the "active" clickable parts.

Doesn't really matter how precisely you chop the image. Well, if you don't manually chop opaque parts that is.

If you have several images though, you want to have atlas values that care about chopping each image separately, but I don't think ktech supports getting dumped a whole bunch of differently sized pngs.

Edited by DarkXero
Link to comment
Share on other sites

3 hours ago, DarkXero said:

The opaque parts are the "active" clickable parts.

Doesn't really matter how precisely you chop the image. Well, if you don't manually chop opaque parts that is.

Hm, this appears to be true for in-world objects - I can obviously tell that an evergreen doesn't have a rectangular active area. ;)

The texture above however, is used for a widget. Before I fixed it, a blank area outside the opaque part would block access to the in-world objects - imagine a tree next to a chest's inventory widget not being clickable because the inventory frame was not chopped properly. If you run the image through ktech and have it generate an atlas, you can see for yourself.

As for in-world objects - I am actually having an issue with that as well, the freezer will respond by closing/opening to clicks well outside the visibly opaque areas. I fixed the atlas for all individual tex files, but I'm guessing the in-world object uses the anim archive. I'll have to dig into that and check what might be wrong there. If the tex files are any indication, there are probably some smudges of low-but-not-zero opacity in the lower part.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...