How to implement the runtime compression of texture?

I've read the doc here:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d5b.html
Flash Player 11.4 and AIR 3.4 support runtime texture compression, which is useful in certain situations, such as when rendering dynami textures from vector art. To use runtime texture compression, perform the following steps:
Create the texture object by calling the Context3D.createTexture() method, passing either flash.display3D.Context3DTextureFormat.COMPRESSED orflash.display3D.Context3DTextureFormat.COMPRESSED_ALPHA in the third parameter.
Using the flash.display3D.textures.Texture instance returned by createTexture(), call either flash.display3D.textures.Texture.uploadFromBitmapData() orflash.display3D.textures.Texture.uploadFromByteArray(). These methods upload and compress the texture in one step.
I tried to follow the steps but get an error:
Error: Error #3763: Sampler 0 binds a texture that that does not match the read mode specified in AGAL. Reading compressed or single/dual channel textures must be explicitly declared.
          at flash.display3D::Context3D/drawTriangles()
should I put some instruction on agal side also?

thanks for the reply, and sorry for late response. Here's the whole code for the test, and I grabbed the AGALMiniAssembler.as from here :
https://github.com/PrimaryFeather/Starling-Framework/blob/master/starling/src/com/adobe/ut ils/AGALMiniAssembler.as
I don't know where else to find an up to date one, please give me a link, thanks
here's the full code, I embed a png file and try to uploadFromBitmapData, which gives me an error:
Error: Error #3763: Sampler 0 binds a texture that that does not match the read mode specified in AGAL. Reading compressed or single/dual channel textures must be explicitly declared.
          at flash.display3D::Context3D/drawTriangles()
          at sandbox::TestCompressedTexture/enterFrame()[/Volumes/MacintoshHD/Users/dawn/Documents/wor kspace/work/dev/smodel/src/sandbox/TestCompressedTexture.as:150]
package sandbox
          import com.adobe.utils.AGALMiniAssembler;
          import com.adobe.utils.PerspectiveMatrix3D;
          import flash.display.Sprite;
          import flash.display.Stage3D;
          import flash.display.StageAlign;
          import flash.display.StageScaleMode;
          import flash.display3D.Context3D;
          import flash.display3D.Context3DProfile;
          import flash.display3D.Context3DProgramType;
          import flash.display3D.Context3DRenderMode;
          import flash.display3D.Context3DTextureFormat;
          import flash.display3D.Context3DVertexBufferFormat;
          import flash.display3D.IndexBuffer3D;
          import flash.display3D.Program3D;
          import flash.display3D.VertexBuffer3D;
          import flash.display3D.textures.Texture;
          import flash.events.Event;
          import flash.geom.Matrix3D;
          import core.Scene3D;
          [SWF(width="600",height="800",frameRate="60")]
          public class TestCompressedTexture extends Sprite
                    [Embed(source="../../assets/tex_cube.png")]
                    private var TexCube:Class;
                    private var _swfHeight:int;
                    private var _swfWidth:int;
                    public var context3D:Context3D;
                    public var viewMatrix:Matrix3D = new Matrix3D();
                    public var projectionMatrix:PerspectiveMatrix3D = new PerspectiveMatrix3D();
                    public var meshIndexData:Vector.<uint> = Vector.<uint>
                                        0, 1, 2, 0, 2, 3,
                    public var meshVertexData:Vector.<Number> = Vector.<Number>([
  //x,y,z     u,v    nx,ny,nz
                              -1, -1,  1, 0, 0,  0, 0, 1,
                              1, -1,  1, 1, 0,  0, 0, 1,
                              1,  1,  1, 1, 1,  0, 0, 1,
                              -1,  1,  1, 0, 1,  0, 0, 1,
                    private var indexBuffer:IndexBuffer3D;
                    private var vertexBuffer:VertexBuffer3D;
                    private var program:Program3D;
                    private var _modelViewProjection:Matrix3D = new Matrix3D();
                    private var modelMatrix:Matrix3D = new Matrix3D();
                    private var texture:Texture;
                    private var uvBuffer:VertexBuffer3D;
                    public function TestCompressedTexture()
                              _swfHeight = 600;
                              _swfWidth = 800;
                              if (stage!=null){
                                        init();
                              }else{
                                        addEventListener(Event.ADDED_TO_STAGE,init);
                              projectionMatrix.identity();
                              projectionMatrix.perspectiveFieldOfViewRH(45.0,_swfWidth/_swfHeight,0.001,100.0);
                              modelMatrix.identity();
                              viewMatrix.identity();
                              viewMatrix.prependTranslation(0,0,-5);
                              super();
                    private function init(e:Event=null):void{
                              if (hasEventListener(Event.ADDED_TO_STAGE))
                                        removeEventListener(Event.ADDED_TO_STAGE,init);
                              stage.scaleMode = StageScaleMode.NO_SCALE;
                              stage.align = StageAlign.TOP_LEFT;
                              stage.stage3Ds[0].addEventListener(Event.CONTEXT3D_CREATE,onContext3DCreate);
                              stage.stage3Ds[0].requestContext3D(Context3DRenderMode.AUTO,Context3DProfile.BASELIN E);
                    protected function onContext3DCreate(e:Event):void
                              removeEventListener(Event.ENTER_FRAME,enterFrame);
                              var t:Stage3D = e.target as Stage3D;
                              context3D = t.context3D;
                              if (context3D == null){
  return;
                              context3D.enableErrorChecking = true;
                              context3D.configureBackBuffer(_swfWidth,_swfHeight,0,true);
                              dispatchEvent(new Event(Scene3D.SCENE3D_CREATED));
                              createProgram();
                              createTexture();
                              createBuffer();
                              addEventListener(Event.ENTER_FRAME,enterFrame);
                    public function createProgram():void{
                              var vsa:AGALMiniAssembler = new AGALMiniAssembler();
                              var vs:String =
  "m44 op, va0, vc0\n" +
  "mov v0, va1\n" //uv
                              var fs:String =
  "tex ft0, v0, fs0 <2d,repeat,nomip>\n"+
  "mov oc ft0 \n"
                              program = vsa.assemble2(context3D,1,vs,fs);
                              context3D.setProgram(program);
                    public function createBuffer():void{
                              indexBuffer = context3D.createIndexBuffer(meshIndexData.length);
                              indexBuffer.uploadFromVector(meshIndexData,0,meshIndexData.length);
                              vertexBuffer = context3D.createVertexBuffer(meshVertexData.length/8,8);
                              vertexBuffer.uploadFromVector(meshVertexData,0,meshVertexData.length /8);
                    public function createTexture():void{
//                              texture = context3D.createTexture(512, 512, Context3DTextureFormat.BGRA, false);
                              texture = context3D.createTexture(512, 512, Context3DTextureFormat.COMPRESSED, false);
                              texture.uploadFromBitmapData(new TexCube().bitmapData);
                    protected function enterFrame(event:Event):void
                              context3D.clear();
                              _modelViewProjection.identity();
                              _modelViewProjection.append(modelMatrix);
                              _modelViewProjection.append(viewMatrix);
                              _modelViewProjection.append(projectionMatrix);
  // pass our matrix data to the shader program
                              context3D.setProgramConstantsFromMatrix(
                                        Context3DProgramType.VERTEX,
                                        0, _modelViewProjection, true );
                              context3D.setVertexBufferAt(0, vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
                              context3D.setVertexBufferAt(1, vertexBuffer, 3, Context3DVertexBufferFormat.FLOAT_2);
                              context3D.setTextureAt(0,texture);
                              context3D.drawTriangles(indexBuffer);
                              context3D.present();

Similar Messages

  • How to delete the runtime error in st22

    Hi all,
            How to delete the runtime error in ST22. I want to clear
    the list of short dump in st22
    is there any T.code or any table to clear?
    thanks in advance
    sundar.c

    Hi
    you cannot delete the dumps through any tcode.
    All the dumps are stored in table called SNAP, If there are more dumps the table gets filled therefore u have to reorganize the table.
    Run the report RSSNAPDL in SE38.
    or
    You have the default SAP background jobs, SAP_REORG_ABAPDUMPS which deletes the past dumps raised in the system.
    Scheduling the jobs in regular is very important
    For more information
    http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a7ede505211d189550000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/d8/a58b4275160d53e10000000a155106/frameset.htm
    Regards
    Bhaskar

  • How to configure the runtime and consolidation for a track in CMS.

    How to configure the runtime and consolidation for a track in CMS.
    I can see the track exists in CMS but the same doesnt pull up in the NWDS in the development configuration perspective.
    I compared the given track with the one which gets pulled up in NWDS. Theres something called runtime system and consolidation which isnt defined for the track which is invisible.
    Please advise , what are these required for. And how can we configure the same.

    The runtime systems are defined for a track to setup the Transport path for any code changes....the Consolidation system is usually defined as a Virtual system for the track and used for comparison and fixing any broken or Dirty DC's ....that means it's not used as a Runtime System for Deployment as compared to DEV,QAT and PROD used for Deployment...
    Hope it helps..
    Regards,
    Shikhil

  • How to implement the schema validation with XSD in adapter module

    Dear All,
    I am trying to develop a EJB as the file adapter mudule.
    Please guide me how to implement the schema validation of the source message with XSD.
    Or provide me the relative resources about this task.
    Thanks & Regards,
    Red
    Edited by: Grace Chien on Nov 19, 2008 8:23 AM

    Hi Grace,
    You can do the xml scema validation in PI7.1 version directly.
    To develop the adapter module for xml schema validation
    Validating messages in XI using XML Schema
    Schema Validation of Incoming Message
    Regards
    Goli Sridhar

  • How to implement the shared lock in a  table view

    Hi,
    How to implement the shared lock in a  table view.for multiple users to edit on this same table.
    Thanks in advance
    Swathi

    Hi,
    Please refer this link to find solution to your querry.
    Hope it helps.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c322c690-0201-0010-fb86-811c52b0acc2.
    Regards,
    Rahul

  • How to implement the selfsecured page in oaf

    hi
    any one having knowledge how to implement the selfsecured OAF page documents
    can you please send me [email protected]
    Regards
    Chandra

    Use the search facility on the forum. Did you read the dev guide?
    --Shiv                                                                                                                                                                                       

  • How to implement the spell check in oracle forms 10g or 6i...

    How to implement the spell check in oracle forms.
    Is there any different method is there.
    Please help me....
    Praveen.K

    Here is one different from Jspell..
    In 6i client/server you can call MS Word spell checker using OLE. Below sample code for 6i.
    For 10g you will need webutil to use same code. install webutil and just replace "OLE2." with "CLIENT_OLE2."
    PROCEDURE spell_check (item_name IN VARCHAR2)
    IS
       my_application   ole2.obj_type;
       my_documents     ole2.obj_type;
       my_document      ole2.obj_type;
       my_selection     ole2.obj_type;
       get_spell        ole2.obj_type;
       my_spell         ole2.obj_type;
       args             ole2.list_type;
       spell_checked    VARCHAR2 (4000);
       orig_text        VARCHAR2 (4000);
    BEGIN
       orig_text := NAME_IN (item_name);
       my_application := ole2.create_obj ('WORD.APPLICATION');
       ole2.set_property (my_application, 'VISIBLE', FALSE);
       my_documents := ole2.get_obj_property (my_application, 'DOCUMENTS');
       my_document := ole2.invoke_obj (my_documents, 'ADD');
       my_selection := ole2.get_obj_property (my_application, 'SELECTION');
       ole2.set_property (my_selection, 'TEXT', orig_text);
       get_spell :=ole2.get_obj_property (my_application, 'ACTIVEDOCUMENT');
       ole2.invoke (get_spell, 'CHECKSPELLING');
       ole2.invoke (my_selection, 'WholeStory');
       ole2.invoke (my_selection, 'Copy');
       spell_checked := ole2.get_char_property (my_selection, 'TEXT');
       spell_checked :=SUBSTR (REPLACE (spell_checked, CHR (13), CHR (10)),1,LENGTH (spell_checked));
       COPY (spell_checked, item_name);
       args := ole2.create_arglist;
       ole2.add_arg (args, 0);
       ole2.invoke (my_document, 'CLOSE', args);
       ole2.destroy_arglist (args);
       ole2.RELEASE_OBJ (my_selection);
       ole2.RELEASE_OBJ (get_spell);
       ole2.RELEASE_OBJ (my_document);
       ole2.RELEASE_OBJ (my_documents);
       ole2.invoke (my_application, 'QUIT');
       ole2.RELEASE_OBJ (my_application);
    END;Call it like this: SPELL_CHECK ('BLOCK.MY_TEXT_ITEM' );

  • How to implement the Export to Excel funtionality in VC like in Webdynpro

    Hi
    I have requirement to display the BAR charts, Pie charts ,Line graphs based on the data retreiving from the R/3 thorgh VC.
    I hope it is possible .
    i have requirement like exporting the data whichis pulled from the R3 to display those charts, this data need to be exported to the Excel sheet by providing the button in VC. Like same way we have the privision in WEbdynpro exporting table data to excell sheet.
    How to implement the same thing in VC,
    Can any body help me
    Regards
    Vijay

    1) yes, it's possible
    2) Another one that's in the Visual Composer WIKI:
    https://wiki.sdn.sap.com/wiki/display/VC/Exportingdatafrom+VC

  • How to implement the FCKeditor in the WPC

    Hi all,
    can anyone tell me how to implement the FCKeditor in the Web Page Composer?
    I failed to implement TinyMCE because of the domain relaxing thing...
    Thanks a lot
    Steffi

    It's one of J2EE Patterns - Value List Handler.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
    Here is some implementation.
    http://valuelist.sourceforge.net/
    and some article
    http://www.devx.com/Java/Article/21383
    Just google "J2EE paging"

  • How to implement the Internationaliztion in VC

    Hi All,
    How to implement the Internationalization in VC. Based on the Portal user Lanugauge attribute. how to implement .? Is it possible to implement the Internationalization , changing the  displaying label data and Title names in VC application.
    Regards
    Vijay

    Hi Vijay,
    I think this help-entry should answer all your questions:
    Preparing iViews for Portal Translation:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/48e7428d877276e10000000a1550b0/frameset.htm
    If you have further questions, don't hesitate to ask!
    Regards,
    Christian
    don't forget the points

  • How to implement the pagination  in the entity bean?

    How to implement the pagination in the entity bean? could The rumnum and sub qurey be used in the ejb ql?
    Would you mind giving me some methods to implement it?

    It's one of J2EE Patterns - Value List Handler.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
    Here is some implementation.
    http://valuelist.sourceforge.net/
    and some article
    http://www.devx.com/Java/Article/21383
    Just google "J2EE paging"

  • How to implement the search help exit to MM01 for Material by product hiera

    Hi,
    How to implement the search help exit to MM01 T-code for Material by product hierarchy,
    but system default it gives the data from MVKE table, my client wants from MARA table,
    i created the one Function Module, write this code in that FM.
    IF CALLCONTROL-STEP EQ 'DISP'.
    REFRESH RECORD_TAB.
    SELECT * FROM MARA INTO TABLE RECORD_TAB
    WHERE PRDHA = 
    ENDIF.
    I Face the problem what variable i have to pass in WHERE CONDITION, FROM THE MM01 T-code.
    is't require to IMPORT variable from MM01 program, what is that import variable, please give me the solution.
    thanks to all.

    Hi there..
    check my web blog on search help exit...
    [Search help exit code|https://wiki.sdn.sap.com/wiki/x/du0]

  • How to implement the pessimistic locking using toplink with sybase

    we want to allocate the unique primary key to each row when many user try to insert the records concurrently..So what we are trying to do is we calculate the maximum of Primary Key and incremented it by 1. Now we want to Apply the locking concept on the so that unique key will be allocated to each newly inserted row
    Can you please tell me
    1. how we can genrate unique primary key in toplink using sybase?
    2.how to implement the pessimistic or optimistic locking ?which one will be preferable?

    Hi brother
    I think that this link can help you
    http://download-east.oracle.com/docs/cd/A97688_16/toplink.903/b10064/database.htm#1007986
    Good luck

  • How to know the runtime execution process

    Hi ,
    How to view the runtime execution process(steps) of a class. I know how to debug, but i like to view the Assembly language code .
    Please suggest
    Thanks ,
    Raj

    Why on earth are you ignoring your previous topic about the same question where the answer is already given more than once?
    [http://forums.sun.com/thread.jspa?threadID=5355140]

  • How to implement the View V_SEPA_CUST in SAP 4.7 ?

    Hi SAP Experts,
    We are going to implement SEPA in our project and currently using SAP 4.7.
    Is there any way to implement the View V_SEPA_CUST in SAP 4.7.
    I came to know that there is an OSS Note available for this implementation but I couldn't find the same.
    Please suggest me how to Implement the View V_SEPA_CUST in our SAP system, since we need this View for SEPA implementation.
    Many Thanks in Advance.
    Yogesh.
    Moderator message: one thread only per issue, please.
    Edited by: Thomas Zloch on Jan 31, 2012

    Dear Yogesh,
    SAP has just recently released a note you might want to consider: 1834272. One of the preliminary notes for this note is 1784060...
    This works for SAP 6.4. I can not help you where it is specifically related to SAP 4.7
    Hoping it is of use.
    Best regards,
    Raymond

Maybe you are looking for

  • Drag and Drop to photo page creates links, doesn't replace placeholders

    I searched the discussions for quite a while and didn't find much similar to this topic. Basically, drag and drop is no longer working on my iWeb and my photo grids will not accept pictures to replace the placeholder (sample) photos. I will try to ex

  • Can' trash appl in use

    I am trying to remove an old application "Dropbox" which is not working so I can install a newer version. When I try to trash it, I am told that it is in use.  Even after I restart the computer I am still told it is in use. What does this mean? I wan

  • Collection in SelectOneMenu

    Hi together, I got another problem. I got a collection of persons. Each person has it's name, adress, ect. saved. Now I got a class Institution, which has one Person, who works in it. When I want to create a new Institution I want to choose the perso

  • Where can I freaking find an iPhone 4???

    I am on a reserved waiting list at like 4-5 Apple stores here in Maryland. I have been for over a week and a half now, and im not getting any email notifications of my iPhone 4 being ready for pick up. 2 weeks ago I dropped my iPhone 3G in our pool,

  • Read a HttpServletResponse object

    Hello ! I try to catch the html code generated by a JSP in order to put it in a file ( for download ). At the moment I include the JSP in a servlet so the html code is in an HttpServletResponse object. Does anybody know how to obtain the contents of