Sunday, April 25, 2010

Working with textures in 3D art - Part 2

The Amazon Princess in DAZ Studio 3 ... with every single texture, from the floor to the staff, hand-made by, uh, me, this morning! Go ahead, click on the pic and see it at full size -- I uploaded it at 600x900, so you can see the details.

The question is, how d'you do it? Well, the first thing you want to think about is the pattern, or texture -- the visible texture. And this is going to be a JPEG wrapped around a 3D object, as I said yesterday:

All the fabrics above were done with ONE pattern. Notice, it appears once in the first image, and about 10,000 times in the last image. How BIG the original pattern looks when it's applied to the fabric depends on how many times it appears in the JPEG texture map...


For the purpose of this post, I wanted to start from absolute scratch, create something by hand, from nothing. So I made the above in Serif ... it's just a square with a texture fill and some whirly objects with colors and lights added. It could have been anything, something dreamy and subtle ... but I wanted something LOUD, so it would be easy to pick the pattern...

So, you start with a combo of just about anything, and the tile (above) becomes the seamless pattern, like this:


So far, so good. Now, if you paste the combo tile (above) directly onto the 3D object ... which in this case is a skirt ... it just wraps around, and because it's BIG (1000 x 1000 square) you can see every individual little detail from the original design...

But if you took this tile and made it waaaay smaller, and used something like GIMP to tile it into a background where it appeared in a square 5x5 times, you get the second effect ... and at 10x10 times, you get the third effect, and at 20x20 times ... the last effect, where the pattern has vanished and become a texture in the fabric. Just save your tile at incrementally smaller sizes and have GIMP use it as a pattern to tile the background. Keep going till you get what you want ... save it right there, because you can use this, well, forever, and because it's a seamless pattern, it fits ANY 3D model. Whack it onto anything at all, it'll fit.

The easiest way to get more mileage out of the same pattern is to swap the colors. In these two, below -- on the left, it's the same old pattern from above, which has been greeeeeeened up and resaved, and reapplied, and looks very different. On the right ... it's the same texture (a kind of thorny tile which was made into a seamless texture, as above), and then the whole pattern was color-swapped into two different and equally nice fabrics.

Now, sometimes you want a BIG pattern so that you can actually see said pattern on the dress. To do this, just make the texture ... big. It wraps around, and in case you're wondering if it fits in back ... check it out. It does.

Not only that, but when patterns get big, they actually hold their, uh, pattern, as you can see in the two below. You could have used either one of these as tiny little tiles and had GIMP repeat them 20x20 on the same texture, and you'd have come up with a fabric with a herringbone or hounds tooth kind of pattern. In these below, the original design appears ONCE, just as in the very first image of all, way above:

So, there you are ... start with nothing in a DTP or art program, and end up with fabulous fabrics -- welllll, maybe. They look like fabrics from a distance, but if you get in close you see that the patterns (which, being fair, are only JPEGs slapped on a 3D object that, itself, has a finish like smooth plastic) look as if they've been printed into plastic.

And what you're dying to achieve is this:



Chainmail bikini. Right. Well, I can't imagine any woman in the real world every wearing any such thing, but it's a grand old fantasy tradition, so, what the heck?!

Go ahead, click on the above images -- they open up at full size, so you can see the whole deal. See the texture ... not just printed into the fabric like an iron-on on a teeshirt!! Looks like the bikinis are actually MADE of chainmail, in copper, and silver, and gold.

Now, the copper and silver and gold are (obviously) visible JPEGs that you apply in DAZ, just the same as the textures in the skirt and top, way above. But if you just put the JPEG on the 3D model of the bikini top, it looks like a fabric (or even plastic) screen-printed with the pattern. Hmm. You wanted some way to make it look like the very material of the model was made of iron links.

To do that, you'd have to actually rip up the surface of the 3D model ... and luckily there's a way to do it. Even more luckily, it's dead easy! It's called a displacement map.

So what the heck is a displacement map anyway?

Now, you've probably heard about bump maps, but I don't mess about with bump maps much. Why? Because bump maps create the illusion that a surface has a tangible texture. It's be like looking at the surface of cracked old leather, and seeing the grain and cracks and roughness, but when you slide your hand over it, you feel smoooooooth vinyl.

A displacement map, on the other hand, actually does "deform" the surface of the object it's applied to. And there's a "eureka!" moment for you. Now, the only questions are, where do you GET displacement maps, and how do you apply them?

You can buy them ... but I wouldn't, because they're too easy to make. Seriously. Save your bucks to buy the actual OBJs, the 3D models, which it takes a hell of a lot of skill to make. Making displacement maps takes almost no skill at all...

All you need is a bit of "theory," and you'll groan, "Is that all they are?" Yep, that's all they are

A displacement map is a monochrome (grayscale or zipatone) image. And these two colors tell the program how to deform the surface you apply the image to. All the black areas in the image (also known as the "map") get pushed in. The blacker they are, the further they get pushed in, to a max of "pure black." Grays get pushed in less and less as they get paler. All the white areas in the image get pulled out of the surface, to a max of "pure white." Grays get pulled out more and more as they get whiter

So, if you have a grayscale image with 100 shades of gray between dead black and pure white, stands to reason you'll have a steady gradient of ups and downs in your surface texture. If you have a zipatone image -- 2 colors, black and white, only -- also stands to reason you'll have hard, sharp edges and lots of "relief" in the surface.

Here's what a displacement map actually looks like -- but you won't see this in your 3D picture:

This is the displacement map that put the visible, feelable texture into the blue-and-gold patterned bikini on the bikini babe yesterday:


Click to see it full-size ... and see, the actual surface of the model has been pulled and pushed into the same shape as the pattern printed on the fabric. This was done by applying the displacement map you see right here.

So, after you've got your visible pattern--


-- you need the exact-same thing only as a displacement map.

Well, the displacement map IS the same thing, except for being B&W. So get into your imaging program and at the very least switch to grayscale ... but if you want big differences in the surfaces you're applying it to, reduce the number of colors to 256, or even to 2. If you use 2, you'll get big changes. 2 is best for chainmail and patterns beaten out of sheet metal etc.

So, when you've gotten your visible pattern, use IT to make the displacement map! And they can both start life as a photo. Want chainmail? Then find a good quality image, crop out a tile, make up the seamless texture, and then figure out how many times it needs to repeat in the texture map. The more often it repeats, the smaller the links of mail will look, when applied. Use Gimp etc. to make the texture map. Then use the texture map to make the displacement map in b&w.

So, now you have your texture map AND your displacement map. How do you apply them?

It's all in the Surfaces tab. Explore it. Look out for how and where you can set these maps. Click on the name of a JPEG used as a map -- a menu pops up. Click Browse ... and set your own texture and displacement maps.

I don't have time today to go into the absolute details of the Surfaces tab in DAZ Studio 3, but I'll be doing that tomorrow...

So, go all the way back to the Amazon Princess. Here's what I did:

Load Victoria 4.2...
Add the high-rez "all naural" skinmap as supplied with Victoria.
Design the face and bod (sorry guys ... you can't buy this model ... I designed it myself).
Add Rock Star hair, by Neftis, set to auburn.
Add the AK Lilian bikini. (Any cossie would do, but this has the wrap doodad too.)
Add a bit of floor for her to stand on. (I made this OBJ in Bryce 5.5.)
Add a texture to the OBJ floor.
Add an image as a backdrop (I airbrushed this one as a separate JPEG.)
Arrange the pose however you want...
Create the staff as a primitive (cylinder) and scale to fit your needs...
Add a brownish texture to the staff --
Add a displacement map that looks crinkly like wood.
Add a gold texture to the bikini (I used sandstone: it's perfect
Add a 2-color displacement map to the bikini for beaten metal or chainmail.
Add a deep gold texture to the bikini-wrap...
Add a displacement map to it...
Set the opacity to about 40% to make it look like silk.
Set up three lights -- left, right and top. Adjust till just right.
Turn on deep shadow maps on L and R lights, not top.
Decide on the wind direction ...
Tweak the hair and silk wrap into shape.
Render.
Adjust the percentage of the displacement maps till just right.
Re-render ... and call it good.

And that's it. Seriously.

Join me tomorrow, and I'll explore the Surfaces tab with you! (We'll also recruit Michael 4 to model for us, and see how some of these fantastic textures look on him...)

Jade, April 26

Combining Terragen Basic with Daz Studio 3

Guest post from dave today. I know it's been a month since I've guest posted here but remember I'm only a guest.

Living down in Australia right near the beach with a west-facing shore, I get to see lots of sunsets over the ocean. I've always been amazed by them and my favorite type by far is the type where clouds are lit up from the bottom and have a beautiful dark red glow as the sun sinks down into the ocean.

Naturally, I decided to try to replicate that using the free version of Terragen Basic. I do believe I succeeded! Have a looksie and don't forget to click the pic to see it 1280 by 960.






Ta-da! One tropical sunset. If you use Terragen then you may be interested in how this was done. I'll give you a quickie rundown here.

Make your clouds waaaaaaaay higher than they should be (these are at 4000 metres above sea level) and set the thickness very low. Also make sure the 3d button is on instead of the default 2d. Then go ahead and make a normal cloudscape. You'll find that as you set the sun closer and closer to the horizon, the bottom of the clouds light up nicely.

The sun... Remember the sun appears larger close to the horizon so first make your sun at least 4 degrees wide. Set the colour to whatever sunset colour you are aiming for and then crank up the intensity --I used 225%. This will REALLY make the clouds glow!

The above sun settings will also, unfortunately, light your water up if you use the default water reflective settings. Easy fix, just go into the reflection settings and turn max reflectivity and the reflectivity curve way down. Don't forget to do some quick low rez renders to see how the changes affect the water. Then you also want to turn the direct sunlight waaaaay down and also the reflection spread.

Poof! One sunset.

What does this have to do with Daz Studio 3? Well, you take your fully rendered sunset and use it as a background in Daz to add goodies. I decided to add a critter. Specifically, the Millinium Dragon.



Believe it or not, I only needed one light for the dragon. Obviously a reddish coloured light about where the sun is. To get the rest of the effects I only used the diffuse, specular and ambient surface controls. Get the colours and the strength of each right and I then only had to use the one light.

I, uh, had to use only one light cus on my ancient dinosaur of a PC I wasn't sure if this could even render more than one light without barfing. There's always a way around problems, right?

And don't forget to practice posing the dragon! Fun and practical!


Saturday, April 24, 2010

Working with textures in 3D art


Textures in 3D art are the easiest way to bring things to life -- not just people, but the props and landscapes under and behind them, too. If you're in DAZ Studio 3, all 3D things (people too!) start out as .OBJ files, which are lumps of plastic which can be morphed into all kinds of shapes. What makes them look "real" is the texture(s) you slap onto them. (Click on the pic above to see it at full size ... check out those textures -- even the floor!)

Almost every model you're going to buy from a store like DAZ or Renderosity will come with its own textures. With luck, you'll score 2 or even 3 changes of texture to go along with, say, a shirt or a pair of pants. Then, if you want more (and you always do...) you'll wind up back at the store buying texture packs.

Now, if the packs are made by the designer, they're going to be "made to measure." You'll get fantastic textures made specifically for that one shirt. But ...

Supposing you just want "ordinary" fabrics. And you aren't thrilled about paying another ten or fifteen bucks for six or eight fabric patters. It occurs to you, "I wonder how they make these fabric patterns? I wonder if I could make them?"

And you probably can...
Every fabric pattern in the renders on this page was made by me. And if I hadn't come down sick -- like half of this group! -- it's going around like the plague -- I'd be telling you the whole story today, in fantastic detail, about how to MAKE them as well as use them.

As it is, I'm sneezing by brains out and everything aches, so I'm going to do this over two or three days. I'll make a start today by explaining the process with hints but not too much detail, plus how to to change out textures at whim. I'll add the detail to the story tomorrow!

First of all, you need to have some textures to change to. What you want is to have all your textures to hand ... and so that they don't "tile" when you apply them (that is, come up looking like squares on a bathroom floor), you need to make sure they're "seamless" textures...

It starts as a singel pattern "module" and these are wallpapered together in something like Photoshop -- or Gimp, which is the free, open source clone of same. You need to wind up with a good-sized square, at least 1000x1000 pixels, so the textures look nice when applied. Too small a square, and you can start to get low-rez appearances.

Here's the trick: how BIG or how SMALL the original pattern appears in the applied fabric, can be adjusted by changing the number of times it appears in your texture square. The more times it shows up in the square, the smaller it'll be when you apply it.

So you can can get a half dozen different effects out of just one seamless background pattern ... and it's going to come out looking something like this:

So play around and make a bunch of different ones. Store them in their own folder -- on the desktop is handy, because you'll need to be getting back to them when you apply them.

And you apply them by using the Surfaces tab in DAZ Studio 3. In the Surfaces tab, click on the name of the default texture which is used -- this loads along with the OBJ model. Click on the .jpg name of the default texture ... a menu comes up ... click BROWSE. Then, go Desktop > Textures (or whatever you called the folder), and just double-click the one you want to change to.

Shazoom! The texture changes, and it's wall-to-wall, and because it's seamless it looks like fabric. The next thing to think about, though, is how to put some surface texture into this fabric, because right now it looks like a printed plastic bag, right? Not the effect you want? The effect you want is this:


...and if I wasn't about to expire, I'd be telling you how to do it! As I am about to fall face-first into the desk --

Join me tomorrow, and I'll tell you about displacement maps ... what they are, how they work, and (even better) how to MAKE your own!

Jade, 15 April (Anzac Day)

Friday, April 23, 2010

Textures for 3D models, in DAZ Studio 3



Textures for 3D models ... creating textures ... hand painting textures for your models ... a whole panorama just opened up in front of me, and it's like Christmas just came in April!

Change of plans from what I'd expected to be doing. I did go to Renderosity and buy a pack of fantastic textures ... these are not them. I assumed the textures would be JPEGs, which most of the rest of the world uses. They're not: they're "process" items, where a handful of base materials are plugged into an engine, and the engine generates the texture for you, from the selection of overlays. Here's the snag: the engine is in Poser, and I used DAZ. In DAZ Studio 3, all you wind up with is the handful of fantastic base materials, none of which, itself, is one of the textures you'd been hoping for --

Which got me to thinking: if an engine can combine them, what's going to stop an artist from doing the same thing? So I did -- and it's easy --

After which I ran about on the Internet a bit and gathered a few seamless textures (FREE ones, people ... no need to steal anything. Try this: http://www.grsites.com/) and then just doodled to see what would happen...


Now, if you've been on this blog for any length of time, you'll know most of the basic props. I don't have an endless props room, so I mix and match everything. But ... will you just look at what happens when you slap two things onto a boring old .OBJ (object ... 3D thing) ...! Go ahead and click on the above -- in fact, on any or all of the pics in this post -- they're all uploaded at large size, so you can see the details.

There's two things contribute to this effect 1) a texture, which is the JPEG you just made in your imaging program(s); and 2) a displacement map. And the displacement map contributes as much to the effect as the JPEG.

Have a look at these, full-size:

You can probably see that there's a visible texture made up of colors, and a second texture made up of "roughness" or "surface detail." This is the displacement map.

I've reworked a couple of "detail shots" from the leader renders from this post, so you can see the effects a bit more clearly:

Every texture you're looking at in these shots was made by me from free textures you can pick up off the web, in a few minutes flat ... including the one that looks so fantastic on the coat; and Michael 4's calypso pants, and the sweaters -- all of them. Also the colors and textures on the candles, shield, pillar, mask. The objects themselves (boots, candles, shirt et al) are 3D models which you buy from online stores like DAZ 3D and Renderosity. But all the colors and textures you're seeing on this post here started life about two hours ago in my imagination.

Intrigued?! Come back tomorrow, and I'll tell you how!

Jade, 23 April