how you stamp materials or textures?

   16545   14   1
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
i still doing a copy / stamping of some books to learn how to do it,
and i want to do a texture for the book itself and another texture for the cover text.

and how can i mix them? do i need to do 1 material with diferent layers?
or do i have to do a material with diferent nodes?
use a layered material and set each texture in a layer?. and then how or where do i put the stamp function? thanks guys.
User Avatar
Member
8592 posts
Joined: July 2007
Offline
you can use vex layered surface to mix different textures
then you can override texture parameters with attributes created in sops

you can just create primitive attribute to store texture ID
then after copy use material node and override desired texture parameter with expression using that attribute

eg.
create attribute named “textureID” with localvar “TEXTUREID” in left input tree from copy sop
stamp its value by an expression like stamp(“../copy1”,“cy”,0)
where “cy” is for example a stamp variable containing copy number
after copy add material sop set your material and override it's texture parameter let's say “book_texture” to something like this: $HIP/img/book_$TEXTUREID.png

you can of course use more direct way (but less versatile) and create “book_texture” primitive string attribute directly instead of “textureID”
then it would be something like this: $HIP/img/book_`stamps(“../copy1”,“cy”,0)`.png

if then the shader applied to this object has texture string parameter called “book_texture” the value in “book_texture” attribute will automatically override it

if you are using vex layered surface then the texture parameters are called “map_base”, “map2”, “map3”, …
so you can override them with attributes with the same names
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
thanks tomas, now i see what you mean, i do need to apply the stamp funtion at modeling level and not in the material or shader by itself,

ok, now how do i set up the atribute. the idea that i have is this,
have 2 or 3 titles of the books and 2 or 3 base textures so i can random them. plus the shape of the book.

i did create a vex layered material, and put it on the tree. and did 4 textures just to try that up and put each on a layer. and well there is where i got stuck. -

thanks for the help .

Attachments:
Book_2.hipnc (176.5 KB)

User Avatar
Member
8592 posts
Joined: July 2007
Offline
think of that layered shader as a material just for one book
you layer one book texture and one cover text texture on top of each other

those two textures will vary for each book

so now you just need to create 2 string overrides in Material SOP with following names
“map_base” for book texture and “map2” for cover texture because those are names of the parameters in material you want to override
be sure to append this Material SOP after Copy SOP to avoid unnecessary cooking since we will be using temp attributes to compute texture ID

since you want to vary book texture and cover text texture with different seed you can create 2 integer attributes for this and call it like “book_tex_ID” and “text_tex_ID”

1) you can either create those by copystamping in left input tree of Copy SOP (be sure to use Attribute Create SOP for this instead of just Attribute SOP)
2) or much simpler you can precompute them on the template points (right input tree of Copy SOP) and transfer them to copied books by checking Use Template Point Attributes in Copy SOP/Attribute tab and fill in the names or * in the field of specified field, best would be To Primitive for this case

look at the file
i have created some example textures(4 for book texture and 4 for text texture) and set up example workflow with 2) method
since you didn't have uvs, i created very simple one
i kept your color variation so it is multiplied with book texture in material
instead of Material SOP you can directly create parameters with the same names as the parameters you want to override in material as i mentioned in previous post

Attachments:
book_vary_texture.rar (926.1 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
thanks tamte for helping me with the books i appreciated a lot.

i was checking thie information on how to set up attributes,
http://www.vimeo.com/6803615 [vimeo.com]

as soon i get home i will check your files .
User Avatar
Member
696 posts
Joined: March 2006
Offline
this is also discussed in video 10 of the hscript video tutorials [sidefx.com]
Stephen Tucker
VFXTD
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
thanks allegro, i am downloading them right now,

now i see how you set it up, the texture is an attribute that we add. so we can use it from the material, i thought there was another way to link the material with it.

now i get it, what you did is cycle the number of the texture instead the complete name.

i am assuming if i want to stamp materials i have to do something similar and over right the material and not the texture.

the only thing i didnt understand is why you use the “Round” function,
and the values wich you multiply the rand$PT

Book_Text round(fit01( rand($PT*359.43) ,0,3) )
text_text round( fit01( rand($PT*-72.31) ,0,3) )
User Avatar
Member
696 posts
Joined: March 2006
Offline
pelos
round(fit01( rand($PT*359.43) ,0,3) )

The rand function generates a random number based on whatever value is entered into it. rand(0) will always return the exact same value. Therefore, it is common to multiply, or add by a “seed” value to help eliminate any patterns that may begin to emerge in your work. we multiply by 359.43 (an arbitrary number) simply so that our random numbers aren't based on an integer seed.

fit01() will stretch the values out so that the random numbers produced by rand() (which are values between 0 and 1) will now be values between 0 and 3. These values are not integer values, so you may have values such as 0.0394 or 2.394875473 being generated.

round() will make it so that your values will be integers. A value of less than 0.5 will round to 0. A value between 0.5 and 1 will round to 1, etc. This is necessary since your image names will likely be image1.jpg, image2.jpg etc.
Stephen Tucker
VFXTD
User Avatar
Member
8592 posts
Joined: July 2007
Offline
pelos

the only thing i didnt understand is why you use the “Round” function,
and the values wich you multiply the rand$PT

Book_Text round(fit01( rand($PT*359.43) ,0,3) )
text_text round( fit01( rand($PT*-72.31) ,0,3) )

rand() function is described here http://www.sidefx.com/docs/houdini10.0/expressions/rand [sidefx.com] and also why i used values to multiply $PT, just to give it a different seed

round() is just for rounding the number
i have 4 numbers in texture names, 0,1,2,3
so i need to round any number produced by fit01( rand($PT*359.43) ,0,3) to be exactly 0,1,2 or 3
because i don't want it to produce name like Book_1.534.png which does not exist so it will round it to Book_2.png

EDIT: Allegro was slightly faster
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
696 posts
Joined: March 2006
Offline
8)
Stephen Tucker
VFXTD
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
allegro i am currently looking at those videos, i am still in the #3 and 4.
i am so sure the person that did the videos is the same one that did the tutorial on how to rig the helldog the voice looks familiar. .
User Avatar
Member
696 posts
Joined: March 2006
Offline
Nope, that would be Calin Casian who did the rigging tutorial. I'd put money on it that the guy that did the expression tutorials wouldn't touch rigging with a ten foot pole.
Stephen Tucker
VFXTD
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
now i want to know who was he, lol

i was cheking more stuff for staming stuff and i got this other way, i dont know if is recomended, but this can be use also with textures.

Attachments:
Houdini_Stamping.jpg (127.7 KB)

User Avatar
Member
8592 posts
Joined: July 2007
Offline
pelos
now i want to know who was he, lol

just check his name on the main page of that tutorial, I bet it will be familiar to you

pelos
i was cheking more stuff for staming stuff and i got this other way, i dont know if is recomended, but this can be use also with textures.

it can, but you need to create n materials instead of just one (unless you use overrides). it is fine for 4 texures but for 100 i wouldn't try to do it this way
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
617 posts
Joined: Aug. 2008
Offline
100 materials, yea that will be horrible doing by hand, but if you want to match a color texture with it bump?

the expression tutorials were done by.
“Created by Houdini Product Specialist Stephen Tucker”

they sound similar, might be the microphone.
i wonder if i use it i will sound like them? lol.
  • Quick Links