Page 1 of 2
Cyan-style blends?
Posted: Mon Mar 08, 2010 10:47 am
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?
Re: Cyan-style blends?
Posted: Mon Mar 08, 2010 1:23 pm
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).
Re: Cyan-style blends?
Posted: Mon Mar 08, 2010 1:53 pm
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.
Re: Cyan-style blends?
Posted: Mon Mar 08, 2010 7:04 pm
by Whilyam
I'd like to know too. I use the vertex painting because I always got stuck on this.
Re: Cyan-style blends?
Posted: Mon Mar 08, 2010 9:49 pm
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).
Re: Cyan-style blends?
Posted: Tue Mar 09, 2010 5:54 am
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.
Re: Cyan-style blends?
Posted: Tue Mar 09, 2010 11:08 am
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.
Re: Cyan-style blends?
Posted: Tue Mar 09, 2010 1:12 pm
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?
Re: Cyan-style blends?
Posted: Tue Mar 09, 2010 2:07 pm
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.
Re: Cyan-style blends?
Posted: Tue Mar 09, 2010 3:27 pm
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.