Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (731)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Can't get alpha blending to work properly    (Read 5789 times)
0 Members and 1 Guest are viewing this topic.
Offline arne

Senior Devvie

money is the worst drug- we should not let it rule

« Reply #30 - Posted 2005-10-13 22:34:59 »

Err... it really works ?
I haven't got it to work, What did I do wrong I wonder? There's nothing more then adding the Shapes Huh Or does this only work, if I don't use opaque planes?

:: JOODE :: Xith3d :: OdeJava ::
Offline hawkwind

Junior Devvie

Java games rock!

« Reply #31 - Posted 2005-10-13 23:40:30 »

uncertain without seeing your code.  Opaque planes???  What do you mean here??
Offline arne

Senior Devvie

money is the worst drug- we should not let it rule

« Reply #32 - Posted 2005-10-14 10:35:31 »

You wanted to see the code. Here is it  (I tried to remove unimportant stuff, because then it would be even more, the code is from my terrain-loader. It splits the terrain in many different pieces).
I marked the areas bold, where I set Transparency Attributes , cause I believe there could lie the problem)

             // g is the Geometry
                for(int i = 0; i < texTypeSplit.length; i++) {
                   System.out.println("----------------------------- "+ i);
                    AppearanceResult res = getAppearance(texTypeSplit, x, y, x+SEGMENT_LENGTH, y+SEGMENT_WIDTH);
                    if(res != null) {
                        Shape3D shape = new Shape3D(g,res.getAppearance());

    public AppearanceResult getappearance(String type, int start_x, int start_y, int end_x, int end_y) {
        Texture tiles = texloader.loadTexture(tilePath,"RGB",true,Texture.BASE_LEVEL,Texture.BASE_LEVEL_LINEAR,Texture.WRAP);
        states[0] = new TextureUnitState();
        TextureAttributes texAttrib = new TextureAttributes();
        if(checkoutBelow) { // For the purely opaque level at the ground, I don't have an alpha layer, so I skip setting the alpha
            Texture alphamap = texloader.getMinMapAlphaTexture(alphaPath);

            states[1] = new TextureUnitState();
            TextureAttributes alphaAttrib = new TextureAttributes();
            TransparencyAttributes transAttr = new TransparencyAttributes(   // These Transparency Attributes are for the Layers,
                    TransparencyAttributes.BLENDED,                                                // that get layed over others, so they are more
                    0f,                                                                                      // transparent in some places than in others.
        else {
            TransparencyAttributes transAttr = new TransparencyAttributes();   // that's for layer at the bottom, which is fully
            transAttr.setSortEnabled(true);                                                                       // opaque
        AppearanceResult res = new AppearanceResult(a, checkoutBelow);

Note, that it works, if I don't use the DecalGroup, but Transformgroups, that moves the alpha-layers a bit up, so they get shown over the opaque layer.


:: JOODE :: Xith3d :: OdeJava ::
Pages: 1 [2]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Mac70 (20 views)
2016-05-24 21:16:33

theagentd (41 views)
2016-05-14 18:38:35

theagentd (72 views)
2016-05-10 22:37:41

theagentd (76 views)
2016-05-10 22:33:46

IanParcs (108 views)
2016-04-18 14:18:53

KaiHH (101 views)
2016-04-18 08:35:41

KaiHH (129 views)
2016-04-15 12:43:58

theagentd (133 views)
2016-04-14 02:16:17

theagentd (155 views)
2016-04-14 02:15:43

IanParcs (249 views)
2016-04-12 03:51:16
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!