Opacity map

Hello,

I did some googling but didn’t find anything useful. What’s the workflow for creating opacity maps?

For example:

Thanks.

Hey Maximum Dev -

an opacity map is essentially just a black and white map that tells the material what areas should be occluded and what should not be. Pure white will render what is there and pure black will not. You can use values inbetween to get intermediate values (so something like a gradient will fade away).

The workflow can vary depending on what you are trying to do with them. Sometimes they can be made inside the material editor themselves, but other times, like the picture above, you’ll need to create them in something like Photoshop. I generally work from a texture already created and essentially “cut out” the parts that you want shown. You can also store all this data in the actual alpha channel of the texture and export/import into Unreal this way, that way you don’t need to use a separate texture sample.

Also be wary that opacity maps and masks can increase draw calls. If you have a large amount of transparent area, it significantly impacts performance, so you want to leave as little as transparent areas as possible on the mesh. In addition, you should consisder using an opacity mask, which is hard values of black or white. Having the intermediate values can also impact performance. Generally speaking you wont hit any performance issues unless you use it on something like grass, where you have a ton of it overlapping.

Cheers!

Thansk. My question is, are there any automated way to create the opacity map or painting with hand is the only way? Judging by what I posted in the OP it doesn’t look like black and whites were painted by hand but there is no information on how these are generated either.

If you talking about opacity map( not a mask), it usually possible to make them by rendering some sort of thickness map from high poly. I think xNormal has that functionality. In any case, if you are baking the map from high poly in your modelling package, you can set up your materials to define black/white areas in any way you want. Doing same for photo-sourced image is probably possible by doing some sort of shamanistic stuff with desaturated diffuse.

Like Deathrey said, you can bake them out from the highpoly (if your using one). Simplest way (at least for a mask) would be to make parts white and black via materials (eg in 3ds max), render it out, and you’ll have you texture.

Photoshop also has features I’m sure you know about like the magic wand tool, so if you have a decent photo reference of whatever your using on a plain color background, you can just select the each part easily.

Like I said in my org post though, opacity map on foliage can be super taxing on performance. I don’t recommend using intermediate values on them if your planning on having a lot of them.