leukbaars / DreamUV

DreamUV - 3D viewport UV editing tools for Blender
1.49k stars 64 forks source link

More complex usage examples #53

Open unfa opened 5 days ago

unfa commented 5 days ago

The included atlas demonstrates only the hotspoting abilities of DreamUV, but we also have trim tool, box mapping etc. now. Maybe the user community could create some more demonstration and learning material for users of this amazing tool?

I'd love to be able to put together some more complex atlases and examples of DreamUV used in environment art and get feedback from you, as you know exactly how the tool is used best. As we can't generally share what we make for clients/at work, I'd love to make something from scratch for this purpose.

About me: I work as an enviro/tech artist at a small/mid game studio in Poland but also do my own game projects after hours.

To not be just a wishful dreamer - I'll share my recent work made with DreamUV in mind:

image

Here's a Blender project with the textures and atlas mesh + some simple test geometry - give it a spin! lunacrete_atlas_layout_03_packed.zip

The exact textures here are channel packed in a format specific to an open-source project I'm working on (https://libla.st), but I can later provide more standard PBR maps too.

I am mainly wondering how well this kind of atlas layout can work with Dream UV. I'd probably split the atlas mesh into hotspot and trim parts separately.

obraz

There's multiple sections here:

  1. Regular hotspot section for texturing concrete blocks
  2. Narrow trims
  3. Two types of pavement (with and without bumps), that's supposed to be shuffled on a loop-cut plane to break up repetition while creating a tiling surface
  4. A wider trim
  5. Interlocking slabs

--- Auxiliary info that's not Dream-UV specific, but you might find interesting overall:

Ideally I'd combine a tiling base material (concrete, metal, rock, ceramic) with a trimsheet like the one above and use DreamUV's hotspot to provide edge information and fake bevel (I've prototyped scaling normal map influence with curvature, improving fake bevels), and DreamUV's Box mapping for the tileable base material that'd provide the texture and character. On another UV layer I'd map a paint layer atlas with some shapes, symbols, maybe text. Vertex colors bare channel-packed information about AO, curvature, dirt/dust and wear masks which allow breaking repetition on level geometry. (Baked to vertex colors using Blender).

I can't implement this in full (in Godot 4), because I need to have tangents for a secondary UV channel to be able to blend normal maps properly, that's why this atlas combines shape and texture features.

My idea for materials and environment ubershader for this project in general is to add edge wear, dirt, dust and paint layers in shader using extra data about the material.

RGBA map - self-explanatory ORMD map - AO, Roughness, Metallic, Data (configurable channel per material - could be emission amount, could be additional damage mask for applying paint layers, or detail CXHY - Curvature, Normal.X, Height, Normal.Y - extra information about edges and height used for applying paint, dirt and wear.

leukbaars commented 4 days ago

On my own work i have been using dreamuv with a very similar setup as you are describing here. What you would need to do is make 2 atlas objects, one for hotspots and one for trims.

The trim tool will automatically know that they are horizontal trims as they cover 0 to 1 on the x axis. Assigning trims wont really work like the hotspot tool yet though (still pretty WIP), you have to manually select sections and loops of you mesh and use the trim button to map a trim to them. You can then cycle through different trims, they get indexed from top to bottom.

for the random squares (3), you can make a second hotspot atlas for randomly assigning them. Dreamuv supports multiple atlases now. You could also just place this as a trim, and shift them randomly. I should probably add a "snap to grid" feature for this use case at some point

Combining with a tiling material using 2 uvs is definitely a good workflow here, and I've designed the tool for this so you can chain a boxmap operation to the hotspot and trim tool (the little B button), and you can set each tool to be forced to use a specific UV. I have found this feature to be very powerful in my workflows, it opens up a lot of possibilities

unfa commented 4 days ago

Thank you, @leukbaars - this is very helpful!

With the random squares (3) I have found a strange issue - even though the divisions in mesh were created with Blender's loop cut tool and should be the exact same width, stretching my geometry before hotspotting makes DreamUV prefer different islands from these strips.

I feel like maybe a "tolerance" parameter could be useful that'd make DreamUV include more tiles in the "matching pool" - so floating point errors and such won't create unexpected biases in the results when the atlas contains a lot of tiles of (nearly) identical size?

A grid snap for that could be very interesting. Maybe extra configuration like that would make sense being stored as custom properties on the atlas or trim mesh so user can set it once and have it remembered. I can imagine achieving some interesting effects by creating a trims that are self-interlocking, and when a few strips are laid out in parallel with randomized offset could create very interesting unique patterns.

I still wonder how do the trims and caps work - I have tried to figure it out but I it's still a mystery. I suppose the idea is on our atlas we can have a continuous trim section(0-1), but also end caps that are to be put at the ends of a face strip we want to map a trim to? So say a trim of a set of pipes or cables can loop for however long it has going along a corridor, but where it ends, the pipes or cables pit into ports or sockets (or something of this kind).

Also one more thing about boxmapping - or separate UV channels in general. For my pipeline it'd be very useful if I could configure which UV channels are considered UV1 and UV2, because fro example in Godot engine, UV2 is kinda of reserved for lightmaps (if used), so I would ideally boxmap on UV3 to not have to do some crazy postprocessing with another Blender add-on or after import in Godot.