Cyan-style blends?

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!
Tayrtahn
Posts: 13
Joined: Tue Nov 20, 2007 9:34 am

Cyan-style blends?

Post by Tayrtahn »

Well, I've been struggling to figure this one out myself for days now... I figure it's time to ask the experts. ;)


I'm trying to create blends in the same way that Cyan appears to create them - that is, using a little 64x4 grayscale ramp. It's just so much more efficient than the alternatives.

I can make alpha blends with vertex painting, and I understand how stencils can be used to make blends between textures. I'm not wild about the idea of having a bunch of stencil textures hogging up my Age's resources though. From importing Cyan-made Ages in an older version of PyPRP, I got some hints about how they do it. It seems that rather than creating a new texture for each blend, they use the same grayscale ramp texture with a different UV map, essentially just mapping each UV to a different shade of gray. Efficient!

Is there an easy way to replicate this method in Blender+PyPRP? Assigning a greyscale tone to each vertex sounds like a job for vertex painting, but Blender uses vertex color maps at the mesh level, and this would need one at the material or texture level. I'm tempted to write a little python script to convert a grayscale vertex color map into UV coordinates, but I'm curious to know if there's a better way. Any tips or thoughts?
User avatar
Trylon
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
MOULa KI#: 0
Location: Gone from Uru

Re: Cyan-style blends?

Post by Trylon »

Choosing the "Blend" type texture as texture, causes PyPrp to automatically make an alphablend texture of that type (horizontal, vertical, and IIRC also the other kinds).
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
Tayrtahn
Posts: 13
Joined: Tue Nov 20, 2007 9:34 am

Re: Cyan-style blends?

Post by Tayrtahn »

Aha, indeed it does. Handy!

Now... how would I go about mapping UVs to different points on the blend texture? I suppose I could select and drag each individual UV to the right shade, but that sounds like a huge pain.
User avatar
Whilyam
Posts: 1023
Joined: Sat Sep 29, 2007 5:55 pm
MOULa KI#: 22798
Contact:

Re: Cyan-style blends?

Post by Whilyam »

I'd like to know too. I use the vertex painting because I always got stuck on this.
User avatar
GPNMilano
Posts: 1155
Joined: Mon Apr 21, 2008 5:50 am
MOULa KI#: 24104

Re: Cyan-style blends?

Post by GPNMilano »

Hehe, quite easy. In the texture section of blender, create a layer with a blend, (As Trylon suggested) then immediately after that you put the layer you wish to have blended (If any). In the mapto section you then choose the stencil option for the layer with the blend on it.

So let's say you want to blend the sides of a cavern wall with the ground of the cavern. The sides of your cavern walll would be one material (your rock material) the ground would be another material (your dirt material) and the faces at which they join, around the edge of the walls would be your blended material with three textures (rock, then the alpha blend, then the dirt).
You can't stop the truth. IC Blog
User avatar
Whilyam
Posts: 1023
Joined: Sat Sep 29, 2007 5:55 pm
MOULa KI#: 22798
Contact:

Re: Cyan-style blends?

Post by Whilyam »

Wow. That is very easy. So I don't need to UV map the blend stencil? Because that was the impression I got from the tutorial.
User avatar
GPNMilano
Posts: 1155
Joined: Mon Apr 21, 2008 5:50 am
MOULa KI#: 24104

Re: Cyan-style blends?

Post by GPNMilano »

Whilyam wrote:Wow. That is very easy. So I don't need to UV map the blend stencil? Because that was the impression I got from the tutorial.


Oh. Duh yeah. You'll need to UV map it. The blend layer should always be the last layer. So if you have two layers it will be layer 1. If you have 3 it will be layer 2 etc. (In Uru the layers start with 0) The easiest way to do this is to create a uv layer and texture it in the UV window with a blend map the same size as the one pyprp exports (Cyan used ones called ALPHA_BLEND_FILTER_U2 and ALPHA_BLEND_FILTER_V2 i think so i'd use these). Then you can select the alpha setting in the UV window so that you'll see what the texture actually looks like with alpha (it should be black on one side, white on the other) switch to your alpha vertex color setting and go into the editing panel (F9) and choose the texture face panel, now set alpha on all the faces (this is the "alpha" and then "copy") Now you can UV map it and see what it looks like in the 3d view if you've got that set for textured. Remember when UV mapping, just like vertex alpha blending, black is transparent, white is opaque.
You can't stop the truth. IC Blog
Tayrtahn
Posts: 13
Joined: Tue Nov 20, 2007 9:34 am

Re: Cyan-style blends?

Post by Tayrtahn »

Alright, I think I'm getting this...

I can get to this point:
http://i.imgur.com/XDtP3.jpg

...without trouble. But how to I turn this into a non-linear blend? Do I need to drag the UVs around on the map, or is there a nicer way to visualize this?
User avatar
Trylon
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
MOULa KI#: 0
Location: Gone from Uru

Re: Cyan-style blends?

Post by Trylon »

You'd need to map the edge UV's and corner UV's separately. The middle four blocks'd need to be mapped to full white.

An easier solution in your case would be to use the circle blend. Then you'd only need to bring the corner uv points a little more to the middle, and shrink the four center blocks.
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Whilyam
Posts: 1023
Joined: Sat Sep 29, 2007 5:55 pm
MOULa KI#: 22798
Contact:

Re: Cyan-style blends?

Post by Whilyam »

This doesn't work for me. Probably because I can't figure out the instructions. I tried blending from one rock to another and all it did was make it vanish.
Post Reply

Return to “Building”