Package com.ardor3d.math.type

Examples of com.ardor3d.math.type.ReadOnlyColorRGBA


            return true;
        }
        if (!(o instanceof ReadOnlyColorRGBA)) {
            return false;
        }
        final ReadOnlyColorRGBA comp = (ReadOnlyColorRGBA) o;
        return getRed() == comp.getRed() && getGreen() == comp.getGreen() && getBlue() == comp.getBlue()
                && getAlpha() == comp.getAlpha();
    }
View Full Code Here


    }

    @Override
    protected void deactivate() {
        if (_active == 1) {
            final ReadOnlyColorRGBA bgColor = _parentRenderer.getBackgroundColor();
            GL11.glClearColor(bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), bgColor.getAlpha());
            EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);

            ContextManager.getCurrentContext().popEnforcedStates();

            if (_neededClip) {
View Full Code Here

                    float shadow = ((eval2 - eval1) / (float) (1 << baseClipmapLevel)) * positionInfo1.getLayer().getLightMapShadowColorScale() + 0.5f;
                    if (shadow < 0.0f) shadow = 0.0f;
                    else if (shadow > 1.0f) shadow = 1.0f;

                    final ReadOnlyColorRGBA layerColor = positionInfo1.getLayer().getColor();
                    final int index = (x + y * tileSize) * 3;
                    data.put(index,     (byte) (layerColor.getRed()*shadow * 255));
                    data.put(index + 1, (byte) (layerColor.getGreen()*shadow * 255));
                    data.put(index + 2, (byte) (layerColor.getBlue()*shadow * 255));
                }
            }
        } finally {
            textureLock.unlock();
        }
View Full Code Here

                    final int heightY = tileY * tileSize + y;

                    final double eval = function.eval(heightX << baseClipmapLevel, heightY << baseClipmapLevel, 0) * 0.4167f + 0.5f;
                    final byte colIndex = (byte) (eval * 255);

                    final ReadOnlyColorRGBA c = terrainColors[colIndex & 0xFF];

                    final int index = (x + y * tileSize) * 3;
                    data.put(index, (byte) (c.getRed() * 255));
                    data.put(index + 1, (byte) (c.getGreen() * 255));
                    data.put(index + 2, (byte) (c.getBlue() * 255));
                }
            }
        } finally {
            textureLock.unlock();
        }
View Full Code Here

                record.fogEnd = state.getEnd();
                GL11.glFogf(GL11.GL_FOG_DENSITY, state.getDensity());
                record.density = state.getDensity();
            }

            final ReadOnlyColorRGBA fogColor = state.getColor();
            applyFogColor(fogColor, record);
            applyFogMode(state.getDensityFunction(), record);
            applyFogHint(state.getQuality(), record);
            applyFogSource(state.getSource(), record, context.getCapabilities());
        } else {
View Full Code Here

            final boolean applyConstant = state.getDestinationFunctionRGB().usesConstantColor()
                    || state.getSourceFunctionRGB().usesConstantColor()
                    || (caps.isConstantBlendColorSupported() && (state.getDestinationFunctionAlpha()
                            .usesConstantColor() || state.getSourceFunctionAlpha().usesConstantColor()));
            if (applyConstant && caps.isConstantBlendColorSupported()) {
                final ReadOnlyColorRGBA constant = state.getConstantColor();
                if (!record.isValid() || (caps.isConstantBlendColorSupported() && !record.blendColor.equals(constant))) {
                    ARBImaging.glBlendColor(constant.getRed(), constant.getGreen(), constant.getBlue(),
                            constant.getAlpha());
                    record.blendColor.set(constant);
                }
            }
        }
    }
View Full Code Here

        }
    }

    public static void applyBlendColor(final Texture texture, final TextureUnitRecord unitRecord, final int unit,
            final TextureStateRecord record, final ContextCapabilities caps) {
        final ReadOnlyColorRGBA texBlend = texture.getConstantColor();
        if (!unitRecord.isValid() || !unitRecord.blendColor.equals(texBlend)) {
            checkAndSetUnit(unit, record, caps);
            TextureRecord.colorBuffer.clear();
            TextureRecord.colorBuffer.put(texBlend.getRed()).put(texBlend.getGreen()).put(texBlend.getBlue())
                    .put(texBlend.getAlpha());
            TextureRecord.colorBuffer.rewind();
            GL11.glTexEnv(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_COLOR, TextureRecord.colorBuffer);
            unitRecord.blendColor.set(texBlend);
        }
    }
View Full Code Here

        }
    }

    public static void applyBorderColor(final Texture texture, final TextureRecord texRecord, final int unit,
            final TextureStateRecord record) {
        final ReadOnlyColorRGBA texBorder = texture.getBorderColor();
        if (!texRecord.isValid() || !texRecord.borderColor.equals(texBorder)) {
            TextureRecord.colorBuffer.clear();
            TextureRecord.colorBuffer.put(texBorder.getRed()).put(texBorder.getGreen()).put(texBorder.getBlue())
                    .put(texBorder.getAlpha());
            TextureRecord.colorBuffer.rewind();
            GL11.glTexParameter(getGLType(texture.getType()), GL11.GL_TEXTURE_BORDER_COLOR, TextureRecord.colorBuffer);
            texRecord.borderColor.set(texBorder);
        }
    }
View Full Code Here

    @Override
    protected void deactivate() {
        final GL gl = GLContext.getCurrentGL();

        if (_active == 1) {
            final ReadOnlyColorRGBA bgColor = _parentRenderer.getBackgroundColor();
            gl.glClearColor(bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), bgColor.getAlpha());
            gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
            ContextManager.getCurrentContext().popEnforcedStates();

            if (_neededClip) {
                _parentRenderer.popClip();
View Full Code Here

    public static void applyBlendColor(final Texture texture, final TextureUnitRecord unitRecord, final int unit,
            final TextureStateRecord record, final ContextCapabilities caps) {
        final GL gl = GLContext.getCurrentGL();

        final ReadOnlyColorRGBA texBlend = texture.getConstantColor();
        if (!unitRecord.isValid() || !unitRecord.blendColor.equals(texBlend)) {
            checkAndSetUnit(unit, record, caps);
            TextureRecord.colorBuffer.clear();
            TextureRecord.colorBuffer.put(texBlend.getRed()).put(texBlend.getGreen()).put(texBlend.getBlue())
                    .put(texBlend.getAlpha());
            TextureRecord.colorBuffer.rewind();
            gl.getGL2ES1().glTexEnvfv(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_COLOR, TextureRecord.colorBuffer);
            unitRecord.blendColor.set(texBlend);
        }
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.math.type.ReadOnlyColorRGBA

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.