PDA

View Full Version : Question; Proceedurual Texturing for Tree Bark



Digital Hermit
03-29-2007, 09:19 AM
Ok, Is there any way for a procedural texture to orient itself to the mesh?

i.e. I am using the "crackle" procedural to make tree bark... Currently I have the texture at scale ratio of "x1-y10-z1" As you can see the trunk orientation is "ok" but the branches are not. (I still have to tweak it but no sense in going further until the problem is solved.)

Thanx,

colkai
03-29-2007, 09:31 AM
Procedurals don't orient to geometry like UV's. That said, I think there was some trick involving textured images and UV's to get the effect your after.
Hopefully someone with a btter memory than me will chip in (groan).

Digital Hermit
03-29-2007, 09:35 AM
Great! For some reason I missplelled "procedural" in my msg title - Wait! I know, its an advertising gimmick to get your attention - kinda like the upside down merchant sign - ya... thats it - heh

Damn board editor. :cursin:

SplineGod
03-29-2007, 09:38 AM
You need to have UV maps created for the tree. Using that you can generate an image map, use the textured filter plugin along with a blank image map to generate a procedural the follows the UVs or use nodal which will also generate procedurals along UVs. :)

Digital Hermit
03-29-2007, 09:51 AM
Thanx to both of you... but you guys are tell me I have to "split up" this tree right down to its tiny branches and orient it to a UV map? Ugg!

SplineGod
03-29-2007, 09:58 AM
Some tree generators will also create UV maps for you. If you built it manually in LW many of the tools will create the UV maps for you as you go.

ericsmith
03-29-2007, 10:36 AM
One other possibility that is tedious, but maybe not as much as UV mapping:

1. copy the tree to a new layer
2. bend the branches so everything is pointing straight up, like the trunk. It's okay if branches overlap each other.
3. use the Background to morph command to make the original version of the tree a morph of the revised version
4. In layout, place the tree, apply morphmixer, and set the morph to 100%

The reason this works is that procedurals map to the base mesh. If you morph, the procedural follows the deformed geometry.

Eric

Digital Hermit
03-29-2007, 10:53 AM
One other possibility that is tedious, but maybe not as much as UV mapping:

1. copy the tree to a new layer
2. bend the branches so everything is pointing straight up, like the trunk. It's okay if branches overlap each other.
3. use the Background to morph command to make the original version of the tree a morph of the revised version
4. In layout, place the tree, apply morphmixer, and set the morph to 100%

The reason this works is that procedurals map to the base mesh. If you morph, the procedural follows the deformed geometry.

Eric

Thanx Eric! I was thinking along those same lines, but did not know about the "background to morph" process... in fact that process is kind of new to me... Where and how is the “BTM” done?

connerh
03-29-2007, 11:25 AM
There's a method that I've been kind of testing out. It works alright, and with some more tweaking and more thought out mathematics, I'm sure I could get it to work even better. Basically what you do is you drive the rotation channel of your procedural textures with the Object Spot from the Spot Info panel. That rotates the channel in accordance with the direction that the spot is facing.

Surrealist.
03-29-2007, 11:30 AM
Thanx Eric! I was thinking along those same lines, but did not know about the "background to morph" process... in fact that process is kind of new to me... Where and how is the “BTM” done?

That's in the map tab under morphs. Pretty simple to do.

But I have a more basic question. Now, I am not a texture guru - by any means - but as far as I understand it, procedurals do not use UV maps. Images do, and the morph solution is supposed to be for images - as I remember it , because images are only applied along XYZ, Cubic, Cylindrical or Spherical.

However procedurals follow the contour automatically.

What Are yo using to subdivide that with?

Surrealist.
03-29-2007, 11:39 AM
There's a method that I've been kind of testing out. It works alright, and with some more tweaking and more thought out mathematics, I'm sure I could get it to work even better. Basically what you do is you drive the rotation channel of your procedural textures with the Object Spot from the Spot Info panel. That rotates the channel in accordance with the direction that the spot is facing.


Thanks for this. Something I will use too.

BTW I think this is a better idea than going down the image route. My 2cs.

Lottmedia
03-29-2007, 12:03 PM
There's a method that I've been kind of testing out. It works alright, and with some more tweaking and more thought out mathematics, I'm sure I could get it to work even better. Basically what you do is you drive the rotation channel of your procedural textures with the Object Spot from the Spot Info panel. That rotates the channel in accordance with the direction that the spot is facing.


I've got to say, you always seem to come out of the blue with some amazing idea. The inside of your head must be and interesting place:) Can u explain more your idea. I've got a basic idea of the process, but not exactly sure how to go about it.

Casey :cat:

ericsmith
03-29-2007, 12:10 PM
But I have a more basic question. Now, I am not a texture guru - by any means - but as far as I understand it, procedurals do not use UV maps. Images do, and the morph solution is supposed to be for images - as I remember it , because images are only applied along XYZ, Cubic, Cylindrical or Spherical.

However procedurals follow the contour automatically.

Procedurals are still calculated based on the x,y,z coordinates of the evaluated spot on a poly. Imaging a fractal pattern in 3d space, and a 2d plane cutting through that 3d space. The intersection of those two elements creates the final 2d "texture" composite that is rendered on the poly.

The catch is that this evaluation happens before deformation. So if you apply a procedural to a mesh, and then deform the mesh with bones, morphs, clothFX, etc, the procedural will "stick" to the surface. Even channel motion happens after the procedural evaluation. Otherwise, if you created a rock and textured it procedurally, and then made the rock roll away, the texture would slide across the surface of the rock.


There's a method that I've been kind of testing out. It works alright, and with some more tweaking and more thought out mathematics, I'm sure I could get it to work even better. Basically what you do is you drive the rotation channel of your procedural textures with the Object Spot from the Spot Info panel. That rotates the channel in accordance with the direction that the spot is facing.

Now this has got me really interested. Could you share some specific node settings for this?

Eric

Surrealist.
03-29-2007, 12:20 PM
Thanks for the explanation Eric. I wonder if this is different in the new 3D textures? I do know that if you keep the XYZ equal on the scale of the crackle it will distribute evenly - or at least pretty close. But it is when you elongate one of the values that you get the directional problem in the tree above.

I solved it - or appeared to solve it - by connecting the normal output of the spot info node into the rotation input. Connerh could probably enlighten more.

connerh
03-29-2007, 12:31 PM
I generally use the Object Spot for that, though both will rotate. The thing is, it seems that Object Spot and the Normal vector outputs use different intensities. Another thing to keep in mind is that vectors are translated into degrees linearly, as in Vector value * 100 instead of *360. In other words, a vector of 0.45, 0.1, 1.0 would rotate the procedural by 45*, 10*, and 100* on HPB respectively. So I've been using a Object Spot connected into a Vector Multiply node with values of 3.6 in all three outputs. I then connect the output from that into the rotation nodes. However, this gives some distortion, so I'm looking into a way to translate the procedural as well as rotate it. Give me some time and I think I'll work something out. Thanks for all the compliments, everyone!

Eric: I'll upload a picture of my node setup once I get it a little better.

Casey: It's pretty crazy inside of there, only every now and then does something useful pop out :D

Digital Hermit
03-29-2007, 01:59 PM
Connerth you are fiddling genius! :D

This is one more reason Nodes are superior! :thumbsup:

Behold the start of a "Procedural Bark" that follows the geometry. (Hey, it needs tweaking but its a start!)

Also, connerth, I did what you suggested but I started fiddling with it also... well, check the node pic.

This is the default crackle node no modifications.

Thanx

connerh
03-29-2007, 02:27 PM
Hm, well then, it seems to work just fine without any additional complexity, glad to hear that!