PDA

View Full Version : bending procedurals


skruk
03-17-2005, 02:09 PM
Is it possible to have a procedural map (or any other texture map) follow the bend that I put on an object. I have created a long narrow segmented rectangle, and then used "bend" in Modeler to make the shape of a "C". I'd like a procedural and image map to follow the curve, how can I do this?

c-g
03-17-2005, 02:21 PM
You would either have to bake the prodecural into an image or lay the surface out flat enough for the desired procedural and then morph/displace it back into the intended shape. The morphing/displace causes layout to assign internal uv coordinates and it will follow the bend.

skruk
03-17-2005, 03:09 PM
Thanks c-g. I guess i'm on the right track then, because that's what I was just fooling around with before I read your thread. Surface baking is new to me, so it's giving me problems. I'll look at some tutorials. I did use morph and it works. Maybe i'll stick with that.
Thanks for your help!

c-g
03-17-2005, 03:28 PM
Glad it worked. What problems are you having with baking?

SplineGod
03-17-2005, 06:05 PM
If you UV map it before bending it you should have no problems.
For making prodedurals try this:
Load a blank image and apply that on your UV map.
In the image editor select your blank image and apply a filter called Textured filter.
This will allow you to add a procedural (or other texture) onto your blank image
as a preprocess. Once you do that youll be able to see your procedural on your
object in opengl. Once everythings adjust to your liking you can double click on
the image thumbnail in the image editor and save your new texture out as an image map.

c-g
03-17-2005, 06:32 PM
If you UV map it before bending it you should have no problems.

Except that procedurals don't follow uvs so either the morph or the baking is needed.

SplineGod
03-17-2005, 07:06 PM
Producedurals NORMALLY dont follow UVs. If you apply the procedural to a blank image that IS being applied using UV maps the procedural will follow the UVs. Heres an example. This is a screen capture from modeler using this technique. You can see the procedural following the UVs and it can be adjusted and tweaked in the texture panel inside the textured filter plugin. Once everything looks good the procedural can be 'baked" by double clicking on the image thumbnail in the image editor. The procedural doesnt have to be baked onto the blank image either. The procedurals can also be animated and still follow the UVs.

http://www.3dtrainingonline.com/examples/modelerscreen.jpg

Steve Warner
03-17-2005, 08:27 PM
Nice tip, Larry! :thumbsup:

Thanks!

SplineGod
03-18-2005, 02:13 AM
sure! Its worked pretty well for me :)

Dave Jerrard
04-16-2005, 03:45 AM
Except that procedurals don't follow uvs so either the morph or the baking is needed.

True, they don't follow UVs unless you use the Textured Filter method. But they can be tricked into following geometry on some models. I did a presentation about this years ago (Dec 2, 1998 to be exact), and it's little trick I call twisted surfacing. Well, what would you expect out of a head like mine? :hmm:

If you keep in mind that most procedurals (all the built in ones are) are actually three dimensional and what you see on the surface is just the pattern that is present where a polygons slices through it, you'll get to know them very well. They're just like real world meterials, like wood, bread, stone, or whatever. You only see the texture that's on the surface, but if you slice into the object, you see the texture runs through it and constantly changes as it does. Wood for example is vastly different in appearance depending on how you cut it. If you cut a log down the length of it, you see long, wavy stripes. If you cut across it, you see it's made of rings. If you can any other way, you'll get ovals. What you see is competely dependent on the where the surface runs through the texture. In LightWave, the same thing happens.

Most people just view procedurals as being a 2D texture mapped onto polygons, and thus, don't see their true potential. Procedurals are 3D. So are objects... Now let's keep this in mind as I proceed to blow it...

Take a cone. Any cone, preferably with a narrow end at the top. Now say you need to put a stripe around it. How would you do it? Planar mapping along the X or Z axis will do that fine since the stripe will run right through the enditre cone, hitting both sides. You could also use cylindrical mapping and spherical mapping on the Y axis and get similar results. Heck, if you want to be nuts, UV the sucker! You'll notice that you have the same options there - planar, cylindrical and spherical options are all there in the Make UV Panel. Ok, so we pick a method and map a stripe on the cone. Cool. Now let's just ignore shading and all that stuff, so let's make the cone 100% luminous, and 0% diffuse. Ok, looking at it from the side, you'll see what looks like a triangle, with one slightly curved side (due to perspective). Something that looks almost, but entirely, pretty close to this...
http://webpages.charter.net/djerrard/Cone-Stripe01.jpg

So, what we did was map a flat image of a strip onto a surface to create a straight stripe on the object, right? Just a single, straight line? No bends, now wiggles, and definitely not a circle, right? Yeah, right. Circle! What am I? High? Hey... there's an idea... Let's get high... and look DOWN on the cone from above!

http://webpages.charter.net/djerrard/Cone-Stripe02.jpg

What the!?!?! It's a smegging circle!!!
Ok, so you're thinking that well sure, I'm just looking at an image that's wrapped around a cone, and from this angle I see all the sides. It's still just a straight image. Ok...

Let's FLATTEN THE CONE!! Hammer please!
http://webpages.charter.net/djerrard/Cone-Stripe03.jpg

Ok, one cone, flattened to 0% on its Y axis, and what do we have? Yep, it's a circle alright!

Ok, so what good is this? How would I use it? Hmmm. Let's see. Where could I use rings...
http://webpages.charter.net/djerrard/Saturn_Night-LW.jpg
Yep, an image of straight lines can be bent into rings for something like saturn. These rings are actually a cylinder, one meter tall, but many many miles wide. The base is actually much wider than the top, and I removed the top & bottom polygons. The image was then cylindrically mapped.

Ever need to bend text into an arc, like say onto a tire? Or for a CD label. Here's a way to do it. Replace that stripe with text, and render it from above...

The trick is in the angle of the surface you're mapping on. As long as the surface has one edge offset from the other, you can use this trick. Think of the edge of a blade. The sharp edge of a blade is somewhere near the middle of the entire thickness of the blade itself. If you look down on the edge of the blade, which is in simplest terms, a < shape, and you imagine mapping a stripe through the middle of the blade, just like we did with the cone... Yep, the stripe would appear to follow the edge of the blade. You're using one dimension of the object to affect how a texture is applied to it. In other words, you're taking advantage of the 3D nature of textures and objects.

Great Dave, but what good is bending stripes? I can do that in Photoshop, or whatever. Big deal...

He Who Will Continue This Now...

Dave Jerrard
04-16-2005, 03:46 AM
Continued

Ok, lets get back to procedurals... Let's inflate that cone again, wipe the stripe, and try another texture... How about... checkerboard? Now, think of checkerboard as a bunch of blocks, all stacked neatly against one another. No remove every other block, so no two blocks are beside each other, They only touch at the corners. There's a 3D representation of the checkerboard procedural. Now as a surface slices though this texture, you can get some pretty weird patterns. Our cone would look something like this...
http://webpages.charter.net/djerrard/Cones01.jpgCheckerboarded cone from the side and angled views. On the right, a flattened version.

Hmm. Got both circles and square out of that one... Ok, let's try um.. Crumple!

http://webpages.charter.net/djerrard/Cones02.jpg

Neat. It starts to get a bit of a circular pattern too. Ok, let's enhance that a bit. What if we also squashed the texture on the Y axis as well. Ok, here it is at 1/10th ths the vertical scale...
http://webpages.charter.net/djerrard/Cones03.jpg

Interesting. Round ringlike streaks! Now a bit more experimentation.. What about falloff? Let's try that on the Y axis. This cone is about 2 meters tall, centered at the base. A falloff of 75% on the Y axis yields us this...

http://webpages.charter.net/djerrard/Cones04.jpg

So, we can get a lot of control over a texture like this. What's that? You want to see real world examples? Ok, I mentioned a blade. Well, these example make use of the techniques shown in the past few images...
http://webpages.charter.net/djerrard/Fig-13.jpg
http://webpages.charter.net/djerrard/Fig-15.jpg

Same idea. Only the shape is changed.

How about some procedural rings around a planet? Some thought this was impossible without morphs and seams... Not so.
http://webpages.charter.net/djerrard/ProceduralPlanets.jpg

What about other shapes? Sure. Here's a very irregular shape mapped with a few layers of Marble. And yes, it can be animated.
http://webpages.charter.net/djerrard/Fig-23.jpg

So, you can get some really interesting results by warping yout textures along slightly angled geometry. Now how to create that geometry? There's a cool tool called Bevel which excels at that. :thumbsup:

He Who Does Some Of The Strangest Things In LightWave.

c-g
04-16-2005, 04:12 AM
Yeah, that is pretty much the morph trick. :)

Dave Jerrard
04-16-2005, 07:59 AM
Except no morphing was involved in these. I only squashed the cone as an example. In reality, you'd build the cone really really close to being flat, and then texture it.

He Who Forgot To Mention That Part.

c-g
04-16-2005, 05:36 PM
----> "pretty much" <----

With the process that is going on morphing is exactly the same as scaling your geometry. The internal uvs are locking the coordinates to the mesh. If you are scaling or morphing in layout the same thing is happening to the texture.

Dave Jerrard
04-16-2005, 10:05 PM
Take a look at the waves, That's the shape they were modeled in. No stretching, morphing or any other kind of deformation was used. THe object isn't even moved from its origin. I drew out a rough shape as a polygon, then I beveled its with a farily large inset, but a very tiny offset so the the beveled edge looked flat. In reality, the inner edge is about 1 cm higher than the outer edge. This gave me all the vertical room I needed to fit a few veins of Marble into.

Morphing a textured surface is a different beast, but can frequently achieve similar results, as I showed with the cones. It gets a bit trick to do easily with more complicated objects. The sword blade was modeled just as it appears. Again, no morphing, scaling or anything else was involved. I just modeled and textured. It's entirely to do with the fact that the texture is being applied to an angled surface. Nothing more.

Here's another example, that some people might remember from way back...
http://webpages.charter.net/djerrard/Fig-16.jpg


No morphing, no scaling, no displacements. This was modeled like this, and here's the wireframe.


http://webpages.charter.net/djerrard/Fig-12.png

It's a trick I've been using since the days of LightWave 1. A lot of people have probably used it themselves without even being aware of it. It happens a lot when you make a bevel, say around text. If you squash a texture to make a brushed metal surface, you might notice that the texture seems to follow the path of the bevel.

He Who Used To Use The Same Technique For Eyes.

colkai
04-18-2005, 09:17 AM
By 'Eck Dave, those bring back memories.
In case y'all are wondering - go hunt down Daves book "LW applied 5.6" and enjoy oodles of said goodness. :D

CGTalk Moderation
04-18-2005, 09:17 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.