Example usage for org.lwjgl.opengl NVFogDistance GL_EYE_RADIAL_NV

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

Introduction

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

Prototype

int GL_EYE_RADIAL_NV

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

Click Source Link

Document

When the pname parameter of Fogf, Fogi, Foggv, and Fogiv, is FOG_DISTANCE_MODE_NV, then the value of param or the value pointed to by params may be.

Usage

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

License:Apache License

public void initOpenGL() {
    // init OpenGL
    glMatrixMode(GL_PROJECTION);//from  w  w w .  j a va 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);/*  w ww.j av a2 s .c  o  m*/
    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();
}