SetVector and GPU render mode

Hello,
If i use the setVector method on a BitmapData in GPU render mode on a mobile device, it works very slow.
This changes if the render mode is CPU. The method is fast enough.
The problem lies in the fact that if I use CPU render mode the app i;m developing is getting very slow, while on GPU it works great.
setPixel32 is even slower,it even won't work with lock/unlock.
Where the problem lies? How can I bipass this since setPixel32 or setVector is a must have when working with bitmaps.
UPDATE:
I've tested alot, and it seems the problem lies not with setVector method but with copying transparent pixels
You can find the code here since i've asked the question o stackexchange too:  http://stackoverflow.com/questions/21827049/gpu-vs-cpu-render-mode-adobe-air

Hi Lucian,
Unfortunately, I am unaware of any tutorials on the net I could recommend, though I am sure there are a few -- not on the subject of setting up render targets, specifically -- most likely-- but on setting up Stage3D + shaders.
One source I would recommend, though, if this is your first time setting up a Stage3D render pipeline, besides the code examples in the Stage3D Adobe reference, is this great book:
http://www.amazon.com/Adobe-Stage3D-Molehill-Programming-Beginners/dp/1849691681/ref=sr_1_ sc_1?ie=UTF8&qid=1392715725
It's a quick read.  Nicely presented and explained.  I think in 3-5 days you could be up and running.
I would also browse this site.  You might get some ideas:
http://www.flashandmath.com
Regarding using render targets to identify areas that have changed and need further processing:
This is a fairly common practice when interactivity is key, and works well in some use-cases.
For example, in Photoshop, there is a filter called "Liquify", with which you can stretch and compress an image in real-time.  There are 2 ways to do this effect, live: one is to map the source -- undistorted-- image onto a grid of polygons, and start pushing and pulling the vertices.  The other method -- same principle, but finer -- is to paint the compression field into a render target ( a texture ), temporarily, while you work in real time by 'painting' the effect ( note: the displacement vectors are based off of the gradient of the compression field ).  Conceivably, you could also paint the vectors directly, as if painting a normal map.  Once the user is happy with the look, then the user clicks 'apply', and the render target is used one last time to bake the displacements into the source image.
Other example:  I once worked on a game where the player could use a laser beam to scar all the buildings of a 3D city.  The way this was done was that each building had its own render target ( usually a 256x256 ), into which the user could 'draw' ( even though the player never saw this render target, which was just a grayscale mask ).  The render target was then fed into the building's exterior shader, which would use it to identify which areas to show the destruction effect into.
Overall, the idea is to use a render target ( usually smaller that the source texture it will end up modifying ) to paint either a mask, or vectors ( like a normal map ), which is then used along with the source texture in the final shader to create the look you want.
Although I haven't had to use render targets for this particular situation, lately, I use render targets frequently, otherwise, to draw my assets into and apply shaders, and then draw the render target into the backbuffer, at the very end. 
The reasons for this is explained here ( along with other tips ):
http://forums.adobe.com/thread/1399727?tstart=30

Similar Messages

  • What's the status of GPU render mode on mobile targets?

    Hi,
    I've developed a few applications for Android and IOS using AIR. Specifically using the GPU render mode alongside StageQuality.LOW for better performance.
    I was hoping for information on whether this is still a usable method as last year there was a period where it appeared depreciated or at least not supported on high res Android:
    Lorenzon Nuvoletta's google plus thread:
    https://plus.google.com/+LorenzoNuvoletta/posts/AhjX4XnrAzL
    The 'fixed' bug:
    https://bugbase.adobe.com/index.cfm?event=bug&id=3370376
    The 'issue' is now marked as fixed, but I am still a little concerned about it's use in future. Are Adobe still supporting this render mode?
    Thanks,
    Nick H

    Hi Nick,
    We don't plan any further enhancements for GPU mode.  Our recommendation is to use stage3D (or use frameworks like Starling) with direct mode, rather than using GPU mode if at all possible.
    Thanks,
    Chris

  • Flash and AIR iOS Render Mode

    Discovered when I add video to my project I have to use GPU Render Mode to play the video smoothly. But this causes any Filters I've applied to text objects to disappear. Tried numerous ways of correcting including cacheAsBitmap... doesn't work. On some of my MovieClips I've checked ExportAsBitmap and that does work.
    Any suggestions to find a medium in both worlds?
    Video to play correctly and text objects with Filters applied to them.
    Testing on my iPad.

    I've heard and its been my experience that GPU shouldn't be used when dealing with video.
    @see http://forums.adobe.com/message/4310153
    http://help.adobe.com/en_US/as3/mobile/WS901d38e593cd1bac-3d719af412b2b394529-8000.html

  • Render mode gpu and softkeyboard issues

    IHi,
    If I'm using the render mode "gpu" or "direct" for my Air Android project, the stage is not resizing correctly if the soft keyboard comes up. (there  are 150 px of blank free space over the soft keyboard)
    Everything works correctly if I'm using the render mode "cpu".
    s this a known issue?
    How to fix it?
    I'm using Flash CS6 and Air 3.8
    Thanks

    There are definitely some bugs going on with the softkeyboard on Android. Check out my releated issue: http://forums.adobe.com/thread/1281872?tstart=0
    I knew eventually some other people would start running into this problem: Please vote for adobe to take a look into the softkeyboard bugs on Android: https://bugbase.adobe.com/index.cfm?event=bug&id=3627285 ... bugs that don't get enough votes don't get worked on

  • What is the best AIR render mode?

    In Flash Professional Help / Publishing AIR for Android applications (http://helpx.adobe.com/flash/using/publishing-air-android-applications.html) I found the following:
    ===========
    Render mode
    Allows you to specify which method the AIR runtime uses to render graphic content. The options include:
        Auto - automatically detect and use the fastest rendering method available on the host device.
        CPU - Use the CPU.
        GPU - Use the GPU. If no GPU is available, the CPU is used.
        Direct - Render using Stage3D. This is the fastest available rendering method.
    ==========
    If the Auto mode automatically selects the fastest rendering method, what is the point of the 3 other options?
    My application has some minor 2D animations, but very smooth drag-and-drop performance is important. What rendering mode would you recommend?
    Thank you.

    Last I heard, "auto" was never implemented. Auto=CPU mode.

  • PPBM5 Questions and GPU Rendering Concerns

    Bill and Harm, i figured i woud post this here instead of a private email so as to get some opinions and input from others.
    I am a bit confused with the logic behind the gpu testing and want to make sure i understand how this is working and make sure i dont have any problems with my machine.
    I just wiped out my 8 core, 20GB ram, SSD, gtx 460/2GB, machine and put a fresh win7/64 on it with cs5 and nothing else.
    i am planning on doing various tests with the SSD, then SATA Raid, then my 4gbit fibrechannel in combinations.
    My concern is over the gpu acceleration and timeline rendering. My basis for wanting these gfx cards with cs5 is on the PPBM results showing all kinds of double digit speed gains with MPE enabled.
    I have 8 of these machines and need to upgrade them all so i am concerned to make sure what i am doing and what i am getting for it.
    my first obvious question for everyone else is when you load the benchmark in what do you see on the timeline? i have all yellow except for two small red lines near the end of each section where the curtain and cube effects are at.
    Now when i hit the spacebar to play the timeline at starts out ok but then hits the 8 second mark into it and chokes out the rest of the way skipping frames and drawing maybe 3-5 frames per second until it gets through the rest.  Is this what happens for everyone else or does your system play the yellow area smoothly?
    Is this a by-product of my manually putting the 460 into my supported cards file and premiere not properly calculating what the gpu can and cannot accelerate?
    Now as for the benchmark testing itself when i hit enter it simply renders out those 2 effects that have the red line then starts playing the same choked out skippy video as before.
    So if this speed is calculated and then the speed of my cpu rendering the entire timeline then how is this an effective comparison? if i simply remove those two effects at the end then i still have that big complicated timeline and yet if i hit enter it just plays choppy video instantly and nothing is rendered, so compared to my cpu thats a bazillion times faster but i dont get anything out of it as the video doesnt actually play with the gpu.
    My real concern and need is flat out rendering speed for encoding. i had high hopes that getting a video card with hundreds of cores on it would magically render out mpeg 2 files 10-20x faster then my cpus can.
    i saved out a pic of my cores when i am playing the timeline, you can see they are not being maxxed out.
    Before i wiped my system out i tried the trial version of the mainconcept gpu encoder and it went slower with the gpu than it did with my cpus. Their email response to me was that gpu rendering is more of an advantage against slow cpu systems. and my cpu's were too fast in comparison. I find this hard to believe in that my system is several years old now. thier own performance comparison charts show a tremendous speed increase over modern I7 processors.
    On a side note - DONT INSTALL MAINCONCEPT TRIAL ENCODER!- it hijaacked my mpeg encoding/decoding even when i wasnt using it and it was watermarking all my stuff in premiere with its logo!
    I also have been using a program called canopus procoder which does great encoding with multi cores, a standard dv to mpeg2 encode on my system maxxes all 8 cores and renders about 14x faster than realtime.
    I hoped a cuda card could increase this speed for me and render faster then that directly out of premiere. I would think during rendering your cpu's and gpu's would work together at 100% usage to go as fast as possible. i would like to see 20-30x realtime speed for mpeg2 encoding in my situation.
    Thanks and i look forward to any input or help or even a simple "click on this and yoru problem is solved" 

    harm, thats kind of funny actually, you show us a report of your dropped frames on playback then say you cant tell us how because of NDA, yet we obviously know you have an app that reports the dropped frames during playback
    But thats ok, anyways as far as your ppbm goes i love it and dont mean to desparage it in any way, i have been a big supporter and love the work you and bill have put into it. I am really just trying to have a better understanding of how it works.
    My concern is more about premiere as opposed to ppbm.  I want to know if my system matches what everyone else sees, when i load the project is get this:
    i just want to make sure everyone else has the same tiny red sections that premiere feels it can't play.
    previously premiere has always either played in realtime at 30fps or shown a red line which needs to be rendered. then if you render it you get full 30fps playback on the entire timeline.
    now with this new gpu workflow i can only render those two tiny little red sections and the rest of my timeline plays at about 2 or 3 fps from 8 seconds into the timeline until the end.
    So I actually have no physical way to see my video at full 30fps without changing to software mode and rendering the entire timeline?  or am i missing something here?
    Isn't premiere supposed to recognize when it cant keep up with 30fps playback and change that section of the timeline to red?
    And on a side note i still have to say i am fairly annoyed that an adobe employee took it upon themselves to move my thread into the unpopular generic premiere hardware forum, when this is a very specific premiere cs5 question thread. I have never even looked in this forum for any cs5 posts before now and had hoped to get more feedback from users in the main premiere cs5 forum.  A lot of companies like to treat their customers well and the old addage "the customer is always right" doesn't seem to apply anymore. My company probably has purchased over $1,000,000 in adobe software licenses over the years which i feel would make me a valuable customer, and i have some important questions i need to ask about the new version of your software and how it is supposed to work.
    thanks

  • IMAC Premiere CS6 and GPU's question. (Updated)

    The only new iMac's which might support GPU CUDA operation in Premiere CS6, are the 27 inch ones using the GTX 675MX or the GTX 680MX video chipset. Neither of these are on the cuda supported list but of course they could be added to the appropriate file to enable them to work. Is there anyone out there successfully using them in GPU acceleration mode? If so please let me know if they do work and which of the two you have. I can then argue my case with the boss.
    Also, is anyone using them with Windows 7? Our Mac's are dual boot.
    Bye Andrew

    Ok, I've upgraded to Mountain Lion now and that hasn't made Premiere any faster. However I've just been looking at the Scratch Disk configuration and they are all set to 'Same as Project'.
    So here's my new question. I have 4 internal HDD's. At the moment the OS and Premiere Pro is on disk 1. Disk 2 is currently recieving my Premiere Pro project files and disk 3 and 4 are completely empty ready for footage or anything else. What is the best way to set up the Scratch Disks and Premiere Pro's Media cache(s)?
    For reference the scratch disk options are currently:
    1) Captured Video - Same as Project
    2) Captured Audio - Same as Project
    3) Video Previews - Same as Project
    4) Audio Previews - Same as Project
    Currently my 'Media Cache Files' are being sent to disk 1 and this is also where my 'Media Cache Database' is located.
    So what should I change?

  • Problem render mode "direct" Android

    I'm developing an app with Adobe Air 14.0.0.137, Flash CC and Starling.
    I detected an strange issue. If a set Render Mode as "Direct" the stage3D starts but no display list objects appear on the screen. I can see a white screen and only then my Starling app starts up.
    If I set Render mode "Auto" the display list objects appear on the screen, but starling can't startup.
    This is making my "splash-screen" fail, showing a white screen instead an flat image.
    As I remember, in direct mode is still possible to see the tradicional display list objects. This is only happening on Android.
    Everything works as expected on PC and iOS (ipad), but not in Android.
    Any thoughts?

    I'm experiencing it as well, on some android devices only. I can't reproduce it as it works well on my device. But some testers have that exact same problem.

  • Glow effect with GPU render

    Hi everyone,
    I know that the glow effect can't be visible with GPU render on IOS/ANDROID devices.
    But I heard that there was a way to appply a glow effect anyway. (I need the GPU render as my animations are smoother with it)
    My code was :
    private function itemGlow(isGlowing:Boolean):void{
                                  if (isGlowing){
                                            var glow:GlowFilter = new GlowFilter();
                                            glow.color = 0xFFFF00;
                                            glow.alpha = .75;
                                            glow.blurX = 10;
                                            glow.blurY = 10;
                                            glow.quality = BitmapFilterQuality.MEDIUM;
                                            draggedItem.filters = [glow];
                                  } else {
                                            draggedItem.filters = null;
    And I decided to replace it, in order to make it work with GPU render, with this code :
    public function itemGlow(isGlowing:Boolean):void{
                                  if (isGlowing){
                                            var glow:Sprite = new Sprite();
    glow.graphics.beginFill(0); // black color
    glow.graphics.drawCircle(20, 20, 20);
    glow.graphics.endFill();
    draggedItem.filters = [new GlowFilter(0xFFFF00, 1)];
    var bd:BitmapData = new BitmapData(50, 50, true, 0x00000000);
    bd.draw(glow);
    var glowbit:Bitmap = new Bitmap(bd);
    addChild(glowbit);
                                  } else {
                                            draggedItem.filters = null;
    No errors, glow visible on the simulation device. But when it's not working on real Android device....
    Any idea why ?
    Thank you very much,
    Stephan

    From what I see it's for the same reason the original code wouldn't work. You're applying a glow filter the same way. The only different thing you're doing is drawing a black 40x40 black circle, drawing it into a transparent BitmapData (which isn't big enough) while adding that circle as a Bitmap to the display list.
    Are you working in 3D? Either way in general the way you can utilize the graphics class is to draw the object using built in Flash classes, then draw that object into a BitmapData (so draw "draggedItem" into a BitmapData with the glow applied) and then use the BitmapData (in a Bitmap like you did for example).

  • In my macbook pro 15 inch mid 2012 model, my cpu and gpu will get very hot, when gaming or rendering sometimes over 200F. The fans only spin at max about 2900 rpm, when their max is 6400. I downloaded a fan control app, but how can i fix it?

    In my macbook pro 15 inch mid 2012 model, my cpu and gpu will get very hot, when gaming or rendering sometimes over 200F. The fans only spin at max about 2900 rpm, when their max is 6400. I downloaded a fan control app, but how can i fix it?

    Hi rhaughan,
    I see that you have concerns about your operating temperature of your computer while using resource-heavy applications such as gaming applications. I have an article that will address some of the concerns you have mentioned:
    Mac notebooks: Operating temperature - Apple Support
    http://support.apple.com/en-is/HT201640
    While there are third-party utilities that measure the temperature of a notebook computer, it is important to understand that these utilities are not measuring the external case temperature. The actual case temperature is much lower. Never use third-party applications to diagnose possible hardware issues—instead, contact Apple or go to an Apple Retail Store or Apple Authorized Service Provider.
    You should also see this article for even further information about your fans:
    Learn about the fans in your Mac - Apple Support
    http://support.apple.com/en-is/HT202179
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • CPU and GPU slow down after system upgrade

    Ok, I can't find anything similar to the question I have...but this forum goes on forever  
    As my system specs appear below, my machine was running quite comfortably a week ago, with same setup...minus the acrylic case and second 120GB hard drive.
    At that stage I had "nomal" benchmarking scores 3dmark03 - 5850, Aquamark3 41.000, PC mark 2002 - cpu7020 mem8438 hdd1050.
    Life was good and I loved my system
    Then I decided it would be cool to upgrade to an acrylic case (which has better cooling with 3 fans) and a second 120 GB HDD to make a striped raid array.
    My first concern was the raid Array. I was carefull to buy the exact same seagate hard drive, size etc. the original was only a month old anyway. The second was to use the intel southbridge chip for SATA RAID or the Promise controller? After researching these forums I decided to go with the Intel as it has more possible bandwidth and doesn't sit on the PCI bus.
    I got the new case and wearing those stupid white gloves, proceeded to move the components over and trash my "old" metal case.
    The windows NTFS format (full) flew by in 30 seconds and I was really impressed.
    Once windows xp and all it's drivers and updates were installed, incl sound and graphics etc. I did a 3Dmark 2001 test before upgrading to Dx9...what a bad mark! 3Dmark2001SE - 9950 (terrible for this system).
    I thought it was a DX problem...so I installed Dx9
    Then opened that corecenter program (the old one, the one that doesn't crash...)
    and my CPU was about 5c hotter than usual, it was running at 40-42c (I have standard intel cooling fan). It went up to 55 at times when running PC mark 2002.
    This didn't concern me too much a the system was stable at 32-34c and the northbridge read 60c (but we all know that's not true , more like 35ish.
    My PC mark 2002 is now cpu4200 - mem4800 - hdd1800
    (at least the HDD improved!) LOL
    I ran Aquamark3 next...29,900 (ouch!)
    Previously my CPU was 8,700 and GPU was 5300
    now the CPU read 4400 and the GPU 4600
    I don't really notice the speed loss when working, but games and benchmarks tell a different story.
    So, My question: What has happened? Why is my CPU power cut in half? and the graphics card slightly slower? The memory speed stayed the same and the HDD speed improved....not a worthwhile upgrade IMO
    What went wrong?
    Here are my theories.
    1) The CPU and system case is getting too hot
     Does the CPU "throttle" when it overheats? this could be the reason.
    Also both HDD get really hot and the fan in front blows air over them, this hot air could be going over the CPU or GPU. Maybe get 2 HDD coolers?
    should I buy a better CPU cooler like the Thermaltake spark7+ ?
    2) The PSU does not have enough watts
    I couldn't find traces of voltage lack or spikes...but it could still be a problem
    3) The RAID0 array is a strain on the CPU and chipset
      I'm not sure about this.
    My appologies for the lengthy thread, but I wanted to be sure that anyone trying to figure this out had as much info as possible  
    Thanks if u can help me figure this out.

    Quote
    Originally posted by Reaver
    When I originally installed the intel p4 cooler, I used artic silver ceramique paste...and the CPU temp operates at 36-38c with no load.
    Perhaps I should upgrade the overall cooling. Get a Thermaltake copper fan and two HDD coolers.
    Well, your temps sound allright, no need to worry them, if they really operate at that level.
    Quote
    The solution to set the FSB to 201Mhz sounds good. But do I set this in the BIOS or with Corecenter in windoze?
    Propably meant to adust your FSB at BIOS, at least that is what I would suggest.
    Quote
    I will try to re-install the VGA drivers because something strange DID happen when I first installed them. I started with the hercules driver CD, this installed CAT 3.2 drivers. I then upgraded to CAT 3.7 and before it completed I got an error window (send, dont send).
    Remove drivers AND ATI control panel first, and then re-install. Use drivers from ATI site, and rather Catalyst 3.7. I Have had problems with 3.8 Catalysts.
    Quote
    Still wouldn't explain why the CPU seems so crippled. I have managed to get a "normal cpu score of 7000+ in PCmark2002 by shutting down, restarting later and killing every process except explorer.
    Do you have any processes that seem to eat more juice thant hey should?  Arrange your processes by CPU usage and see if there is something strange.
    Quote
    If this cant be fixed I will reinstall over the weekend. Does anyone know of the RAID0 array on the southbridge causing a system slowdown?
    I'm using Intel RAID and it works perfectly, no extra CPU usage is shown and it's pleasantly fast!
    And Install latest Intel INF updates and Application Accelerator from Intel site. That's what I'm using, and works fine.

  • Macbook spontaneously goes into sleep mode and screen off mode

    Hi. My Macbook spontaneously goes into sleep mode and screen off mode with varying time between each instance. It usually goes for a few minutes or even hours without doing it and then will go through periods of fluctuation between the modes. I believe this to have started with a minor orange juice accident rather than it being anything software related.
    Any ideas as to how I might rectify the problem? Thanks very much in advance,
    Danny

    When you say it goes into sleep mode ...do you mean you actually see the white pulsing light?
    It may be that there is an application running (perhaps in the background) that is keeping your book awake. Printer software sometimes does this for example ...try logging out and seeing if it sleeps like that. If it does, then it very well may be a background process running.
    You may find some items in System Preferences/Accounts/Login Items that may be the culprit.

  • If my ipad was stolen and i havent signed up for find my ipad app will it show the device offline and pending lost mode still?

    wondering if i never signed up for the locate my ipad app if it would show my stolen device as offline and pending lost mode or if that means that i did sign up for it and just dont remember?

    If it is showing up as Offline and also shows Lost Mode as Pending, then you did turn on Find My iPhone. Otherwise, you wouldn't see the device at all when you went to Find My iPhone in iCloud. If someone turns on the device and connects to the internet, then your pending Lost Mode transaction will process, and a lock code will be placed on the device. It will also show up on the map to show you the location.
    However, if it does not come back online, then you won't be able to track it, nor will the lost mode command execute.
    Sorry,
    GB

  • How to connect computer and itunes locked mode is lost at the same time

    when I have enough information and icloud

    Lê Đức Anh wrote:
    how to reboot when locked and in lost mode
    If you put it into lost mode log in to https://icloud.com/find and erase the phone. If someone else put it into lost mode with their Apple ID and you do not know the passcode for their Apple ID account the phone is useless to you.

Maybe you are looking for

  • Iweb website not showing up at all on any search engine

    Hello, I recently switched from Windows to a Mac (and its a big improvement, really pleased with it). As we run 2 tiny businesses, one of my first projects was to make 2 websites in iweb and publish them via ftp to the domains I purchased (both hoste

  • Is it possible to recover a deleted folder and its contents as opposed to an individual file?

    When I turned on my computer today, a folder located on my desktop is no longer there.  Astounded I could have accidentally deleted it, the folder having been trashed is the only illogical logical possibility I can think of - and is a first for me in

  • Using variables in Business Rules

    Hello Experts, Do you know if it's possilble to declare (and use) text variables in Business Rules? I want to do some strings treatment (concatenation, substring) and I need to use variables. Regards, Rodrigo

  • Updater failed to install

    All, I am having a problem with the Adobe Updater. The following banner message is received on my Mac: A new version of the adobe updater is available for installation. Click OK to install it now Note: you may be required to authenticate in order to

  • IPhone: get the GSM signal in numbers WITHOUT jailbreaking? Is it possible?

    Hi guys, I need to measure the signal rate in different parts of a building. I know that it can be done with SBSettings, but I don't want to jailbreak my phone. Can this configuration (getting the signal strength in numbers instead of the lines) be d