Okay, I've been trying to fiddle around with the shader effects editor in MMF2/CF2.5. Sketchy's article ( http://create-games.com/article.asp?id=2275 ) and examples have been a big help, but I keep running into little things that I think SHOULD work, but for reasons I can't understand, don't.
The latest is my attempt at using a second texture as a parameter. There's support for this, and as far I as I can tell, I set it up right, but it's not working.
Here's what I've got:
xml file: ( disregard the ' in the <c'ode> )
<description>Trying to get texture loading to work</description>
...What I WANT this to do is take the alpha channel of the original object, and display the color channels of the second texture that I'm including. But the texture is showing up as completely black, no matter what I try.
...which is the same as your long and complicated formula.
The technical term for it is "swizzling", and it lets you do some neat tricks.
eg. "Color.rgb = Color.grb;" is an easy way to swap the red and green color channels.
Awesome, thanks! I didn't know that the registers needed to be consecutive. And for some reason, I thought that s1 was reserved for the background, and if you weren't using it it should be skipped. I have no idea why that was.
But it works now, thanks! And that "swizzling" bit it good to know, too!
Here it is working properly. The texture that the two diamonds are using is shown in the middle there. I've got it stretched across them using some parameters for X and Y scaling.
And the second texture repeats automatically! I was hoping that'd be the case, heh.
Probably! But I actually have no idea why it's fading to black in the first place. In the first one, the circle objects are solid red. Some side effect of the additive blending + alpha-blending + the shader I'm using, I guess?