hey guys,
Im trying to optimise a view things in a project and i came across a questions i can’t find any answer to.
It’s about opacity masks and the overheat they produce, for example like on grass where you use a opacity mask to show only the texture on your mesh/plane.
However my questions is not about grass, it’s about decals and the masks/opacity we use on them to make them work. When it comes to performance, is it better to have like 4 decals on one big map or is it better to keep every decal on a seperate texture that fits the actual decal size ? Lets take the 4 decals in one texture map example, so i have different decals/masks in every channel of my map, by showing only one decal at any time, the black masked area on the opacity mask will be kinda always big, which should produce more overheat than a single texture/mask where the black opacity area will be much smaller because the texture map size fits actually the measures of the used decal ?
What matters the most with decals is how large they are pixel-wise. Usually it would be better to break up decals into smaller pieces. Anything regarding textures will only optimize memory, not rendering performance.
By having a mask in each channel RGB and A, im optimizing my texture budget, that was my point of merging 3 or 4 masks into one texture. However opacity is not free and it comes at a cost. My understanding is as bigger the opacity part “area” on my texture, so bigger is the cost to render it…
So the question is, is it better to use 4 seperate textures for each decal instead of merging them all. So they are no longer merged on a 2K mask… Instead every mask would be made of a much smaller texture which would also reduce the masked out “opacity” area on every individual texture or decal.
You can do it either way. When using masked materials translucency is more costly than opaque, but when rendering a decal it’s all rendered the same using the translucent blend mode. Channel packing textures is great for reducing memory and texture samplers on materials (especially important for landscape and other heavy materials), but nothing more. The actual pixel cost of rendering materials does not change whether you use a texture that has been channel packed or not.
The pixel cost of rendering a translucent packed texture should be higher than using a individual one, casue the packed one will have a much bigger translucent space/area or no ? Bellow is a simple example of a 1K packed texture mask, which contains 4 masks. A dot, a plus and two different lines.
So lets say im using just the small + on this texture, that means all the other space has to be blend away by the trasnslucency mask. Isn’t the cost of this much higher than just using a seperate smaller texture for the little + ? Or is there like no diffeence ? casue if there is like no difference i would defentely go for the packed texture to save memory.
OK… If you’re making a decal, you’re going to want to make sure the texture size makes sense. If you have a lot of square shaped decals, then obviously packing them all into the same square texture makes sense, but two of your decals are very rectangular, and two others that are square. That is best handled with two packed textures: one square (plus and sphere), one rectangle (squiggly lines). If you don’t have anything to pack in the third channel, then you can separate them into linear grayscale maps and halve the resolution (grayscale is uncompressed, but handled one channel extremely well).
Just figure out what you want to do and do something that makes sense for your project. But you don’t want to have a single massive texture like that with lots of empty space. That’s a waste of texture space.
It’s not directly wasted, imagine that all of this 4 decals on this one map are used in one room multiple times. So this one texture will be bascially all the time in my vram. The question remains still the same, when using such a big texture where translucency is masking out a big part of it to show only one decal at time, isn’t the overheat like to crazy especaially when im placing a lot of decals all over my scene. Im mainly concerned about the overheat produced by translucency masking out a specific part “decal” on my single map.
I don’t think you’re understanding what I’m saying, and I really don’t want to make this thread longer than it needs to be: the lines in your texture are horizontal. If you place them into a square texture, no matter how well it’s packed, you will end up with a lot of blank transparent space that you’re not using. That waste is the kind of thing techniques like channel packing try to avoid. Using a square and a rectangular texture will make better use of the space.
Now, whether you actually pack these or keep them separate and use linear grayscale compression doesn’t make a huge difference. Typically uncompressed linear grayscale textures look as good as compressed RGB textures at half the resolution, but require twice as much memory. Depending on how many different decals I have, what platform I’m targeting, and what else is going on in my project, I may decide something different. Where you and your project falls is a decision you have to make yourself: there is more than one way to skin a cat.
Separating into grayscale maps means I have better quality with a lower resolution for a small uptick in memory and the cost of using separate texture samplers, but modern renderers and APIs make using lots of texture samplers much easier than they used to be. So for a mobile game (and landscape) channel packing is important, but for everyone else it’s really becoming less and less of a necessity.
I get your point but it seems you dont understand what i mean, not sure if im explaining mysef correct here.
I understand the purpose of packing a texture, the sample is only a rough example of what im talking about… this question is actually not really about how to save vram or if i should use a greyscale or RGB compression. What im mainly like to know is how much overheat is produced by masking out “translucency” on a particular part of a packed texture.
However i found something regarding this topic on polycount, thanks for trying helping me out mariomguy
Yeah, I’m having trouble understanding what a “translucent packed texture” means. A texture is just a texture, translucency is set in the material. These are two different concepts entirely. The alpha channel in a texture is not a texture’s “translucency,” it’s just another channel. There are cases where the alpha channel won’t be compressed: in those cases, a single RGBA costs as much memory as two RGB textures.