org.lwjglb.engine.graph.Mesh.render()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(13.6k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.lwjglb.engine.graph.Mesh.render()方法的一些代码示例,展示了Mesh.render()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.render()方法的具体详情如下:
包路径:org.lwjglb.engine.graph.Mesh
类名称:Mesh
方法名:render

Mesh.render介绍

暂无

代码示例

代码示例来源:origin: lwjglgamedev/lwjglbook

public void renderTest(ShadowBuffer shadowMap) {
  testShaderProgram.bind();
  testShaderProgram.setUniform("texture_sampler[0]", 0);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, shadowMap.getDepthMapTexture().getIds()[0]);
  quadMesh.render();
  testShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void renderTest(ShadowBuffer shadowMap) {
  testShaderProgram.bind();
  testShaderProgram.setUniform("texture_sampler[0]", 0);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, shadowMap.getDepthMapTexture().getIds()[0]);
  quadMesh.render();
  testShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void renderTest(ShadowBuffer shadowMap) {
  testShaderProgram.bind();
  testShaderProgram.setUniform("texture_sampler[0]", 0);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, shadowMap.getDepthMapTexture().getIds()[0]);
  quadMesh.render();
  testShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void renderTest(ShadowBuffer shadowMap) {
  testShaderProgram.bind();
  testShaderProgram.setUniform("texture_sampler[0]", 0);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_2D, shadowMap.getDepthMapTexture().getIds()[0]);
  quadMesh.render();
  testShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.getOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.getOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.getOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderSkyBox(Window window, Camera camera, Scene scene) {
  skyBoxShaderProgram.bind();
  skyBoxShaderProgram.setUniform("texture_sampler", 0);
  Matrix4f projectionMatrix = transformation.getProjectionMatrix();
  skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
  SkyBox skyBox = scene.getSkyBox();
  Matrix4f viewMatrix = transformation.getViewMatrix();
  viewMatrix.m30(0);
  viewMatrix.m31(0);
  viewMatrix.m32(0);
  Matrix4f modelViewMatrix = transformation.buildModelViewMatrix(skyBox, viewMatrix);
  skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
  skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getSkyBoxLight());
  scene.getSkyBox().getMesh().render();
  skyBoxShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderSkyBox(Window window, Camera camera, Scene scene) {
  skyBoxShaderProgram.bind();
  skyBoxShaderProgram.setUniform("texture_sampler", 0);
  Matrix4f projectionMatrix = transformation.getProjectionMatrix();
  skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
  SkyBox skyBox = scene.getSkyBox();
  Matrix4f viewMatrix = transformation.getViewMatrix();
  viewMatrix.m30(0);
  viewMatrix.m31(0);
  viewMatrix.m32(0);
  Matrix4f modelViewMatrix = transformation.buildModelViewMatrix(skyBox, viewMatrix);
  skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
  skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getAmbientLight());
  scene.getSkyBox().getMesh().render();
  skyBoxShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.getOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  hudShaderProgram.bind();
  Matrix4f ortho = transformation.getOrthoProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
  for (GameItem gameItem : hud.getGameItems()) {
    Mesh mesh = gameItem.getMesh();
    // Set ortohtaphic and model matrix for this HUD item
    Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
    hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
    hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
    hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
    // Render the mesh for this HUD item
    mesh.render();
  }
  hudShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  if (hud != null) {
    hudShaderProgram.bind();
    Matrix4f ortho = transformation.getOrtho2DProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
    for (GameItem gameItem : hud.getGameItems()) {
      Mesh mesh = gameItem.getMesh();
      // Set ortohtaphic and model matrix for this HUD item
      Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
      hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
      hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
      hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
      // Render the mesh for this HUD item
      mesh.render();
    }
    hudShaderProgram.unbind();
  }
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  if (hud != null) {
    hudShaderProgram.bind();
    Matrix4f ortho = transformation.getOrtho2DProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
    for (GameItem gameItem : hud.getGameItems()) {
      Mesh mesh = gameItem.getMesh();
      // Set ortohtaphic and model matrix for this HUD item
      Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
      hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
      hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
      hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
      // Render the mesh for this HUD item
      mesh.render();
    }
    hudShaderProgram.unbind();
  }
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderHud(Window window, IHud hud) {
  if (hud != null) {
    hudShaderProgram.bind();
    Matrix4f ortho = transformation.getOrtho2DProjectionMatrix(0, window.getWidth(), window.getHeight(), 0);
    for (GameItem gameItem : hud.getGameItems()) {
      Mesh mesh = gameItem.getMesh();
      // Set ortohtaphic and model matrix for this HUD item
      Matrix4f projModelMatrix = transformation.buildOrtoProjModelMatrix(gameItem, ortho);
      hudShaderProgram.setUniform("projModelMatrix", projModelMatrix);
      hudShaderProgram.setUniform("colour", gameItem.getMesh().getMaterial().getAmbientColour());
      hudShaderProgram.setUniform("hasTexture", gameItem.getMesh().getMaterial().isTextured() ? 1 : 0);
      // Render the mesh for this HUD item
      mesh.render();
    }
    hudShaderProgram.unbind();
  }
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderSkyBox(Window window, Camera camera, Scene scene) {
  skyBoxShaderProgram.bind();
  skyBoxShaderProgram.setUniform("texture_sampler", 0);
  Matrix4f projectionMatrix = transformation.getProjectionMatrix();
  skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
  SkyBox skyBox = scene.getSkyBox();
  Matrix4f viewMatrix = transformation.getViewMatrix();
  viewMatrix.m30(0);
  viewMatrix.m31(0);
  viewMatrix.m32(0);
  Matrix4f modelViewMatrix = transformation.buildModelViewMatrix(skyBox, viewMatrix);
  skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
  skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getSkyBoxLight());
  scene.getSkyBox().getMesh().render();
  skyBoxShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderSkyBox(Window window, Camera camera, Scene scene) {
  skyBoxShaderProgram.bind();
  skyBoxShaderProgram.setUniform("texture_sampler", 0);
  Matrix4f projectionMatrix = transformation.getProjectionMatrix();
  skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
  SkyBox skyBox = scene.getSkyBox();
  Matrix4f viewMatrix = transformation.getViewMatrix();
  viewMatrix.m30(0);
  viewMatrix.m31(0);
  viewMatrix.m32(0);
  Matrix4f modelViewMatrix = transformation.buildModelViewMatrix(skyBox, viewMatrix);
  skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
  skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getSkyBoxLight());
  scene.getSkyBox().getMesh().render();
  skyBoxShaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void renderSkyBox(Window window, Camera camera, Scene scene) {
  skyBoxShaderProgram.bind();
  skyBoxShaderProgram.setUniform("texture_sampler", 0);
  // Update projection Matrix
  Matrix4f projectionMatrix = transformation.getProjectionMatrix(FOV, window.getWidth(), window.getHeight(), Z_NEAR, Z_FAR);
  skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
  SkyBox skyBox = scene.getSkyBox();
  Matrix4f viewMatrix = transformation.getViewMatrix(camera);
  viewMatrix.m30(0);
  viewMatrix.m31(0);
  viewMatrix.m32(0);
  Matrix4f modelViewMatrix = transformation.getModelViewMatrix(skyBox, viewMatrix);
  skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
  skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getAmbientLight());
      
  scene.getSkyBox().getMesh().render();
  skyBoxShaderProgram.unbind();
}

相关文章