|
I want to have one grayscale texture file for the alpha channel and one RGB texture file for the color. That way, I can either animate the offset of the colors while leaving the transparency fixed, or offset the transparency while leaving the colors where they are. This would be incredibly useful for all sorts of special FX. (I probably would want to make it based on self-illuminated / vertex-lit.) Does such a shader already exist somewhere? And this is a reach, but for iPhone, too? (I don't know what exactly makes a shader iPhoneable or not, but I understand that it's more limited in what it can do with its textures...)
(comments are locked)
|
|
The easiest way to do this is probably to use the same texture as two properties. That's one way to make it so you don't need to split RGB and A into two textures. When you say "iPhone", I assume you're talking about the obsolete iOS devices which can't run iOS 4.3, or this shader. I haven't thought of a way to match results on that hardware, and I recommend against supporting it anyway. If you have to, then let me know what you might be willing to sacrifice on the MBXLite. SeparateSpecular doesn't do anything on iOS, so I took it out, which will tone your highlights down. This could be written as a programmable shader to make highlights look better, but that opens up a can of lighting worms, and I'd need to know strictly what kind of and how many lights you want to support. I haven't tested this yet; let me know if it has errors. Also, I didn't make it Beast-compatible; let me know if that is requisite. Very cool, Jessy. Though I'm having trouble getting alpha to display using that shader. The other passes & properties work great, but it stays opaque when I use either a png with alpha or a tga with separate alpha channel. I'm also trying to pull out the _Illum pass, since I wont be needing it, but I'm definitely messing up the Layered shader pass approach!: " Shader "Custom/Separate Alpha" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _SpecColor ("Spec Color", Color) = (1,1,1,1) _Shininess ("Shininess", Range (0.1, 1)) = 0.7 _MainTex ("RGB", 2D) = "" _MainTexA ("Alpha", 2D) = "" } SubShader { Tags {Queue=Transparent} ZWrite Off Lighting On Material { Diffuse[_Color] Specular[_SpecColor] Shininess[_Shininess] } } } " Do you have any tips? I'm looking for the same result as OP, the ability to manipulate the alpha while locking down the texture.
Jun 19 '12 at 02:40 PM
Emericanized
(comments are locked)
|
|
I made this shader using Strumpy Shader Editor. I think that it does exactly what you asked, uses a different Texture for diffuse and alpha (using the alpha channel) so that you can adjust the offsets separately. I was using to make convincing clouds by adjusting the x offset of both textures at different rates. I have no idea how well it works on IOS.
(comments are locked)
|
