×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    4

    how to manage transaprency in m3g

    hello,

    I have an image with a transparent background and I want to texture it on a mesh, the problem is that if I do it , I have a black area around in the background zone.
    Do you have any idea on how to play with the blending and the compositing mode in order to obtain the transparency?Here is what I used to create this

    Image2D image2D = new Image2D( Image2D.RGB, iImage );
    textureLeaf = new Texture2D( image2D );
    textureLeaf.setBlending(Texture2D.FUNC_REPLACE);
    appearance2.setTexture(0,textureLeaf);
    CompositingMode cm = new CompositingMode();
    cm.setBlending(CompositingMode.REPLACE);
    appearance2.setCompositingMode(cm);
    Mesh cubeMesh = new Mesh(_cubeVertexData, _cubeTriangles2, appearance2);

    Thank you

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2009
    Posts
    2

    Re: how to manage transaprency in m3g

    It looks like your texture doesn't have an alpha channel, so it won't have any transparency either. Try using Image2D.RGBA instead of Image2D.RGB, and make sure that the source image ("iImage") has an actual alpha channel (instead of color-key transparency). You should also use CompositingMode.ALPHA instead of REPLACE. I hope this helps.

    -tomi

Similar Threads

  1. m3g file creator
    By yehoshua in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-11-26, 12:48
  2. Known bugs in the Nokia M3G implementation
    By taarnio in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2005-11-14, 12:51
  3. M3G (JSR 184) Detail about External Reference in m3g file
    By amitian in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-12-28, 14:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×