Example usage for org.lwjgl.opengl ARBPointSprite GL_COORD_REPLACE_ARB

List of usage examples for org.lwjgl.opengl ARBPointSprite GL_COORD_REPLACE_ARB

Introduction

In this page you can find the example usage for org.lwjgl.opengl ARBPointSprite GL_COORD_REPLACE_ARB.

Prototype

int GL_COORD_REPLACE_ARB

To view the source code for org.lwjgl.opengl ARBPointSprite GL_COORD_REPLACE_ARB.

Click Source Link

Document

When the target parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv, GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of pname may be.

Usage

From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java

License:Open Source License

@Override
public void setupPointParameters(final float pointSize, final boolean antialiased, final boolean isSprite,
        final boolean useDistanceAttenuation, final FloatBuffer attenuationCoefficients,
        final float minPointSize, final float maxPointSize) {
    final RenderContext context = ContextManager.getCurrentContext();

    // TODO: make a record for point states
    GL11.glPointSize(pointSize);/*from w w w  .  jav a 2  s .c  o  m*/

    if (isSprite && context.getCapabilities().isPointSpritesSupported()) {
        GL11.glEnable(ARBPointSprite.GL_POINT_SPRITE_ARB);
        GL11.glTexEnvi(ARBPointSprite.GL_POINT_SPRITE_ARB, ARBPointSprite.GL_COORD_REPLACE_ARB, GL11.GL_TRUE);
    }

    if (useDistanceAttenuation && context.getCapabilities().isPointParametersSupported()) {
        ARBPointParameters.glPointParameterARB(ARBPointParameters.GL_POINT_DISTANCE_ATTENUATION_ARB,
                attenuationCoefficients);
        ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MIN_ARB, minPointSize);
        ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MAX_ARB, maxPointSize);
    }

    if (antialiased) {
        GL11.glEnable(GL11.GL_POINT_SMOOTH);
        GL11.glHint(GL11.GL_POINT_SMOOTH_HINT, GL11.GL_NICEST);
    }
}

From source file:espresso3d.engine.renderer.particle.E3DParticleRendererARBPointSprite.java

License:Open Source License

private void setupPointSpriteParameters(double spriteSize) {
    particleDistanceScalarBuffer.clear();
    //        particleDistanceScalarBuffer.put(0.0f);//1.0f);
    particleDistanceScalarBuffer.put(0.0f);//1.0f);
    particleDistanceScalarBuffer.put(0.0f);
    particleDistanceScalarBuffer.put((float) (1.0
            / (getEngine().getCurrentViewport().getWidth() * getEngine().getCurrentViewport().getHeight())));//0.1f);
    particleDistanceScalarBuffer.rewind();

    ARBPointParameters.glPointParameterARB(ARBPointParameters.GL_POINT_DISTANCE_ATTENUATION_ARB,
            particleDistanceScalarBuffer);
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MIN_ARB, 1f);//(float)particle.getSize());//1f );
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MAX_ARB, maxPointSpriteSize);
    ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_FADE_THRESHOLD_SIZE_ARB, 100f);
    /*        GL14.glPointParameter(GL14.GL_POINT_DISTANCE_ATTENUATION, particleDistanceScalarBuffer);
            GL14.glPointParameterf( GL14.GL_POINT_SIZE_MIN, 1f);//(float)particle.getSize());//1f );
            GL14.glPointParameterf( GL14.GL_POINT_SIZE_MAX, maxPointSpriteSize);
            GL14.glPointParameterf(GL14.GL_POINT_FADE_THRESHOLD_SIZE, 100f);
    *//*from ww  w .  j ava 2 s.  co  m*/

    GL14.glPointParameterf(GL20.GL_POINT_SPRITE_COORD_ORIGIN, GL20.GL_LOWER_LEFT);
    GL11.glTexEnvf(ARBPointSprite.GL_POINT_SPRITE_ARB, ARBPointSprite.GL_COORD_REPLACE_ARB, GL11.GL_TRUE);
    //        GL11.glTexEnvf(  GL20.GL_POINT_SPRITE, GL20.GL_COORD_REPLACE, GL11.GL_TRUE );

    GL11.glPointSize((float) spriteSize); //POINT_SIZE_WORLD_COORD_SCALAR);
}