Alpha blended textures?

Is there a texture or material that works with iPhone, that could blend two textures by using the alpha?
Thanks in advance!

edit: I suppose the decal texture does that anyway…

there probably isn’t a way to seperate the alpha though, if you want to tile the two textures.

http://www.unifycommunity.com/wiki/index.php?title=Blend_2_Textures_by_Lightmap_Alpha

Let me know if that’s the kind of thing you’re looking for. It can easily be modified to work without a lightmap. The “splatmap” can even be stored in the alpha of either of the two textures, if one of the textures is imported at a good enough resolution for you.

thats it! hopefully it works on iphone :slight_smile:

could the first channel be diffuse with lighting?

It does. I specifically wrote it for that. Check the comments in the shader, and you’ll see that a different subshader is used for the 3GS and later, where it can run extra-fast. Visually identical results, though, on either device.

I need to modify it so that it accepts lighting and then it will be perfect :slight_smile:

ok this is the one that I want -
http://www.unifycommunity.com/wiki/index.php?title=LayerShader

Hopefully it will work with iPhone. Only one way to find out!

That’s not true at all. I (partially) wrote it too. You could ask me. :stuck_out_tongue:

Or you could learn how to figure out what runs on the iPhone. If you see “SetTexture” more than twice in a Subshader, it won’t run on the iPhone. If you see any CG or GLSL in the Subshader, it won’t run on the iPhone (yet. I’m sure this will be changed for the 3GS and later eventually).

But anyway, despite the fact that it will indeed run on the iPhone, I bet you don’t really want to use that shader. Using an 8-bit alpha instead of a PVRTC is probably unnecessary. Let me know what you actually need, and I’ll see what I can come up with. For example, this latter shader only uses one UV set. That’s probably not a good choice for tiling textures. It’s simpler, but it’s a lot less powerful. Just come up with a list of what you actually need instead of hunting and pecking for a shader. The iPhone can’t do much, so it shouldn’t be too hard.

Here’s a short and incomplete (I don’t know everything and it doesn’t sound like you need anything exotic anyway) list of what you can work with:
2 UV sets
Vertex Colors
Ambient Light
Diffuse Light
Specular Light
Emissive Light (it only lights itself up - not anything else)
Fog
Tinting
Matrix transformations of UV sets
Transparency
Projecting a hole into stuff

There’s no point in using a more complex shader than what you actually need. It will induce clutter and likely run slower. Pick out what you actually care about.

ideally what I’d like is two textures seperately tileable, blended by an alpha channel - and they can accept lighting… terrain/path texture basically.
before what I was doing was making seperate material id’s for paths on mesh, and it just never looked good.

Thanks for looking into it for me! Your work is excellent!!!