WoWExportTools icon indicating copy to clipboard operation
WoWExportTools copied to clipboard

ADT Splat/Alpha textures

Open HelloKitty opened this issue 8 years ago • 3 comments

Hi, it would be beneficial to export the data used to generate the ADT's 8k texture that you allow for exporting. There are many usecases where it is needed to control PBR values per ground texture, and normals, which can't be done with one massive 8k terrain texture.

I am not entirely familar with the ADT filetype but it appears that since you're able to render out the final version you should also be able to render out the splat/alpha/control textures used to create it.

HelloKitty avatar Aug 12 '17 09:08 HelloKitty

There's quite a lot of complexity involved in getting the textures to blend correctly. Not sure this is doable right now, sorry. Maybe once I've improved my knowledge a bit. I'll keep this open.

Marlamin avatar Aug 12 '17 09:08 Marlamin

I don't think you should try to blend these textures. You actually cannot to get a correct result afaik. This is the faulty path that tools like Machinma Studio went down. Since each tiny tile of the ADT chunk can have unique texture layers, as far as I understand, each tile as an individual chunk would need to be exported. Not a singular mesh like done currently by you or Machinma Studio.

Exporting MCAL contents individually and the MCNK as 256 individual tiles is preferable for actual use. That may sound ridiculous but under the right setup these will be rendered mostly together anyway. These MCAL textures could be "atlas'd" as Texture2DArray and individual tiles could be given UVs that match their index in the atlas/array. Or they could be atlased the old fashion way. Let users deal with that though. Honestly, other people can do this once they get the content. Right now no tool is willing to produce the 256 alpha map textures and tiles.

Many tiles in a zone are going to share similar texture references and thus could be consolidated into a single material. This is critical for draw call batching. This is what is needed for realtime rendering of the terrain. All other implementations are just hacks.

You don't have to worry about that though, I only mentioned/stated that stuff to provide the usecase. If you can produce the individual MCAL alpha textures and MCNK subtiles (is that a good name?) then others can do the rest.

HelloKitty avatar Mar 30 '18 07:03 HelloKitty

Currently (as of the recent shader fix), the generated texture is very close to Blizzard's albeit slightly lower quality. I agree that it's still not an optimal way of doing it, but quite frankly it is the most user friendly one.

When working with raw textures, one has to rebuild Blizzard's terrain shader in whatever application and deal with all the quirks. Some of it would be doable as you mentioned, but dealing with the per-mcnk height variables/scaling and a bunch of other quirks is going to be very painful for even expert users. The only way to properly go about this is to have plugins that can read WoWs raw files for each 3D application. This is being worked on for Blender, but users of others would fall behind quickly. I have since added the option for per-MCNK baked textures for higher quality, but again this is not the optimal solution. I will probably add an option to dump raw stuff in the future as soon as it is of actual use (which might be soon depending on Blender progress). Will have to think about what kind of formats though as I'm not sure simply converting the textures to PNG files would keep all information as there already seem to be issues with this.

Marlamin avatar Mar 30 '18 07:03 Marlamin