Java Code Examples for com.jme3.material.RenderState#BlendMode

The following examples show how to use com.jme3.material.RenderState#BlendMode . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JmeBatchRenderBackend.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private RenderState.BlendMode convertBlend(final BlendMode blendMode) {
    if (blendMode == null) {
        return RenderState.BlendMode.Off;
    } else {
        switch (blendMode) {
            case BLEND:
                return RenderState.BlendMode.Alpha;
            case MULIPLY:
                return RenderState.BlendMode.Alpha;
            default:
                throw new UnsupportedOperationException();
        }
    }
}
 
Example 2
Source File: RenderDeviceJme.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private RenderState.BlendMode convertBlend(BlendMode blendMode) {
    if (blendMode == null) {
        return RenderState.BlendMode.Off;
    } else
        switch (blendMode) {
            case BLEND:
                return RenderState.BlendMode.Alpha;
            case MULIPLY:
                return RenderState.BlendMode.Alpha;
            default:
                throw new UnsupportedOperationException();
    }
}
 
Example 3
Source File: GLRenderer.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void changeBlendMode(RenderState.BlendMode blendMode) {
    if (blendMode != context.blendMode) {
        if (blendMode == RenderState.BlendMode.Off) {
            gl.glDisable(GL.GL_BLEND);
        } else if (context.blendMode == RenderState.BlendMode.Off) {
            gl.glEnable(GL.GL_BLEND);
        }

        context.blendMode = blendMode;
    }
}
 
Example 4
Source File: RenderDeviceJme.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private RenderState.BlendMode convertBlend(){
    if (blendMode == null)
        return RenderState.BlendMode.Off;
    else if (blendMode == BlendMode.BLEND)
        return RenderState.BlendMode.Alpha;
    else if (blendMode == BlendMode.MULIPLY)
        return RenderState.BlendMode.Modulate;
    else
        throw new UnsupportedOperationException();
}