Additive and subtractive blending effects
MascotCapsule V3 can apply additive and subtractive blending effects to the models, when additive and subtractive blending attributes are specified for these models. You can render the effects similar to smokes and lightning.
In order to specify settings for the additive and subtractive blending, use the setSemiTransparentEnabled( boolean isEnabled ) method in the Effect3D class. Specify true to enable the additive and subtractive blending, and specify false to disable.
/**
* commandAction() method
* Process when the soft key is pressed-down (changing the rendering parameter)
*/
public void commandAction( Command c, Displayable d ){
* commandAction() method
* Process when the soft key is pressed-down (changing the rendering parameter)
*/
public void commandAction( Command c, Displayable d ){
String label = c.getLabel();
/* Changing the blending method */
if( label.equals( commandLabels[ 0 ] ) ){
}/* Changing the blending method */
if( label.equals( commandLabels[ 0 ] ) ){
effect.setSemiTransparentEnabled( false );
}else if( label.equals( commandLabels[ 1 ] ) ){
effect.setSemiTransparentEnabled( true );
}
Lightning effect (additive blending) enabled (left), disabled (right)
Quick Links
- MIDP + com.mascotcapsule package (MascotCapsule V3 API)
- Basic rendering
- Rendering a 3D model / Semi-transparency using BlendHalf / Additive and subtractive blending effects / Switching the animation data / Switching the pattern using dynamic polygons / Lighting / Shading / Using the environment map / Rendering the primitives / Reducing the texture distortion / Preventing Z-sort rendering mistakes under certain circumstances / Coordinate systems and the camera / Projection methods
- Basic rendering
- Go back to Samples index

