Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to have two more UV channels . . . #4152

Closed
charlesmlamb opened this issue Mar 3, 2022 · 2 comments
Closed

Suggestion to have two more UV channels . . . #4152

charlesmlamb opened this issue Mar 3, 2022 · 2 comments

Comments

@charlesmlamb
Copy link

Describe the project you are working on

A 3D game, atm, with Hannibal's army . . .

Describe the problem or limitation you are having in your project

I've been thinking, right now it's difficult to have textures with different details . . .

Been well thinking, one can make amazing things, with different UV channels, here's the idea . . .

First, add a texture that's tiled, over the entire surface, say skin . . . = 128x128, or 256x256 texture . . . Would make an object look very tiling, but give good basic details, don't need a normal map . . .

Then, have support for a second UV channel, for adding details, bec. if one paints here, there on a texture, it doesn't take much size, in memory, etc . . . Then, one could have a 512x512 texture, or 1024x1024 texture in next, as a decal/detail map . . . It'd take different UV channels, that's the point . . .

However, to add even more details, that's the request, going further, and, having a 1024x1024, to 2048x2048 texture, as a next detail map, one could paint even more details, to say cover seams, so on . . . Problem is, I need to paint a big object, this . . .

1510388234_1-org

Hannibal's elephant, so on . . .

Last, having a 2048x2048, or a 4K UV channel, is prob. best one can do, to add details, idea is this . . .

One starts with a small, repeat texture, say skin . . . 128x128, to 256x256 on each surface square . . . This would look bad, there might be say seams, so, one adds a detail texture over that, to remove the worst, sort-of, have a second paint layer . . As far as I know, this doesn't lead to extra draw - calls, also, from tests I've noticed, that a texture, with alpha, doesn't take up that much memory, etc . . . Being able to paint a 256x256 - 512x512 texture, for first level, of details, would work well, etc . .

image

An example . . . From what I've seen, even a .png compresses areas, that are very similar . . . One could add AO here, to get nice shadows, at low expense, or, say some details . . .

The problem is, one might need a third UV channel, to have even finer details, on a large objects, so on . . . This could be used to cover seams, etc much better, basically making a very tiling object look more detailed . . .

image

So, one could remove the tiling, where needed, supposing one had different UV channels, prob. is, there are only two, and ideally one would, to me, need like 4 channels . . . One, for a small, repeat texture, then, medium, then large, finally a 4K texture, if needed . . . An example, a 4K texture like this, takes this much RAM / memory . . .

A full, detailed 4K .png = 35.7 MB . .

As one removes areas, replace with a uniform color, or, alpha, size decreases . . .

Having removed some areas, from a full 4K texture . . .

Size = 17.6 MB

Then, 12.6 MB . . .

That's why these textures, if it takes less memory, are useful for adding details, on top of say lower resolution images . . .

That's why I think, 4 UV channels is a cool idea . . .

One could have a repeat UV texture, say 256x256, over an object, or say have four, in a single texture ( small atlas . . ), to get the basic stuff, say skin, fabric, etc . . . Then, a 512x512 texture, to add shadows, maybe AO, to get more stuff, then a 2048x2048 texture, to add more variation, only painting in necessary areas, so on . . .

This shows how it works . . .

0022

Size : 2.8 MB . .

Using a uniform color, texture is compressed, as a .png, here . . .

00444

Size : 1.5 MB . . .

That's why, I'm thinking one could use sort-of more UV channels, to make the well most detailed objects, while saving 1. memory usage, and, 2. draw - calls, if I understand how UV channels at least work . . .

One could also add channels, for normal map, metallic, etc . . . Right now, this is the only way to have very detailed textures, keep memory usage low, and, not sure, reduce draw-calls . . . If this could be optimized, maybe the four textures, say for albedo, could be stored in one memory slot, as a sort-of ' super ' texture, well, don't know, if this might be optimized, etc . . .

Sort-of, that's why I'm asking for this, to get amazing details, one a bigger object, if this is the best way . . .

So, I'm asking for two extra UV channels, one can paint them in Blender, as decals, and, use a minimum of texture, to get a nice result . . . Might work for buildings, not sure . . .

What I don't know is, if this would be more efficient, could be coded that way, or, it just amounts to the same thing . . . Stuff like AO, even normal maps could be in different channels . . . What I'm thinking is, all these texture channels might be able, to be compressed into some efficient, ' last ' texture, that at least runs well, right now I can't make the elephant, at least optimized, bec. to get best results, I'd need 3, or 4 channels . . . Also, since video - games can't use more than 4K textures, this might be perhaps only way, of getting the ' best ' quality, in a video - game, minimum memory usage, also draw - calls ?? Thx . . .

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Well, been thinking of having different texture channels, it might be the way, to get better 3D models, almost movie quality, at minimum - system reqs . . . I need it for some big objects, also creatures . . .

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Well, like above . . . Add two more UV channels, so one can have one for 512, one for 1024, last 2048, and, 4K, at minimum cost, don't know HOW details work, but I heard they don't require more draw - calls, at least, it'd be an intuitive way, of using less memory, while, having very detailed 3D objects . . .

If this enhancement will not be used often, can it be worked around with a few lines of script?

I don't know, last, don't know if this saves resources, or, is even more efficient, not sure if the feature could be optimized, say make a ' super - texture ', to reduce draw - calls, sigh or what's possible . . .

Is there a reason why this should be core and not an add-on in the asset library?

Well, I don't know, it might be used in most projects, when people find how it sort-of works, etc . . .

@charlesmlamb
Copy link
Author

charlesmlamb commented Mar 3, 2022

Last, having different channels, I'd say 4, one could build the details, in a way, always using minimum req. texture size, to get a good results, for instance, for an AO, it might not be necessary to use more than a 1024x1024 texture, since it's some 'shadows', that get lost, in the final object, so on . . .

So, what I'm asking is, support for 4 UV channels, and, maybe they could be optimized for 512, a 1024, 2048, and 4K texture, so one could store them, in an optimized way, together in video - game memory, or, that all textures in UV channel 1, 256 - 512 texture, were stored in same place, in memory, or, as ' one ' sort-of atlas, basically auto - making texture atlases, not sure . . .

Sort-of, if there are several objects, each having textures that are 512x512, in UV channel 1, maybe those could be stored in an atlas, reducing number of textures, at one time, the idea is, this might be optimized, however, don't know how, etc . .

It'd be possible, if say UV channel 1 was only 512x512, to place them, next to each other, in one 2K, or 4K texture, having only one big texture, here it'd be for say 4 objects, or, even 16 ( 512x512 x 4 --> 2048x2048 ) . . .

Got, no more ideas, etc . . .

Also, if one used a similar texture, on different objects, with a unique name, all those textures, say on some houses, could be gotten from one place, in memory, sort-of auto - creating optimized texture ' atlases ', keeping memory usage small for an entire game, the problem is, to tile them, into one texture, they'd have to have similar sizes, ie. 512x512, that won't be necessary for all objects, some may use 256x256, and, that's where it doesn't work . . . To make better use of it, users would have to know, using say only 512x512, 1024x1024 textures, so on . . . Leads to better in-game performance . . . Or, one could have another atlas, where 256x256 textures are stored, and, the UV's are auto-placed, or, scaled, making something like a big, auto - texture atlas system, simply using the names, and, texture sizes, to put similar textures, in one big, ' resulting ' texture, in memory, not sure, thx . .

Last, one could also just add a name, to a say texture, grass512_atlas512, and, then the program could find all the textures that were to be used in one say atlas, and, perhaps auto - make that, might be something, in import settings, prob. easier just to name textures, for what atlas, they'd fit in, say dirt_atlas1024alb, dirt_atlas1024norm, so, each texture is used, in an optimized way, sort-of auto - LOD, for perhaps textures, etc . .

Result, the user would never have to see this, just set it correctly in Blender, boom, sort-of auto - stuff . . .

@Calinou
Copy link
Member

Calinou commented Mar 3, 2022

This is already implemented in Godot 4.0 using custom vertex data: #651

You'll need to write a custom shader to make use of the custom vertex data fields as UV maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants