Jump to content

Translucency inside translucent object.


Recommended Posts

So I made an orb, and lowered its alpha value so that it's translucent, like glass. Inside the orb I placed a sprite, which also has transparency via alpha channel. Now, the sprite appears completely invisible despite the orb still being translucent. I've heard of this issue before, but are there any solutions or ways to circumvent this problem? Is it not possible at all for example to have a glass object inside another glass object?

 

Thanks

Link to comment
Share on other sites

Use Alpha Test and not Alpha Blend.

 

Alpha test will render how you want. However, it has limitations, ie that if you want blended alpha as in a gradient you want to use Alpha Blend. If you use Alpha Test it'll look crap :tongue:

 

However I think you can simply avoid this problem all together and still be using Alpha Blend. :biggrin:

 

Open your nif, select the sprite, and move it up in the block list order, ctrl+arrow keys.

 

Objects are drawn according to their block order they are encountered in the nif: block 1 is drawn before block 10, in much the same way as each of those object are drawn by their vertex number index: vertex 1 is drawn before vertex 10 . This has obvious implications with Alpha Blend, Basically if that alpha technique is used it won't allow the zbuffer to draw pixels behind an object that is already drawn. So since the orb was rendered first, anything that it tries to render next that would technically be behind the orb, thus further back in the z-buffer, ie something that is inside it, can't be rendered. It is a limitation.

 

Anyway I think I have an object that is pretty much as you describe. So if manually changing the block order doesn't help maybe looking at this will help. I also have lava lamps on F3 nexus that use multi layer transparency, that I may have done slightly differently :shrug:

http://www.megaupload.com/?d=Z0IO9QO6

Link to comment
Share on other sites

Use Alpha Test and not Alpha Blend.

 

Alpha test will render how you want. However, it has limitations, ie that if you want blended alpha as in a gradient you want to use Alpha Blend. If you use Alpha Test it'll look crap :tongue:

 

However I think you can simply avoid this problem all together and still be using Alpha Blend. :biggrin:

 

Open your nif, select the sprite, and move it up in the block list order, ctrl+arrow keys.

 

Objects are drawn according to their block order they are encountered in the nif: block 1 is drawn before block 10, in much the same way as each of those object are drawn by their vertex number index: vertex 1 is drawn before vertex 10 . This has obvious implications with Alpha Blend, Basically if that alpha technique is used it won't allow the zbuffer to draw pixels behind an object that is already drawn. So since the orb was rendered first, anything that it tries to render next that would technically be behind the orb, thus further back in the z-buffer, ie something that is inside it, can't be rendered. It is a limitation.

 

Anyway I think I have an object that is pretty much as you describe. So if manually changing the block order doesn't help maybe looking at this will help. I also have lava lamps on F3 nexus that use multi layer transparency, that I may have done slightly differently :shrug:

http://www.megaupload.com/?d=Z0IO9QO6

 

That's actually what I've been doing for my previous models (in sprite plane before sprite plane situations), used both alpha test and block order method and haven't had trouble. I can't use alpha test here since I want the glass to be translucent, not completely invisible. I also tried moving the block order like I usually do. It works, to a small extent. I'm not sure why, but while the model appears perfectly in nifskope, in the game itself, the inner sprite only shows up when viewed from certain angles, from other angles it disappears again.

 

Wonder if it has to do with the fact that I used the inner sprite as a billboard, don't see why that has anything to do with alpha but never know. I will take a look at the file you provided in the morning. Thanks.

Link to comment
Share on other sites

the problem comes from the nif format.

it doesn't allow multiple meshes with alpha channel. there can be bugs with hair and transparent clothes, for example.

to see the inner mesh, you have to remove the alpha property on it.

Link to comment
Share on other sites

Try looking at the lightsabers on F3 nexus if you still have problems. I have bilboards and like 4 layers of alpha on them

 

 

edit: oh yeah, oblivion..... and yeah that bottle might not even work, I can't remember. but it IS possible.

 

 

Well you can make the sprite a particle system and I can get it to work that way, probably. :biggrin:

particles will render multi layered in Ob.

 

they changed the shaders since F3. the basically removed the old one and implemented a whole new one, that kicks ass. Which allows you to easily set up any sort of multilayered

 

another way in Ob would be to make the sprite and orb 1 object... but that has its limitations.

Edited by Ghogiel
Link to comment
Share on other sites

If you end up not being able to get a desired effect with two alphas, you might at least be able to get close by making the inner orb white and then applying an APPLY_HILIGHT setting to it in NifSkope (when clicked on NiTexturingProperties, it's on Apply Mode in the lower Block Details list. It will probably be APPLY_MODULATE by default.)

 

That will at least make it look kind of like a fushigi... :teehee:

Link to comment
Share on other sites

One thing you can try is to make both parts of the object the same mesh object. It may require some reworking of the textures, but should allow for multi-layer alphas. I managed to get a partially transparent mesh working that I could apply in several layers without a hitch on different objects somehow for use as a shadow mesh, but be damned if I remember how.
Link to comment
Share on other sites

but be damned if I remember how.

It'll be drawn by vertex number order. so you just reorder the vertex numbers accordingly. Strippifying will likely break it, so do not PyFFI those nifs. or at least do them separately.. and double check each one for sorting issues.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...