Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 05:00:48 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)More trouble with transparecy
Pages: [1]
Print
Author Topic: More trouble with transparecy  (Read 477 times)
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« on: 17. March 2011, 03:51:36 pm »

So,I've got a transform group containing Shape3Ds (TriangleArrays). The TriangleArrays contain Triangles which have vertex color information, including alpha.

When I try...

Code:

Shape3D foo = new Shape3D(triArray);
TransparencyAttributes ta = new TransparencyAttributes(TransparencyAttributes.NICEST, trans);
ta.setTransparency( transparency );
ta.setMode(BlendMode.BLENDED);
ta.setEnabled(true);
foo.getAppearance(true).setTransparencyAttributes(ta);


...I still get no change in the transparency of the object. If I override the vertex colors' alpha channel, it works. If I use a Material, it doesn't work. Interestingly, if I set the vertex colors' alpha to be opaque, it also doesn't work. So, I'm at a bit of a loss here.

Sibling Shape3Ds in the group (Line objects) do have correct transparency.

Does this have something to do with vertex colors, perhaps?

Thank you, as always, for any light you may shed on the matter.

-Chris
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #1 on: 17. March 2011, 04:32:05 pm »

Update: So, explicitly disabling alpha on the vertex colors (setAlpha(-1f)) seems to help, as well as having no material attached.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 17. March 2011, 05:59:18 pm »

An existing vertex alpha should always override the material or TransperencyAttributes.
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #3 on: 17. March 2011, 07:20:05 pm »

Fair enough. A use case I'm curious about, though, is how to handle something like gradually fading out an entire set of vertices with colors.

If I have the ghost of an astronaut, with a semi-transparent glass visor, and I want transparency on the entire model to fade in and out (while respecting the visor's "relative" transparency), how would this be accomplished?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #4 on: 18. March 2011, 02:52:19 pm »

You would certainly not handle the visor's transparency through vertex colors, but the texture. And this works in combination with transparency attributes.
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #5 on: 18. March 2011, 08:39:33 pm »

Makes sense.
Logged
mikelizzi
Just dropped in

Offline Offline

Posts: 8


View Profile Email
« Reply #6 on: 08. May 2011, 12:57:42 pm »

Hi,

I'm having trouble getting transparancy when I uses color alpha and assign color coordinates.   

I posted the code in the General Discussion forum.

Topic - "setting transparency on a visual object that has two colors"

This looks like the more appropriate place but I don't want to double post.  Perhaps the moderator can move my topic into this thread?
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic