Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 14, 2019 7:59 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: OpenGL and Texture Transparency
PostPosted: Sun Jan 31, 2010 9:29 pm 
Offline

Joined: Thu Apr 02, 2009 11:34 am
Posts: 15
Location: Earth
Good news! I got it!

seems the following line in the RGBA load code worked:

ImageData.Byte( count + 3 ) = (1.0-mpixel.value) * 255


I was reminded by some one in the IRC channel that in OpenGL 1.0 is fully opaque and 0.0 is transparent.

Thanks for all the help :)

and some one should make note of that in the OpenGL example code (for OpenGLTexture) so that this confusion doesn't happen again :)

Thanks again for all the help and regards.

_________________
Eric Hoaglin
GryphonClaw Software
Come Join the REALbasic IRC Channel on Freenode


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL and Texture Transparency
PostPosted: Sun Jan 31, 2010 9:57 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
dang, I had just solved it! I was going to say that your mask is inverted.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL and Texture Transparency
PostPosted: Sun Jan 31, 2010 10:49 pm 
Offline

Joined: Thu Apr 02, 2009 11:34 am
Posts: 15
Location: Earth
Just to let you know, that code (the original code that is) is directly from your OpenGL Controls demo. So I think an update is in order :)

_________________
Eric Hoaglin
GryphonClaw Software
Come Join the REALbasic IRC Channel on Freenode


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL and Texture Transparency
PostPosted: Sun Jan 31, 2010 11:06 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
Yeah, I know, I can tell my own code when I see it ;)

The code actually works as it is supposed to work with the black part of the mask being the transparent part to white being opaque to mimic what OpenGL naturally does.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL and Texture Transparency
PostPosted: Sun Jan 31, 2010 11:14 pm 
Offline

Joined: Thu Apr 02, 2009 11:34 am
Posts: 15
Location: Earth
So perhaps the class could have a boolean property such as

Protected OpenGLStyleMask As Boolean


And have that determine if the mask is setup with

ImageData.Byte( count + 3 ) = (1.0-mpixel.value) * 255


or

ImageData.Byte( count + 3 ) = mpixel.value * 255


Would that work, as the way the code came... I was loading the image from an RB Picture and it was causing the error
I had.

Also another note, I found that if I removed all the code to check for Alpha etc, I still get the transparent image... Not too much of an issue I suppose since that's what I've wanted to get... but doesn't that mean the transparency stuff (tests etc) doesn't mean anything? - Edit: Actually disregard this, I found that I was enabling BLEND etc in the Render event... heh not sure how I missed that....

_________________
Eric Hoaglin
GryphonClaw Software
Come Join the REALbasic IRC Channel on Freenode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group