PDA

View Full Version : how to set opacity for my sprites?


dougie0047
08-18-2008, 05:00 PM
Hi! So, I'm wondering about how i can set proper opacity for some sprites. my problem is this:

1: I cannot create sprite images with an alpha channel and use that, because i'm deriving the colours of the sprites from a single filetexture.
2: I cannot just add an opacity attr. per object, because that just sets an equal opacity level for the entire sprite. What i want is to have a circular form, with a completely opaque sprite in the middle with a falloff and 0 opacity at the edges.
3: When I add opacityPP, and try to hook it up to a UVRamp, or any other Ramp for that matter, I don't get desirable results. I don't even get result I can understand at all.

Can anyone help at all?

Thanks.

Dougie

hkspowers
08-18-2008, 09:52 PM
I am not sure why you can't just use an image with an alpha. Why can't you use two file textures? And if not just map it in the hyper shade using the same file texture node going to both the alpha and color channel.

dougie0047
08-19-2008, 01:08 AM
Well, I'm using a filetexture on the NURBS plane I'm emitting from, and under the Texture Emission rollout on the emitter, there is an option to inherit the colour of that texture. So, basically the particle (in this case the sprite) gets assigned the particular colour the texture has on the spot where the particle gets created. This is good. But it is just a flat colour, so I am stuck with a bunch of squares that don't really blend in with each other.
One can also choose to inherit the opacity of the texture, but there is no opacity on this texture. I want emission to occur from the entire surface and if I use an alpha channel on this image, then I will end up either not emitting from parts of the surface, or emitting just transparent sprites, which are of no use to me.
What I need is that each sprite gets created with the colours as explained, but doesn't look like an opaque square, but has a falloff in opaqueness/transparency towards the edges. This so that every "sprite-pixel" will blend in with the other particles. And, I've tried to use ramps to do this, but I don't anything near what I want.

Confused.

Dougie

hkspowers
08-19-2008, 01:41 AM
Ahh I see your delima. Well off the top of my head I can think of a quick workaround. You could get the sim you like then bake it out. After you bake it out just put a new file texture on the sprites that represents the alpha you want. Then use that pass as a replacement alpah channel in comp. I know this is a workaround, but thats all I can think of off the top of my head.

Hope it helps,
James

Aikiman
08-19-2008, 01:52 AM
If you load your sprite up with a file that has alpha but no image ie white canvas it will inherit the color of your emitter file and multiply that over your white sprite file so still retaining colour emission and have the alpha.

dougie0047
08-21-2008, 09:00 AM
thank you for the replies, hkspowers and Aikiman.
Sounds like an excellent suggestion Aikiman. I'll try it out as soon as I have time. And I think the workaround can be a useful technique too, but if it works with sprites within Maya, that would be great.

Edit: hmm, just a thought. If my sprite file is not white, but also has colour information, like a regular file texture, will the different colours interact, or will one override the other?

Dougie

hkspowers
08-21-2008, 07:10 PM
thank you for the replies, hkspowers and Aikiman.
Sounds like an excellent suggestion Aikiman. I'll try it out as soon as I have time. And I think the workaround can be a useful technique too, but if it works with sprites within Maya, that would be great.

Edit: hmm, just a thought. If my sprite file is not white, but also has colour information, like a regular file texture, will the different colours interact, or will one override the other?

Dougie

It will multiply the values over each other so your sprite image will have the color information added on top I believe.

Aikiman
08-21-2008, 08:54 PM
Mulitplied I think rather than added.

hkspowers
08-21-2008, 09:18 PM
Ahh yeah that's what I meant lol. Good catch.;)

CGTalk Moderation
08-21-2008, 09:18 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.