Software Transparency Isn't Working

Started by AGP, May 24, 2014, 08:08:13 AM

Previous topic - Next topic

AGP

Software transparency isn't working. I haven't tested the hardware in this case, but I am loading the Texture with the alpha boolean. It's not the legacy renderer, either. Have a look at the black rectangles for the crowds.


class Crowd {
     private Object3D[] planes;
     private Object3D pivot;
     public Crowd(World theWorld) {
planes = Loader.loadOBJ("Crowd.obj", "Crowd.mtl", 2f);
pivot = Object3D.createDummyObj();
for (int i = 0; i < planes.length; i++) {
planes[1].setTransparency(0);
     planes[i].setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);
     planes[i].setTexture("Torcida.png");
     pivot.addChild(planes[i]);
     theWorld.addObject(planes[i]);
}
     }
     public void setChildOf(Object3D parent) {
parent.addChild(pivot);
     }
}



EgonOlsen

Should work fine. Maybe the texture simply has no proper alpha. Have you tried with false instead.

AGP

The texture has alpha. I did just try with false (not sure what the point was), but it also didn't work.

EgonOlsen

In that loop, you are setting only the first plane to transparent. Is that intentionally?

AGP

No, it's indented differently because I wasn't sure whether the line was needed. The 1 is a combination of an initial typo and the fact that I'm too lazy to get glasses. Thanks. But as a note, the texture lights up when transparent. I had to decrease brightness on the texture itself in order to achieve a proper effect. Is there no way to produce an identical effect to the hardware (just the transparency without affecting the brightness)?

EgonOlsen

Quote from: AGP on May 25, 2014, 02:02:54 AM
Is there no way to produce an identical effect to the hardware (just the transparency without affecting the brightness)?
If you can use additive blending, then the results should be pretty similar. With the "normal" blending mode, the operation is just different and so is the outcome. I had this issue myself in the past and i reverted to some ITextureEffect that tweaked the textures in case of the software renderer being used. That worked well enough for me.