dim3 Forum

Full Version: Layers and Displaying Them
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

teh1ghool

Well I've noticed an odd effect. When making a muzzle flash setup in animator -- A cone with a transparent texture(only the round part textured) for the side-prongs and 3 flat pieces for the main blast(looks like an X sorta from front). The pronged model is clearly in front, yet the prongs appear behind the part that sticks out the front... wth? Is this a bug?

ccccc

ummm, could you show us a picture, that doesn't make any sense to me.

teh1ghool

Here it is. See the forward-going (main) flash is in front while in the model file it's behind?

[Image: flash_error.jpg]

ggadwa

All those are alphas, right?

[>] Brian

teh1ghool

They are pngs with transparent BGs, yes, an alpha channel. The one currently displayed on the front should be on the back.

But see, it';s like this:

[Image: 6a1627d2.png]

ggadwa

Yeah, I know what that problem is, and I don't really have a solution. Sad  What's going on is that, normally, things are sorted in z-order by the z-buffer, which basically only draws a pixel is the last pixel drawn there was farther away.

When something is transparent, you can't use the z-buffer because you can't eliminate pixels; you must see through them.

So what dim3 (and other engines do) is to draw all opaque segments first, then draw all the alpha segments.  The alpha also needs some sorting, but that's slow and it's usually pretty poor (for speed.)

The problem you have, is you have a lot of alpha pieces that are nearly impossible to sort right as they overlap.  It's easy for you, as a human, to get it right, but not as a computer.

My suggestion to try:  The "X" part -- don't make it alpha, make it solid.  i.e., some kind of cone with the fire texture on it.  Leave the outer parts alpha.  That will solve the problem.

[>] Brian

teh1ghool

jamie

I'm not sure if this applies so forgive me if it does not. But what about making two seperate flashes, one for the 'front' part and one for the 'back' part, instead of building it as one whole unit. Would it then display correctly?

I guess it would be more work in scripting though right?

Just a thought.

jamie

ggadwa

teh1ghool Wrote:I don't understand. All I have is this texture on them:
http://img.photobucket.com/albums/v706/w...199dae.png

http://img.photobucket.com/albums/v706/w...5684a6.png

It's because they are both alpha. I'm suggesting redoing the X part into a cone and putting a NON-ALPHA texture on it. That'll fix the problem.

Modern card-bound games use "z-buffering", which eliminates pixels by comparing the z of each pixel drawn. When you have alpha, you can't use z-buffering, because pixels don't eliminate each other (they can be seen through.)

So, dim3 attempts to sort (back to front) the alpha the quickest way it can. Sometimes this doesn't work right, and very complex alphas (especially ones that cross over) it's not going to be possible (you'd have to sort on a per-pixel level.)

So, my suggestion was to make the center X part a cone with a non-alpha texture on it, which means the only problem would be the outside texture, which won't have the sort problem with the cone.

[>] Brian

mafoo

Try setting the transparency around 0.1-0.2 for the texture (In gimp/PS), Ive had varied results:

[Image: crystal-trans.jpg]

As you can see, the crystals are see-through, but the spider bot (look closely) looks as if its in the foreground. :|

For a muzzle flash if you strobe the mesh with the flare on it, you will trick the eye into thinking its transparent.
Pages: 1 2
Reference URL's