OpenGL image with alpha are darker

Hello

I launch my game on BB10 (Portage from Android, PC). On PC Android, my game with an alpha images are ok, but on the playbook all alpha are darker. Something escapes me?

The code to load the texture:

glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, image.getWidth (), image.getHeight (), 0, GL_RGBA, GL_UNSIGNED_BYTE, image.getDatas ());

Code to render a texture:

glClearColor ((GLfloat) (gBackColor.r), (GLfloat) (gBackColor.g), (GLfloat) (gBackColor.b), (GLfloat) (gBackColor.a));

Clear the depth buffer and the screen: Note: no need pay the color buffer car on affcihe all the screen
glClear(GL_COLOR_BUFFER_BIT |) GL_DEPTH_BUFFER_BIT);
 
glLoadIdentity();
glPushMatrix();
 
glEnableClientState (GL_VERTEX_ARRAY);
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
glEnable (GL_TEXTURE_2D);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

M_Color = disp_GetGlobalDiffuse() lightDiffuse;

affects lightDiffuse
lightDiffuse * this =-> mDiffuseColor;
 
glColor4f ((GLfloat) (lightDiffuse.r), (GLfloat) (lightDiffuse.g), (GLfloat) (lightDiffuse.b), (GLfloat) lightDiffuse.a);

And finally, I use glDrawArrays (...)

On PC and Android, I have no problem.

Thank you

Found in other post of the thread:

transparency int = SCREEN_TRANSPARENCY_SOURCE_OVER;

screen_set_window_property_iv (screen_win_gles, SCREEN_PROPERTY_TRANSPARENCY, & transparency);

If you do not, then transparency is random.

And to add

int alphamode = SCREEN_PRE_MULTIPLIED_ALPHA;

RC = screen_set_window_property_iv (screen_win, SCREEN_PROPERTY_ALPHA_MODE, & alphamode);
If {(rc)
perror ("screen_set_window_property_iv (SCREEN_PROPERTY_ALPHA_MODE)");
bbutil_terminate();
Return EXIT_FAILURE;
}

Tags: BlackBerry Developers

Similar Questions

  • How to do an image have several clickable camp arrives with a box next to the image with a text. as I click on a bone in an image a box comes up next to the image with which are the OS.

    How to do an image have several clickable camp arrives with a box next to the image with a text. as I click on a bone in an image a box comes up next to the image with which are the OS. I have cs6

    This article has very clear steps & description of what you're trying to accomplish:

    http://Demosthenes.info/blog/537/enhancing-Imagemaps-with-CSS3-popups#wheelset

  • IMAQ image with alpha (partial transparency) blending overlay?

    I'm using Labview 2014 on Win7. I found examples of image color with binary transparency overlay (A + B = OUT with each output pixel is 100% image A or B of the image), but have found no examples of mixture alpha (partial transparency). For example, a few pixels output are (20% to + 80% B).   I can do it in LabView?

    IMAQ ArrayToColorImage VI takes U64 pixels of the image and the clusters of 4 values unsigned 16 bit, interpreted as the red, green, blue, and Alpha planes.  Is there any VI that makes use of the 4th (alpha) plan to make an alpha blending by combining two bitmaps?

    IMAQ Overlay Bitmap VI comes with the note "Ce VI does not support alpha blending." Are there any other VI that supports alpha blend?

    Hi jbeale1,

    IMAQ does not display transparency. It maintains the alpha channel, but does nothing with him.

    If you want to emulate transparency alpha blending manually here is a page on that are:

    http://www.NI.com/example/26682/en/

    I hope this clarifies some things.

    Michael

  • Display image with blackened areas

    Hi - I'm new to these forums so I hope this is the right place for it.  I downloaded an image from a web model to watch the colors more closely before you buy it eventually and when I opened the image in CS4 it had a bunch of triangular blackened areas - a bit like a mask of some sort, I think.  I then tried to create a new document and open an existing PSD file unrelated and now they have the same triangular blackened areas.  Help please!

    You need to update your video card driver. This is a classic problem with bugs in the 3D drivers.

  • Sequence of images with alpha to video with transparency

    I have a sequence of png images that has an alpha channel. I care about her as a kind of video where if I import into PowerPoint, I can overlay on a background and have the visible bottom where the video alpha is out.

    Is it possible to release a video with transparency?

    TIA

    Dean

    When people ask me to do that I have shot greenscreen then match the background color of the powerpoint. It is the only solution.

  • development module when I change something with correction of the area I can't move to the next image with the right arrow key

    Hello

    I work with the module development and when I change something with correction of the area I can't move to the next image with the right arrow.

    Is there a solution?

    Norbert

    I think that Yes you are talking about "Spot healing.

    So once you have used the tool, please click "Fertig" at the bottom right of the image.

    Try, and then use the arrow keys.

  • Customer must ProRes with alpha - what are my options?

    Customer request files ProRes 1920 x 1080 23.98 FPS. Apparently, he asked their client for files in this format.

    I did work with ProRes + files alpha. (I go to ProRes all the time but never done with alpha).

    What is the process for rendering on my computer? I can choose 4444 and designate RGB + A, but apparently it messes up my depth of color on the export because it uses trillions of colors by default.

    I don't know what to do here.

    -------------S

    The flavor of ONLY of ProRes that supports alpha channels is ProRes 4444.  You must ProRes?  That's what you use.

    And Yes, you will get trillions of colors +; If this weird you, use the PNG codec, which also supports alpha channels.

    Make sure you get the flow of images directly in AE, too.  He is NOT 23.98, that is 23.976 and the difference can kill you.

  • export the image with an alpha channel in cs3

    on the video layer 1 I have a background image and video 2 I have a psd numbered video of maya (is the text animation) with an alpha channel (black is the alpha).

    If I export the end frame (even with 1 off video (background)... I don't get a bmp or tiff with alpha channel image.  I get the black background.

    is it possible to export end frame and keep the alpha channel?

    Thank you!

    Search millions of colors +, this will give you channel alfa.

  • Update the clips with Alpha channel does not work after August 2016

    It's really random, I have a bunch of Silhouettes of Motion Designer of Digital Juice in my current project, and after the last update, none of them appear in the monitor of the composition. The clips are still there. Nothing is changed. But none of the Silhouettes. They are Quicktime video files with alpha and have the silhouette of a person to perform various tasks.

    They are not involved in After Effects and first.

    I have also a few clips with alpha explosion on my calendar. Those who still work, but they are not as vivid and intense as they were before the update.

    Help? All advice would be much appreciated.

    all the information I have shows that there is a bug in 13.8.1 on some OS systems. What is yours? It mainly occurs on Windows 10 and a few BONES. the solution is to uninstall quicktime or working with the version 2015.2. Have a look here:

    Re: New update broke PNG .mov format

    Color of EI error/bug on PNG + (codec)

    Problems with fire and muzzle Flash Active

    Re: AE interpereting not color values

    Layers of color to Alpha. MOV shifted on reopening program

    Re: Images of channel Alpha displays incorrect colors. Need help ASAP! I have samples

    a shared sorrow is a reduced sentence by half

    Why what happened? My guess would be that it comes to this

    Source: update is now available from effects CC 2015.3 (13.8.1) Bug - Fix | Creative blog Cloud by Adobe

    Please file a bug report and also a link to this thread: feature request/Bug Report Form

  • Make the color with alpha % as hex-color look?

    Hello

    Sorry for the strange subject line. Here's what I mean:

    Let's say I have a block with a solid red color (rgba 200, 0, 0) #c80000.  Under/below, I have a solid white area. Now I want to do the slightly translucent red block by adding alpha.

    But when I do this, the Red block becomes lighter (aw, collisions...). More alpha, lighter, seems.

    What I am asking is: is there the paintings or the source of all kinds which compares the solid and translucent colors? As "If you want a block with alpha 10% on a white background look like solid #c80000 you need to use #b90000 (RGB (185, 0, 0).

    Or something like that...

    See you soon

    Opacity/transparency/alpha does not work like that. He always goes to show the background color if you give a framework alpha in a less than 1.0 rgba color

    I think that looking for ways of merging of css...

    Basics of CSS blend modes | CSS-Tricks

    Background-mix-mode CSS property

    Unfortunately, it only is not supported in all browsers (OK, pretty much MS browsers), then your best bet is to use layer Photoshop blend modes in your images instead.

    http://caniuse.com/#search=blend-mode

  • export the video with alpha channel

    Hello

    I am brand new with Pro CC first. I completed a sequence where V1 has a series of still images, of small size, so I can see the video clip on the V2 in the background.

    I already exported only and it works very well.

    I would now like to export the clip on V1 by single with alpha channel so that I could put a different background in a new sequence.

    Read and followed the instructions as described in the forum, but they must use something different than what I use (first Pro CC on a laptop with windows 7 Professional), because I do not see the indicated settings.

    Once the clip is exported with an Alpha channel, I'll bring Premier Pro and everything just change the background several times so I will gradually in with several different sequences.

    How could I accomplish this export with an Alpha channel?

    Thanks for the info.

    Bert

    Hi Bert,.

    I think you have your tracks reversed, the stills would be on background on V1 and V2. Of course, if a SINGLE export with alpha and no background, then you can simply use V1 (but later, we clip you made must be V2 or higher to insert background on a bottom rail to show areas of the alpha channel). Export using QuickTime > GoPro 12-bit with Alpha codec.

    Thank you

    Jeff Pulera

    Safe Harbor computers

  • Try a background image with a PNG with transparency matte / partial transparency

    Hello everyone.

    Here's the scenario;

    1. I have a PNG sequence rendered in a 3d program. The sequence has a landscape that is partially transparent and has no background image or color. In the animation, which is not the landscape is 100% transparent, while the landscape is partially transparent.
    2. I have a background that I want to put behind the PNG sequence but I don't want the background visible through the part of the landscape of the sequence, only the portion that is 100% transparent.

    I tried several different methods, but because the landscape is partially transparent, with a matte (alpha or alpha reverse) or blend (such as stencil alpha) mode does not give me the results I'm looking for.

    I'm looking for is a way of mast (or mask) the background image with only the part of the PNG that is 100% transparent. In this way, the background image are not displayed in the semi transparent landscape, but will be visible in the part that is 100% transparent.

    I would like to find a reasonable solution in After Effects, as opposed to the sequence of 3d objects rendered being invisible to the camera and the current background. The landscape scene itself took a considerable amount of time to make (120 hours) and I would like to avoid this kind of delay in my project.

    Thank you all in advance for your consideration.

    Maybe I said incorrectly: you cannot use the 3D app to generate a matte black and white simple - or mattes - to separate properly, then just composite in AE?

  • export to FLV with alpha

    Hi all

    I'm in the workplace and the customer has exported to .flv with alpha channels videos into a video popup Web site that has the sign language translation of the accompanying text, similar to what is on this Web page:

    http://www.CHS.ca/index.php?option=com_content & view = article & ID = 736 & Itemid = 56 & lang = in

    Screen Shot 2013-10-23 at 1.58.26 PM.png

    the web developer could not figure out how to get the alpha to become transparent, which is not the issue here.

    I'm having is with the quality of exports .flv.

    video from the site mentioned above looks like this:

    Screen Shot 2013-10-23 at 2.01.33 PM.png

    It has good resolution photos.

    However, when I try to export mine since a 4.2.2 1080 p.  video source for the codec On2 VP6 flash resized to 320, it comes out looking pixelated all like that:

    Screen Shot 2013-10-23 at 2.03.43 PM.png

    I have maxed out the bitrate to 10,000, set it to 2 passes, constant bit rate, quality at best, he's looking for the same thing.

    is it possible to get the video to keep its image resolution and all in maintaining the alpha channel?

    -ps: I forgot to mention, I contacted the company on the site (I used to work at the time) both web developer and video technician do more, the Manager has no idea on the details of the Web site, he's recently been subcontracted to an outside company, which will revamp the entire site.

    I don't remember if FLV has the same problems as the other codecs, but try to keep both divisible by 16.

    So, try 512 X 288

    You will also notice that 288 is also divisible by 9.

    The settings that you use are not in reality of 16:9. They are close, but close counts in horseshoes and other such efforts. Not in the mathmatical concepts used for video encoding. They are not even divisible by 8, or 16.

  • Best video codec without loss of prerenders of cartoon with alpha

    Hey guys.  I have done a lot of research on this but still can not find a satisfactory solution.

    I have hundreds of comps I prerender and re - use on a regular basis.  These compositions are simple solid colors, cartoons, character animation.  They contain a LOT of space, with the image composed of only a small part of the frame.  This is necessary for all line up in the end.  I must be able to decode these prerenders on Mac and Windows, but it's OK if they can only be encoded on the Mac.  I need for a fast codec for decoding, but I don't like how much time it takes to encode them.  I don't like which is the container, but Quicktime seems to be the best container that supports the AE.

    After many tests, the only reasonable formats, that I could find were:

    ProRes 4444

    Animation

    I tried DnxHD, PNG (Quicktime), PNG (Image sequence) and all other variants ProRes (with a separate film for alpha).  DnxHD does not work because it does work to fixed sizes and peaks out at 1920 x 1080.  All other variants ProRes do not work because they do not have alpha, and when I use a separate ProRes for Alpha rendering, there are artifacts on the edges.  PNG to QuickTime is much too slow to decode, and the files are larger than the Animation.  Using image sequences is a pain to maintain and seems to be slower as well.  I wish I could try codecs like HuffYuv and Lagarith, but they are not supported on Mac.

    ProRes 4 x 4 would be perfect, but I have no need of 16-bit color.  Animation is the fastest codec, but produces files that are too big.  75% quality, it produces smaller than ProRes files, but introduces artifacts.

    I was wondering if there is a 8-bit with alpha codec that anyone would recommend for this.

    Also, I wonder if using a single, very long Quicktime files are faster for AE to use that much more short Quicktime files.

    Thank you

    Bryan

    You must take another look at PNG... the video codec of QT, in other words: it indeed does support alpha channels!  In general, the size of the files is a bit smaller than the Animation, is a 10-bit codec.  As Animation, there is also no loss.

    I can't speak to the length of the file.  It depends on what is happening in the animation, and how you plan to use.

  • Whenever I have download an image with the command "save the image under...". ", it records in a useless file of 168 bits.

    As stated, whenever I have download an image with the command "save image under" he recorded in a useless file of 168 bits. This does not happen everytime I have save an image, but more often the not, and I don't have a lot of useless files hang out because of this. Is it possible to re - download each image 168 bits that he should have been downloaded in the first place? Is it possible to ensure that this does not happen?

    Here's what it looks like:
    http://i.imgur.com/yzgwwgC.gif?1

    This means that you are not allowed to do this action.
    The site could use a transparent overlay image to protect the actual image or otherwise has put in place a protection.
    You can check if see you the image in "tools > Page Info > Media ' and save it.

Maybe you are looking for