Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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 5397 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.

Dwinin (59 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (149 views)
2015-10-11 13:26:18

BurntPizza (163 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!