Procedural UV mapping

   9806   13   1
User Avatar
Member
46 posts
Joined: March 2016
Offline
I'm having a very difficult time finding any tutorials or demonstrations of this.
I'm trying to figure out what the approach is to procedurally UV mapping something. That is, mapping something with variable geometry. You might have a plane that can be shorter or longer, or a cylinder with a variable number of sides.

The first problem I have is with selections.
Let's go back to the cylinder example, and say that you want to split off the top and the bottom faces, and split one of the edges along the side.
You can't just select these in the viewport, because as you change the number of sides, the associated numbers change as well and break your selection. Not to mention that any newly added edges would not be selected.
The solution would be to select the desired edges procedurally inside the network, but I can't imagine how to do this with anywhere near the necessary level of accuracy.

The second problem I have is with scaling faces.
Let's say that you have a simple box. It can be scaled independently along the X, Y, and Z axis.
As you scale any particular side, you want to scale and tile the UVs to prevent stretching/squashing of the texture and maintain texel density.
Even without accounting for how complex this would be to set up in itself, I'm completely baffled as to how one handles edge bevels in the normal map, or maintains the transitions in the texture between faces.

The only solution I can think of is to just not make anything with parameters which alter the base geometry. But I'm hoping that's wrong.
Edited by Grimwolf - Oct. 27, 2017 15:52:19
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
building things proceduraly can involve some very different approaches, have a look through these for some techniques - some are old but still very useful.
https://www.youtube.com/watch?v=VTNrT-sAVu0&list=PLShEm1_z6_cyBOAKQSH2ck-enGSnovMjD [www.youtube.com]
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
46 posts
Joined: March 2016
Offline
I'm confused. There is a huge number of videos in that playlist, so I tried skimming through it, but none of it covers UV mapping. It's all basic introductory stuff.
I didn't even find anything on traditional style UV mapping through the viewport, let alone procedural.
Edited by Grimwolf - Oct. 27, 2017 18:02:43
User Avatar
Member
46 posts
Joined: March 2016
Offline
This is starting to look like a big problem with real-time/game models. I finally managed to find a tutorial which covers this subject, but they circumvent the problems I describe by having 90% of the detail inside of the geometry itself, and having a massive number of split UVs. A solution that doesn't work with games due to the sheer polygon density.

I understand that Houdini was not used with real-time projects for most of its existence, and areas like this don't play well with that.
That being said, I think I may have been correct about just not being able to use parameters in a digital asset which alter the base geometry.
Something like a wall or a pillar would be simple enough to work, which I've seen in videogame demonstrations with Houdini. But anything more complex than that would not.
There just does not appear to be any reasonable way of maintaining bevels and transitions without an obscene amount of polygons.
Edited by Grimwolf - Oct. 28, 2017 11:32:29
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
In case of unwrapping a simple cylinder you can use the uvtexture node. Unwrapping boxes can be done with cubic mapping based on point normals. I attached examples for both cases.

Attachments:
uv_unwrap.hipnc (149.1 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Grimwolf
Something like a wall or a pillar would be simple enough to work, which I've seen in videogame demonstrations with Houdini. But anything more complex than that would not.

When creating meshes procedurally I think it´s easier to create the UV coordinates right away. That way you wont need an algorithm that magically unwraps the whole thing after anything is build up and merged together.

Also it would be useful if you can come up with a concrete example.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
46 posts
Joined: March 2016
Offline
I'll try to be more detailed.
Let's say that you've made a square stone pillar for a videogame.
Something like this;
{—}
-|-|
-|-|
{—}
you have the base, the central pillar, and the cap.
Let's say that you want to scale the height of the central pillar. This would be perfectly fine, because all you have to do is vertically scale the UV so that the material tiles across it as it gets taller.
But then, what if you wanted to make the pillar wider?
As a videogame asset, the bevels along each of the four corners are baked into the normal map, and are a part of the material.
You can't scale the UV horizontally, because this would throw off the positions of the bevels in the material which should only lie over the corners.
You would also have a problem with the material on each side not lining up correctly wherever it splits, because each side was designed 1:1, and you might've scaled it to something like 1.25, causing the wrong points on the material to line up at each corner.

The solution I've seen is to model the bevels directly into the geometry, and use a relatively simple material which will not create obvious seams.
This does not work for a videogame asset which needs to be far more careful about the number of polygons it uses, and uses the material for most of the detail.
Edited by Grimwolf - Oct. 28, 2017 13:33:18
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
How about making the textures procedural as well then? In COPs there is even a normal map node that could bring in the detail on your low poly geometry.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
46 posts
Joined: March 2016
Offline
Unless you can have the HDA control the parameters of the attached substance, it would be a hell of a hassle to get them to lineup while adjusting them.
As for the baking, that doesn't work in a game engine. I would have to build my entire levels inside of Houdini, which would not only make prototyping a mess, but would make it extremely difficult to attach code to any singular asset or set of assets.
Each instance of those assets having their own material would also destroy frame rates and load times.
Edited by Grimwolf - Oct. 28, 2017 15:53:29
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
I think we might be talking about different things here…
are asking how to have models that can change in game?
if so you're out of luck - I don't know of anything that can do this, and Houdini Engine isn't runtime.
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
46 posts
Joined: March 2016
Offline
No, not while the game is running. I'm just talking about piecing together the level with HDAs in-engine.
Either way, bypassing this problem by baking a new normal for each version of the asset would leave me with a crazy number of materials and wreck performance
Edited by Grimwolf - Oct. 28, 2017 17:11:23
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
You dont need to bake geometry to create normal maps, they can also be created based on greyscale images.
And you wont need another program like Substance to create procedural textures, either. It can be done right inside Houdini: http://microbot.ch/new/procedural-patterns-noise/ [microbot.ch]

How about creating a say tiled stone-map and adjust the UV map so it can include more or less tiles depedending on the object size?

Also bring up something concrete to work on! Talking about baking, texture generation, proc. modeling, game engines all at once and in such a rather diffuse manner wont help too much.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
33 posts
Joined: Nov. 2012
Offline
Hi there,
necro-joining the thread. I am looking for resources pertaining to procedural UV mapping of variable-topology meshes. Any ideas/links? Not a popular subject.
Artur Mandas

Artist & Developer
http://arturmandas.com [arturmandas.com]
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Hi Artur,

this curve-based example would be resolution-independent:
https://forums.odforce.net/topic/43213-biological-modelling-methods/?tab=comments#comment-204915 [forums.odforce.net]
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
  • Quick Links