Jump to content

UV tiles :(


Recommended Posts

I have a obj model. It's UV's are tiled. each taking up a positive zero to one. For each tile there is a texture for that UV space. My problem is Houdini only looks at the first tile when applying textures to the model. No matter the texture I assign to the model the area of the model that gets mapped is the same. *a patch around the eye since that's the UV space of the first tile. Basically I have 39 tiles that aren't being looked at.

Any clue on how I can get houdini to look at the other tiles?

post-4919-127967945201_thumb.jpg

post-4919-127967974318_thumb.jpg

Link to comment
Share on other sites

A solution to this problem is seems to be in using u-scale and v-scale in the uv project node. Vex super-material has this built in although the render comes up blank even though the textures appear fine in the viewport. O_O Off to solve the next problem.

Link to comment
Share on other sites

A solution to this problem is seems to be in using u-scale and v-scale in the uv project node. Vex super-material has this built in although the render comes up blank even though the textures appear fine in the viewport. O_O Off to solve the next problem.

What I do is group each tile individually, and they each get their own shader with their own texture maps. You'll use the Material SOP to assign shaders to groups.

Mari exports separate texture maps for each tile anyways, so having multiple shaders seems like the way to go.

It's very easy to make groups as well since you can make poly selections from the UV viewport.

Link to comment
Share on other sites

What I do is group each tile individually, and they each get their own shader with their own texture maps. You'll use the Material SOP to assign shaders to groups.

Mari exports separate texture maps for each tile anyways, so having multiple shaders seems like the way to go.

It's very easy to make groups as well since you can make poly selections from the UV viewport.

We think alike. That's the exact approach I took.

I solved the previous problem mentioned. Seems uv scale and range had nothing to do with the fix I thought I had. It had more to do with the shader I was using.

There seems to be a major difference with the way a Vex Surface Shop and A Vex Super Material handle UV's/texture maps. SuperMaterial has it right. But, it seems the VEX Super Materials Vex Vops can't be opened so I can't visually inspect what the difference is to apply it to a custom shader(s) It's looking like learning to write VEX may be my only option to continue?

Edited by bw5013
Link to comment
Share on other sites

i don´t know if this helps but attached is an example file.

petz

This example works on the constant material. On a basic surface shop the colors are inverted. I'm going to try this on a custom material and see how it plays out. Thanks for the help Petz :)

Link to comment
Share on other sites

This example works on the constant material. On a basic surface shop the colors are inverted. I'm going to try this on a custom material and see how it plays out. Thanks for the help Petz :)

what do you mean by "inverted"? it should work in the same way with any material since the uvs are modified in sop-context and have no relation to the shaders color.

petz

Edited by petz
Link to comment
Share on other sites

The first is the basic surface. The second is with the constant shader. I've included the hip.

everything works like expected but you have to change some settings:

- when using just an ambient light you need to adjust the ambient intensity of the basic material. usually its set so zero so the render comes our black

- you don´t need groups in this example since you can override the map inside the material-sop before the ifd is send to mantra but you can´t see the correct mappings in the viewport

- since the texture-node inside the basic-material is dealing with RGBA the numbers of the map are transparent by reasons of alpha and opacity multiplication.

hth.

petz

uv_map_works-3.hip

Link to comment
Share on other sites

everything works like expected but you have to change some settings:

- when using just an ambient light you need to adjust the ambient intensity of the basic material. usually its set so zero so the render comes our black

- you don´t need groups in this example since you can override the map inside the material-sop before the ifd is send to mantra but you can´t see the correct mappings in the viewport

- since the texture-node inside the basic-material is dealing with RGBA the numbers of the map are transparent by reasons of alpha and opacity multiplication.

hth.

petz

Thanks petz. This works great on the ball example. Going back to the blacksmith asset it's having a issue. It looks like the uv's are present. The textures outside of 0-1 are no longer showing in the render now though. Sorry for being such a noob. lol.

*edit* something is telling me that expression in the add texture in the foreach node is the ticket i'm looking for. I'll play with it some more.

uv_test_7.rar

post-4919-128033795705_thumb.jpg

Edited by bw5013
Link to comment
Share on other sites

Thanks petz. This works great on the ball example. Going back to the blacksmith asset it's having a issue. It looks like the uv's are present. The textures outside of 0-1 are no longer showing in the render now though. Sorry for being such a noob. lol.

there are some issues in your example how you are using the previous setup. i have uploded a slightly modified and annotated file that should do the trick.

hth.

petz

uv_map.rar

Link to comment
Share on other sites

there are some issues in your example how you are using the previous setup. i have uploded a slightly modified and annotated file that should do the trick.

hth.

petz

Thanks you much. I've learned so much from these examples you have provided.

There is just one thing left for me to wonder about.

I'd like to do this with one material. So in the groups name I have "uv_group_*" to select all groups.

In a overide to basecolormap would a expression be able to tell the texture maps which uv_group to map to?

For instance: if the texture file is color.1001.tif I'd want the U collumn to be whatever the 3rd digit is (in this case 0" and the V row to be whatever the 4th digit is minus one. (in this case it is 1. so 1 minus 1 = 0.

This would be useful for auto assigning up to 99 textures. assuming it's even possible. I'll keep at it. Thanks again for all the help thus far.

Link to comment
Share on other sites

I'd like to do this with one material. So in the groups name I have "uv_group_*" to select all groups.

if you don´t fill in any group than automatically all groups are used

For instance: if the texture file is color.1001.tif I'd want the U collumn to be whatever the 3rd digit is (in this case 0" and the V row to be whatever the 4th digit is minus one. (in this case it is 1. so 1 minus 1 = 0.

This would be useful for auto assigning up to 99 textures. assuming it's even possible. I'll keep at it. Thanks again for all the help thus far.

in the example file you can use the "uv_pos" attribute to override the map.

therefore color.10'$UV_POS1''$UV_POS2-1'.tif is what you want.

Link to comment
Share on other sites

if you don´t fill in any group than automatically all groups are used

in the example file you can use the "uv_pos" attribute to override the map.

therefore color.10'$UV_POS1''$UV_POS2-1'.tif is what you want.

That's what I thought too. I used that exact string at a point last night. It returns a constant color in my case instead of a desired image. It was jarring to say the least when it didn't work. Here's a pic of the string I'm using now. It does the exact same thing with a constant color unfortunately.

post-4919-128050703557_thumb.jpg

uv_map_test_9.hip

Edited by bw5013
Link to comment
Share on other sites

make sure to use the right quotation marks. looking at your screenshot it seems that you are using the wrong ones.

to see if and how the parameters were overridden by the material_sop use the details view or hold RMB over the node and have a look at the spreadsheed window. you´ll find an primitive attribute called material_override that shows the new string which is going to be used by mantra.

btw. in the screenshot you haven´t checked "override use local variables"

EDIT:

there is one more thing to take care of. since uv_pos is starting at 0 you can´t allways subtract 1 in the filename override.

Edited by petz
Link to comment
Share on other sites

EDIT:

there is one more thing to take care of. since uv_pos is starting at 0 you can´t allways subtract 1 in the filename override.

an IF expression could take care of that i'm assuming? I want 0 to always equal 9 instead of -1

Edited by bw5013
Link to comment
Share on other sites

  • 2 weeks later...

an IF expression could take care of that i'm assuming? I want 0 to always equal 9 instead of -1

You are probably long past this, but incase it helps anyone.

Note the use of `ifs` instead of `if`

`ifs($UV_POS1 > 9, $UV_POS1+1, padzero(2, $UV_POS1+1))`

Link to comment
Share on other sites

You are probably long past this, but incase it helps anyone.

Note the use of `ifs` instead of `if`

`ifs($UV_POS1 > 9, $UV_POS1+1, padzero(2, $UV_POS1+1))`

$HIP/blacksmith_color.10`$UV_POS1``ifs($UV_POS2== -1 , $UV_POS2==9,  $UV_POS2 - 1)`.tif

this is what i ended up with. I was pretty sure this was correct but obviously it isn't. lol.

this snippet is saying if uvpos2 = -1 then uvpos2 = 9, otherwise uvpos2 minus 1 right? or am i missing something. *thanks for the patience everyone :)*

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...