Search in sources :

Example 1 with RawModel

use of com.chrisali.javaflightsim.lwjgl.models.RawModel in project j6dof-flight-sim by chris-ali.

the class TerrainRenderer method prepareTerrain.

private void prepareTerrain(Terrain terrain) {
    RawModel rawModel = terrain.getModel();
    GL30.glBindVertexArray(rawModel.getVaoID());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    bindTextures(terrain);
    // TODO
    terrainShader.loadShineVariables(1, 0);
}
Also used : RawModel(com.chrisali.javaflightsim.lwjgl.models.RawModel)

Example 2 with RawModel

use of com.chrisali.javaflightsim.lwjgl.models.RawModel in project j6dof-flight-sim by chris-ali.

the class EntityRenderer method prepareTexturedModel.

private void prepareTexturedModel(TexturedModel model) {
    RawModel rawModel = model.getRawModel();
    GL30.glBindVertexArray(rawModel.getVaoID());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    ModelTexture texture = model.getTexture();
    shader.loadFakeLightingVariable(texture.isUseFakeLighting());
    shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
    shader.loadNumberOfRows(texture.getNumberOfAtlasRows());
    if (texture.isHasTransparency())
        MasterRenderer.disableCulling();
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureID());
}
Also used : RawModel(com.chrisali.javaflightsim.lwjgl.models.RawModel) ModelTexture(com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)

Aggregations

RawModel (com.chrisali.javaflightsim.lwjgl.models.RawModel)2 ModelTexture (com.chrisali.javaflightsim.lwjgl.textures.ModelTexture)1