List of usage examples for javax.media.j3d TransparencyAttributes BLEND_ONE_MINUS_SRC_ALPHA
int BLEND_ONE_MINUS_SRC_ALPHA
To view the source code for javax.media.j3d TransparencyAttributes BLEND_ONE_MINUS_SRC_ALPHA.
Click Source Link
f = 1-alphasrc
. From source file:AppearanceExplorer.java
TransparencyAttributesEditor(TransparencyAttributes init) { transpAttr = init;/*from w ww .j av a 2 s. c om*/ transparency = transpAttr.getTransparency(); mode = transpAttr.getTransparencyMode(); srcBlendFunction = transpAttr.getSrcBlendFunction(); dstBlendFunction = transpAttr.getDstBlendFunction(); setLayout(new GridLayout(4, 1)); FloatLabelJSlider transparencySlider = new FloatLabelJSlider("Transparency", 0.1f, 0.0f, 1.0f, transparency); transparencySlider.setMajorTickSpacing(0.1f); transparencySlider.setPaintTicks(true); transparencySlider.addFloatListener(new FloatListener() { public void floatChanged(FloatEvent e) { transparency = e.getValue(); transpAttr.setTransparency(transparency); } }); add(transparencySlider); String[] modeNames = { "NONE", "SCREEN_DOOR", "BLENDED", "NICEST", "FASTEST" }; int[] modeValues = { TransparencyAttributes.NONE, TransparencyAttributes.SCREEN_DOOR, TransparencyAttributes.BLENDED, TransparencyAttributes.NICEST, TransparencyAttributes.FASTEST }; IntChooser modeChooser = new IntChooser("Mode:", modeNames, modeValues, mode); modeChooser.addIntListener(new IntListener() { public void intChanged(IntEvent event) { mode = event.getValue(); transpAttr.setTransparencyMode(mode); } }); add(modeChooser); String[] blendNames = { "BLEND_ZERO", "BLEND_ONE", "BLEND_SRC_ALPHA", "BLEND_ONE_MINUS_SRC_ALPHA" }; int[] blendValues = { TransparencyAttributes.BLEND_ZERO, TransparencyAttributes.BLEND_ONE, TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA, }; IntChooser srcBlendFunctionChooser = new IntChooser("Src Blend Func:", blendNames, blendValues, srcBlendFunction); srcBlendFunctionChooser.addIntListener(new IntListener() { public void intChanged(IntEvent event) { srcBlendFunction = event.getValue(); transpAttr.setSrcBlendFunction(srcBlendFunction); } }); add(srcBlendFunctionChooser); IntChooser dstBlendFunctionChooser = new IntChooser("Dst Blend Func:", blendNames, blendValues, dstBlendFunction); dstBlendFunctionChooser.addIntListener(new IntListener() { public void intChanged(IntEvent event) { dstBlendFunction = event.getValue(); transpAttr.setDstBlendFunction(dstBlendFunction); } }); add(dstBlendFunctionChooser); }