Question About P3D's Alpa Abilities

Return to General Discussion

Question About P3D's Alpa Abilities

Postby markjacksonguy » Sat Jul 14, 2012 11:35 pm

Another day more programming stress, :lol:

Anyway


I was just wonder about this... If P3D doesn't support this, then I'll go with option two.

I'm sure you're probably thinking to yourself, "ask the question already!"

Sure...

I have worked with graphic engines that had the ability to make an object transparent to which ever degree specified.

I'm not talking about a transparent texture mapped on and object; a completely none transparent texture mapped onto an object that goes transparent.

That's my question... Does P3D have the APIs for making a none transparent object or mesh (actor or not) become transparent (through code)?

If not, that would be a nice addition to the APIs for those into OpenGL graphic Programming and shaders.
User avatar
markjacksonguy
 
Posts: 443
Joined: Wed Sep 28, 2011 4:06 pm

Postby Brisingr » Sun Jul 15, 2012 11:47 am

Is this what you are looking for?
Code: Select all
nodePath.setAlphaScale(alpha)
Brisingr
 
Posts: 33
Joined: Thu Aug 05, 2010 12:29 pm

Postby markjacksonguy » Mon Jul 16, 2012 1:32 pm

Brisingr wrote:Is this what you are looking for?
Code: Select all
nodePath.setAlphaScale(alpha)



Not sure...but I'll give it a test.
User avatar
markjacksonguy
 
Posts: 443
Joined: Wed Sep 28, 2011 4:06 pm

Postby markjacksonguy » Mon Jul 16, 2012 1:41 pm

markjacksonguy wrote:
Brisingr wrote:Is this what you are looking for?
Code: Select all
nodePath.setAlphaScale(alpha)



Not sure...but I'll give it a test.



"Nope..." Didn't work. I'm guessing that only works if the object had some form of alpha to begin with...? Maybe...

I used it on an Actor to see if it would indeed turn half transparent (0.5).

I'm guessing such code was not structured into a function/method for the engine.... :cry:

Oh crap... I'll just use the second method then. :)

(I hope it doesn't wreck the fps :shock: )
User avatar
markjacksonguy
 
Posts: 443
Joined: Wed Sep 28, 2011 4:06 pm

Postby wezu » Mon Jul 16, 2012 3:45 pm

You've got to add
Code: Select all
node.setTransparency(TransparencyAttrib.MAlpha)

or some other TransparencyAttrib.

If a model has a modulate texture in rgba format (even if the texture has an empty alpha channel), then the loader will set up the transparency all by itself.
I may be totally wrong, cause I'm a dancin' fool.
User avatar
wezu
 
Posts: 514
Joined: Tue May 19, 2009 1:03 pm

Postby Bradamante » Tue Jul 17, 2012 5:40 pm

I'm also pretty sure that in the past I loaded a model and set a texture on it with no transparency whatsoever and then used

Code: Select all
node.setColor(1,1,1,.5)


and it got transparent. Can you confirm this?
iMac (2009), Mac OS X.8.1 - MacBookPro (2007), Mac OS X.8.2
@ YouTube
User avatar
Bradamante
 
Posts: 303
Joined: Tue Nov 25, 2008 10:58 am
Location: Leipzig, Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest