OpenGL ES Textures with alpha layer not working with Colorpointers

Hey,
I'm trying to get a texture - that's loaded from a .png file - to fade out gradually. I can load it using the Apple's "Texture2d" class and present it with its own transparency. The problem is when I try to combine that transparency with a color pointer. I'll try to give an example code...
const GLubyte squareColors[] = {
128, 128, 128, 128,
128, 128, 128, 128,
0, 0, 0, 0,
0, 0,0, 0,
glColorPointer(4, GLUNSIGNEDBYTE, 0, squareColors);
glEnableClientState(GLCOLORARRAY);
glEnable(GLTEXTURE2D);
glEnableClientState(GLTEXTURE_COORDARRAY);
glEnableClientState(GLVERTEXARRAY);
glTexEnvi(GLTEXTUREENV, GLTEXTURE_ENVMODE, GL_REPLACE);
glEnable(GL_BLEND);
glBlendFunc(GLSRCALPHA, GLONE_MINUS_SRCALPHA);
for (Sprite *element in dynamicBodies) {
glLoadIdentity();
[element renderSprite];
Now, if the original .png happens to be completely opaque, it gets darker and transparent because it gets multi-sampled with the color matrix. But if it has any see-through parts in itself, it does not get affected by the the color.
I'm sure it has to be possible to change the alpha percentage of an alpha layered texture, but I can't seem to find another way.
Does anyone happen to know why this does not work, or how it could be accomplished some other way? I would be highly appreciative.

You set your texture environment mode to GL_REPLACE. The implementation of this feature is to replace the primary color (set via ColorPointer or Color3f) with the sampled texture value, so your color will have no effect.
Replace the texture env mode with GL_MODULATE, which will multiply the Texture Unit Input Color (==PrimaryColor for Texture Unit 1) with the sampled texture value.

Similar Messages

  • FLV Video - Alpha Layer Not Working

    Hi I have a strange problem. I am trying to encode a AVI
    video into a FLV flash video which includes an alpha layer. These
    are the steps I have taken as follows:
    1. Created animation in photoshop, saved as PNG files.
    Imported files into Flash, and the alpha works great (but the size
    is too large, so I switched to embedded FLV video).
    2. Took PNG files and imported then in Premiere Pro 2 and
    exported the video with the 32-bit Cinepak Radius codec, with a
    million colors. (I don't know if its 32-bit, as it says it no where
    in the export options).
    3. Encode the AVI with Flash CS3 Video Encoder, using On2 VP6
    codec with Encode Alpha Channel enabled.
    Result, either the clip is completely black or the video
    doesn't have an alpha channel when imported into Flash. I am
    thinking the clips that are completely black are the AVIs that had
    an alpha channel.
    Below is the AVI clip, if anyone can tell me if it has an
    alpha channel by encoding it to a FLV video OR can offer any help,
    thank you.
    Animation
    Clip
    Paul B.
    PS. I have searched the internet for hours for related info
    or similar problems, but have not encountered a solution. I have
    even downloaded Sorenson Squeeze and have tried multiple
    codecs.

    You set your texture environment mode to GL_REPLACE. The implementation of this feature is to replace the primary color (set via ColorPointer or Color3f) with the sampled texture value, so your color will have no effect.
    Replace the texture env mode with GL_MODULATE, which will multiply the Texture Unit Input Color (==PrimaryColor for Texture Unit 1) with the sampled texture value.

  • Brand new 15" MacBook Pro Retina - unplugged from Thunderbolt Display and Keyboards today find keyboard alpha-numerics not working; except the function keys, delete key, tab key, command/ctrl/shift/alt/fn and arrow keys; and 7/8/9/u/o/j/l nudge cursor

    Brand new 15" MacBook Pro Retina - unplugged from Thunderbolt Display and Keyboards today find keyboard alpha-numerics not working; except the function keys, delete key, tab key, command/ctrl/shift/alt/fn and arrow keys; and 7/8/9/u/o/j/l produce cursor nudges.

    It's a new machine - and the Thunderbolt Display is meant to work with it. You need to just make an appointment at your local Apple Store and have them fix whatever is wrong.
    If you like, you could always try a SMC reset and a PRAM/NVRAM reset to see if either of those will get your keyboard back in working order...
    Clinton

  • Export for DVD with Animation codec without alphas channels not working?

    I'm using FCP 5 with DVDSP. My FCP projects consist of quicktime movies that are using the Animation compressor (for lossless quality), and the movies contain alpha channels (thus they were rendered at Millions + colors to preserve the alphas).
    This is my problem. I want to now export a quicktime movie to use in DVDSP with animation compression, so it is again lossless quality (obviously to presever the quality through these steps). But I do NOT want to preserve the alpha channels, because what I've learned is that when made into a DVD, the alphas are not preserved and the image looks wrong (as if without the alphas).
    So I basically want to "flatten" the video, if there was some way.
    I would assume the solution would be to, in FCP, export a quicktime at animation compression, but set to Millions for colors, and not Millions + (I was taught that the Millions + will preserve the alpha info).
    Well, what's happening is when I set it to that, it renders, but then I get info on the movie in Quicktime and it says it has Millions + still. And thus, it looks wrong in DVDSP.
    What is going on? Is this a bug in FCP?
    Does anyone have an idea as to how to get around this. The only thing that has worked for me is to export the Quicktime movie with "none" for compression, but that's making the movie SO large that I can't work with it and it doesn't play right when I make the DVD.
    I really appreciate anyones help on the matter. Thanks!
    Brian,.
    Quad-core 2.5 G5   Mac OS X (10.4.6)   30" Apple Cinema Display
    Quad-core 2.5 G5   Mac OS X (10.4.3)   30" Apple Cinema Display

    Thanks for the suggestions. I have not yet tried laying a solid black video track underneath to see what it does, but it seems like a good idea and I'll try it out to see what happens when I get back home.
    I'll try to explain what I mean by the image looking wrong.
    I'm picking up where another left off, so I'm not sure of how he cut the quicktime movie together; all I know is that they used alpha channels in Photoshop and After Effects to make the image looks the way they want it. This is a drawn character laid on a white background with a black frame around the entire image. It looks the way he wants it to in the quicktime movie, and this quicktime movie is 720x480, animation millions colors +, 24fps.
    This movie, along with others of the like, need to be cut together in FCP and then put on a DVD with DVDSP. When I export it and it looks "wrong", what's happening is there is a black block behind the drawn character. The guy that made the movies in AE says that, that is what it looks like when the alpha channel is not working correctly.
    To test things, I've changed the quicktime compression settings in the sequence settings. If I set it to anything that is not animation, I get that black block in the viewer. (Note though, that if I set it to animation, millions + or not +, it shows the alpha correctly both ways).
    In FCP's user manual it says that if you're passing your movie on to a DVD, to use a high or lossless compression to keep the quality up, like animation or PhotoJPEG. For this reason, I haven't wanted to go to DV - especially with this type of image (graphic drawn shapes), it's easy to see a quality difference.
    It really seems like there is a lot of voodoo involved with compression settings. As for now the best "fool-proof" solution I've found is to re-render the movie in After Effects at millions (not+) so that it won't contain the alpha channel info, and FCP seems to like that a lot more.
    I just wish I could get FCP to work with the movies as they were because I'm having to re-edit everything to work with these new movies now.
    Thanks again for the tips and insight.
    Quad-core 2.5 G5 Mac OS X (10.4.3) 30" Apple Cinema Display
    Quad-core 2.5 G5   Mac OS X (10.4.3)   30" Apple Cinema Display

  • Move tool issue : Command key + mouse dragging for moving any layer not working in PS CC

    I'm trying to move a layer within the document by holding command key and mouse dragging (mouse cursor not above the layer) is not working at all while using move tool. Suddenly this functionality stopped working. Now I have to place my cursor on layer to be move and drag with mouse. Also pressing command key changing auto select option from layer to group.
    Please help.

    Usually when a tool is not working as expected, a Reset of that tool might be the answer.
    Select the move tool in the toolbox,
    Go to the move tool icon on the top left of the screen (just above the toolbox in its' Option bar) and Ctrl-click on it to get the Reset menu.
    Click on Reset Tool.

  • Mask Layer not working in cropping to stage Flash

    I've read through umpteen Flash threads of frustrated users who export SWF and anything visible outside the stage appears in the SWF when opened in a browser.  None of the solutions have worked for me.  My file is called statement_onlineheader.fla.  It can be seen here http://www.mediafire.com/?yrmgnoynihw.  Anyone know why this does not work for me?
    I have my mask layer above a folder containing all other layers.  I have also tried moving the mask layer above individual layers.  Same result.  Stuff outside the stage appears in the exported SWF.

    Very true.  So what do you think is wrong with my file?  The top layer is marked "Mask" when I control-click it, and it doesn't matter if I put it over an individual layer or not.  The top layer is a rectangle the size of the stage, yet this layer (which is checked as a mask) does not mask what is below it.

  • New Grading Layer not working

    When I make looks on my orginal footage layer everything works fine. When I make a new grading layer to add a look to the whole video (like legalize NTSC) nothing happens when I add the look. I try different looks on the new grading layer just to try to see a change but nothing happens.

  • Secondary Color Correction layer not working in .look file

    I needed to edit an image for continuity reasons so I exported a .dpx frame from that section of my premiere pro project and worked on it in speedgrade.  In the workflow I have set for myself, it is best to apply the look in after effects using the "apply color lut" function.  Unfortunately, the secondary color correction layer does not apply, but other layers such as primary will. 

    Hi ACD,
    After Effects and Photoshop CS6 take .Looks via the LUT engine. That indeed allows for using primaries with low mid high differentiation and should yield really good results.
    Secondaries can be expressed in a LUT as well, but I would typically not recommend using them when you want to integrate .Looks with your After Effects workflow. Here's why:
    - a LUT is never as precise as you'd want it to be for something as complex as secondary color grading - a LUT is always based on interpolation (as opposed to applying the effect in SpeedGrade - there it's all native, no interpolation at all)
    - For a good key you would typically use the denoise and the blur function in the secondaries. Both (by nature) don't translate at all into a LUT, so you'd have to give up using these 2 important tools
    - For a lot of work you'd want the LUT to be accompanied by a mask. That's something that also can't be described in a LUT.
    Think of the LUT support for .Looks you created in SpeedGrade more as a really helpful tool for matching your comps to an overall look you design, not necessarily as the tool to apply a final grade.
    Hope this is helpful.
    Pat

  • DVD Dual Layer Not Working?

    Hi all!
    This is my first time to these forums and I have some trouble with a used Toshiba x205-SLI1 I just bought. the HD Dual Layer burning does not function and the driver appears to be updated properly. It is a TS L802a model, with drivers dated as of 6/21/2006 version # 6.0.6002.18005.
    When I insert the Memorex HD +R Media Nero 9 runs up and begins the process but only goes to about 1% then stops. It ejects the DVD which apears to have nothing written to it by looks since I can put the DVD back in and there are no written areas all i can see with data.
    Plus the speed of the drive only reaches 2.4 when the max is 8X.
    Is there a newer driver somewhere? I need to get this working if possible and without spending tons of money on different media types to "test" the Burner.
    Does this burner have some inate problems as i have read on other forums in burning dual layer dvd's?
    oh, and it does work with the normal 4.7GB DVD's just fine i have done several of these to back up data on the system.
    The system is running as the following drive configuration:
    2 @ 200GB Raid 0. Vista ultimate 64 upgraded from Home Premium by the original owner.
    The Laptop works in everything else and is in pristine condition all over.
    Let me know if more info is needed to make a determination for help please.
    Thanks in advance!
    Robert
    Attachments:
    x205-SLI1.txt ‏442 KB

    It sounds like a hardware problem to me.  Your best bet considering it is new is to take it back to the place of purchase and exchange it for a working model (if it's within the exchange period) or contact Toshiba Support and have it repaired under warranty.  Se the Warranty Link at the top of this page for details.
    If you don't post your COMPLETE model number it's very difficult to assist you. Please try to post in complete sentences with punctuation, capitals, and correct spelling. Toshiba does NOT provide any direct support in these forums. All support is User to User in their spare time.

  • Alpha Tween not working on ScrollPane gallery?

    Hello i have a problem with my as3 working on normal movieclips, but not on the gallery, the site  works by loading an external swf file with the UILoader, the swf that is  loaded is a ScrollPane that loads a Movieclip.
    The script i use:
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var myTweenAlphaRoskilde:Tween = new Tween(roskildemc, "alpha", None.easeNone, 0, 1, 40, false);
    1. frame is the preloader
    2. frame is the Scrollpane and Movieclip that loads, the action is added here.
    The file if it makes it easier:
    [Link removed by moderator at OP's request]
    Thank you very much! =)

    As i wrote, the timeout stuff was added because the preloader wasnt loading the scrollpane the second time one visited the gallery, it just stuck because it was already loaded, see the other forum questioin i posted a link to. If you think it should be removed, exactly what parts should be removed? Could you post the script without the lines that are not needed, im not really a as3 pro.
    There is a main index file with different uiloaders on various keyframes which loads the external swf files
    [link removed at poster's request]
    The external swf's have a preloader in frame 1 and in frame 2 it has the ScrollPane component that loads a movieclip.
    [link removed at poster's request]
    There is no uiloader code, im using the built in one, it loads the externals fine but i cant add the alpha tweening so they fade in.
    There are 3 external swf's with the preload script i posted, the main index file has the folowing preload script:
    stop();
    var loadCompleteBool:Boolean;
    trace("preloader frame");
    if(loadCompleteBool){
    trace("loadcomplete")
    loaderInfo.removeEventListener(ProgressEvent.PROGRESS,  updatePreloader);
    nextFrame();
    //Preloader
    loaderInfo.addEventListener(ProgressEvent.PROGRESS,  updatePreloader);
    function  updatePreloader(evtObj:ProgressEvent):void
        //container for  the progress of the site (download)
        var percent:Number =  Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
         preloader_txt.text = percent+"%";
        if (percent==100){
    trace("preloader")
    loadCompleteBool=true;
             nextFrame();

  • Splashy - alpha channel not working

    Hi,
    The alpha channel of the progress bar colours doesn't seem to work with Splashy on my system. I have set transparency in the theme XML but it's ingnored.  The transparency does work for the text area, but not for the progress bar or its background.
    Has anyone else experienced this issue?  If anyone can help me identify if this is a problem with my set up or with Splashy itself I'd appreciate it.
    Thanks.
    Fishonadish

    When you don't get a response here it usually means one of several things:
    · No one understood your post (not the case this time though - you articulated the problem very well)
    · No one else has encountered the same problem
    · No one was able to duplicate the problem on their system
    · No one likes you (just kidding!)
    I'm glad to hear you got it working ... and very good that you posted what fixed it so that others facing the same problem might benefit. Thanks for that!.
    -DH

  • Adjustment layer not working (has no effect)

    I'm having a problem with adjustment layers... Here's what works :
    - I can add an effect (Blur) to a normal layer, and I see what it does in the Comp preview window and when I render the movie.
    What doesn't work :
    - I add an adjustment layer above everything in the timeline, add an effect (Blur) to this layer, but then nothing happens neither in the Comp preview window or the final render !!
    I've tried moving layers around, enabling anything related to effects, and still haven't managed to get this to work.
    After effects 6.5 (old I know... but it works just like CS3 & others, and just takes 150MB of disk space !!)
    Win XP
    Any ideas ?
    Thanks !!

    Of course! how silly,
    http://imgur.com/RfyegUk
    In all the video tutorials I've seen, I've done almost the exact same manipulations and they always have the effect visible in the "XYZ Comp" window. Not on my machine, and not even when I render the final movie. Very frustrating.
    Thanks

  • Layer not working properly

    Hi guys,
    I created an eliptical rectangle button layer. The problem is when I click on a different layer the eliptical rectangle disppaears. I can't add any colour to it either. When I go to "Edit", when clicked on that relevant layer, there is no "fill" option for colours (i.e it is faded out)
    How do I resolve this problem so that I can edit the layer and add colours and text to it?
    Thanks.
    Sunil.

    You did not actually describe how you created the layer.  "I created an eliptical rectangle button layer" is not enough.
    Rather than guess at what you did, and what you ended up with, could you be more specific?  There are literally 1000 ways someone could create a layer they might call "an elliptical rectangle button layer" in Photoshop, while in fact there is no such animal as a "button layer" specifically.
    I suspect rasterizing the layer (Layer - Rasterize menu) might get you started in the direction you want to go, but it's impossible to say unless you give a little more info about how you got here.
    -Noel

  • Why does alpha conversion not work?

    Hi guys,
    I have an alpha conversion in  an infoObjekt, and this infoObjekt is used in one inforsource, and I have set the check box "conversion" in the transfer rule, but the alpha conversion didn't work.
    But when I call 'CONVERSION_EXIT_ALPHA_INPUT' in this field routine, it works...
    I can not figur out the reason, please help me.
    Any hint is apprreciated.
    Regards

    hi,
    Did you mention conversion Rout as Alpha in the INfoobject.
    RSD1 - General - Conversion Rout as Alpha
    or you Use the following code at transfer routine to convert using ALPHA.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    INPUT = trans_structure-<Source field>
    IMPORTING
    OUTPUT = RESULT.

  • Flash FLV in iFrame   Alpha Channel Not Working

    Hi
    I was trying to make one of those overlay videos where you see the webpage behind the video thats playing, there's a person talking to you in the foreground, usually shot on green screen
    I processed the footage with alpha channel intact, (checked with Sorenson flv player), all the way to placing it in an iframe on a iWeb page and I think that is where the problem occurs, the transparency goes to a black background. I must be missing a piece of code somewhere. Any ideas as to fix will be appreciated. thnx

    Hi
    Thanks for info above...
    I discovered that iframe is writing a line of html code that I had to change by hand, it was a background color call and the value was #010101 something like that, so I erased that entry and left it blank, save the html file, uploaded it, and BOOM the black background just disappeared... NOW I need to get it working in Internet Explorer, IE is adding a White background to the video. Any info appreciated

Maybe you are looking for

  • Regarding index and anla table

    Hi i have code as below and i have Select option input for fields bukrs, anln1 and anln2. SELECT bukrs      anln1     anln2     anlkl txt50 ktogr invnrz sernr deakt                    FROM anla                         INTO TABLE o_anla               

  • X-fi xtrememusic showing up as emulated (plus annoying hissing with music and gam

    My x-fi has recently started to exhibit an annoying hissing while playing music (though strangely not with WMP) and in games. I usually use foobar 2000 for music, and I can escape the hissing with the kernel streaming plugin. As kernel streaming work

  • I have no idea what my security question answers are. I just got a new ipas but it won

    I have no idea what my security question answers are. I just got a new ipas but it won't let me buy apps. How do I find my answers

  • Firefox does not start (not even safemode) but uses CPU

    I have the latest Firefox 25.0 (and latest Flash 11.9.900.117) on Windows 7 and the following behavior is reproducible. This started not too long ago. At first when I start Firefox nothing appears no matter how often I restart. However, in the proces

  • DRM flash player 11.8.800.168

    Hello, i have a problem with this version of flash. I use Adobe Access for protect content. And work in flash player 11.7 but with flash player 11.8.800.168 other version in IE i have only sound but black video screen..... I dont understand why... i