Example usage for org.lwjgl.opengl NVFogDistance GL_FOG_DISTANCE_MODE_NV

List of usage examples for org.lwjgl.opengl NVFogDistance GL_FOG_DISTANCE_MODE_NV

Introduction

In this page you can find the example usage for org.lwjgl.opengl NVFogDistance GL_FOG_DISTANCE_MODE_NV.

Prototype

int GL_FOG_DISTANCE_MODE_NV

To view the source code for org.lwjgl.opengl NVFogDistance GL_FOG_DISTANCE_MODE_NV.

Click Source Link

Document

Accepted by the pname parameters of Fogf, Fogi, Fogfv, Fogiv, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.

Usage

From source file:net.kubin.game.Game.java

License:Apache License

public void initOpenGL() {
    // init OpenGL
    glMatrixMode(GL_PROJECTION);/* w w  w.  j a  v  a  2  s  . c o m*/
    glLoadIdentity();
    glOrtho(0, 800, 600, 0, 1, 300);
    glMatrixMode(GL_MODELVIEW);

    GL11.glShadeModel(GL11.GL_SMOOTH);

    Vec3f fog = Kubin.getConfiguration().getFogColor();

    glClearColor(fog.x(), fog.y(), fog.z(), 1.0f);
    glEnable(GL_TEXTURE_2D);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    // glEnable(GL_DEPTH_TEST);
    // glDepthFunc(GL_ALWAYS);

    glEnable(GL_CULL_FACE);

    glEnable(GL_FOG);
    glFog(GL_FOG_COLOR, GLUtils.wrapDirect(fog.x(), fog.y(), fog.z(), 1.0f));
    glFogi(GL_FOG_MODE, GL11.GL_LINEAR);
    glFogf(GL_FOG_START, Kubin.getConfiguration().getViewingDistance() * 0.55f);
    glFogf(GL_FOG_END, Kubin.getConfiguration().getViewingDistance());
    glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV);
    glHint(GL_FOG_HINT, GL_NICEST);

    System.out.println("VBO Supported: " + GLUtils.isVBOSupported());

    /* Instantiate the BufferManager */
    BufferManager.getInstance();
}

From source file:org.craftmania.game.Game.java

License:Apache License

public void initOpenGL() throws IOException {
    // init OpenGL
    glMatrixMode(GL_PROJECTION);//from  w w  w .jav a  2 s  . com
    glLoadIdentity();
    glOrtho(0, 800, 600, 0, 1, 300);
    glMatrixMode(GL_MODELVIEW);

    GL11.glShadeModel(GL11.GL_SMOOTH);

    Vec3f fog = _configuration.getFogColor();

    glClearColor(fog.x(), fog.y(), fog.z(), 1.0f);
    glEnable(GL_TEXTURE_2D);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    // glEnable(GL_DEPTH_TEST);
    // glDepthFunc(GL_ALWAYS);

    glEnable(GL_CULL_FACE);

    glEnable(GL_FOG);
    glFog(GL_FOG_COLOR, GLUtils.wrapDirect(fog.x(), fog.y(), fog.z(), 1.0f));
    glFogi(GL_FOG_MODE, GL11.GL_LINEAR);
    glFogf(GL_FOG_START, _configuration.getViewingDistance() * 0.55f);
    glFogf(GL_FOG_END, _configuration.getViewingDistance());
    glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV);
    glHint(GL_FOG_HINT, GL_NICEST);

    System.out.println("VBO Supported: " + GLUtils.isVBOSupported());

    /* Instantiate the BufferManager */
    BufferManager.getInstance();
}