×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2003
    Location
    Ukraine
    Posts
    75

    jsr-184: transparent color not work ?

    I try to create translucent plane:
    ...
    VertexBuffer vertexBuffer = new VertexBuffer();
    vertexBuffer.setPositions(POSITIONS_ARRAY, 1.0f, null);
    vertexBuffer.setDefaultColor(0xAA00FF00);
    ...
    But plane not translucent, it is simply green.

  2. #2
    Registered User
    Join Date
    Oct 2004
    Posts
    29
    Hello

    I don't know too much about JSR-184 but I may have an idea of the cause of your problem (I know quite some stuff about real-time CG on the other hand ).

    Setting up an alpha for your polys might not be sufficient to get them actually appear translucent. You also have to tell the renderer how to use that alpha value for rendering, i.e. you have to set up the blending state.

    In JSR-184, it seems to be done through the CompositingMode class, but you'll have to look on your own from there.

    You should be aware that alpha-based blending can be quite troublesome since polys have to be sorted for proper results. I suggest you use additive blending (ALPHA_ADD in JSR-184) or modulate blending in place (those modes give the same result whatever the rendering order is).

    You should also expect some speed loss as blending is quite CPU expensive. This might be a real problem on some terminals.

    Have fun !

Posting Permissions

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