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

x33g5p2x  于2022-01-30 转载在 其他  
字(19.4k)|赞(0)|评价(0)|浏览(135)

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

Transformation.updateOrthoProjectionMatrix介绍

暂无

代码示例

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  // Setup view port to match the texture size
  glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
  glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
  glClear(GL_DEPTH_BUFFER_BIT);
  depthShaderProgram.bind();
  DirectionalLight light = scene.getSceneLight().getDirectionalLight();
  Vector3f lightDirection = light.getDirection();
  float lightAngleX = (float)Math.toDegrees(Math.acos(lightDirection.z));
  float lightAngleY = (float)Math.toDegrees(Math.asin(lightDirection.x));
  float lightAngleZ = 0;
  Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
  DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
  Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
  depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
  Map<Mesh, List<GameItem>> mapMeshes = scene.getGameMeshes();
  for (Mesh mesh : mapMeshes.keySet()) {
    mesh.renderList(mapMeshes.get(mesh), (GameItem gameItem) -> {
      Matrix4f modelLightViewMatrix = transformation.buildModelViewMatrix(gameItem, lightViewMatrix);
      depthShaderProgram.setUniform("modelLightViewMatrix", modelLightViewMatrix);
    }
    );
  }
  // Unbind
  depthShaderProgram.unbind();
  glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  // Setup view port to match the texture size
  glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
  glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
  glClear(GL_DEPTH_BUFFER_BIT);
  depthShaderProgram.bind();
  DirectionalLight light = scene.getSceneLight().getDirectionalLight();
  Vector3f lightDirection = light.getDirection();
  float lightAngleX = (float)Math.toDegrees(Math.acos(lightDirection.z));
  float lightAngleY = (float)Math.toDegrees(Math.asin(lightDirection.x));
  float lightAngleZ = 0;
  Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
  DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
  Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
  depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
  Map<Mesh, List<GameItem>> mapMeshes = scene.getGameMeshes();
  for (Mesh mesh : mapMeshes.keySet()) {
    mesh.renderList(mapMeshes.get(mesh), (GameItem gameItem) -> {
      Matrix4f modelLightViewMatrix = transformation.buildModelViewMatrix(gameItem, lightViewMatrix);
      depthShaderProgram.setUniform("modelLightViewMatrix", modelLightViewMatrix);
    }
    );
  }
  // Unbind
  depthShaderProgram.unbind();
  glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  // Setup view port to match the texture size
  glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
  glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
  glClear(GL_DEPTH_BUFFER_BIT);
  depthShaderProgram.bind();
  DirectionalLight light = scene.getSceneLight().getDirectionalLight();
  Vector3f lightDirection = light.getDirection();
  float lightAngleX = (float)Math.toDegrees(Math.acos(lightDirection.z));
  float lightAngleY = (float)Math.toDegrees(Math.asin(lightDirection.x));
  float lightAngleZ = 0;
  Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
  DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
  Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
  depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
  Map<Mesh, List<GameItem>> mapMeshes = scene.getGameMeshes();
  for (Mesh mesh : mapMeshes.keySet()) {
    mesh.renderList(mapMeshes.get(mesh), (GameItem gameItem) -> {
      Matrix4f modelLightViewMatrix = transformation.buildModelViewMatrix(gameItem, lightViewMatrix);
      depthShaderProgram.setUniform("modelLightViewMatrix", modelLightViewMatrix);
    }
    );
  }
  // Unbind
  depthShaderProgram.unbind();
  glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  // Setup view port to match the texture size
  glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
  glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
  glClear(GL_DEPTH_BUFFER_BIT);
  depthShaderProgram.bind();
  DirectionalLight light = scene.getSceneLight().getDirectionalLight();
  Vector3f lightDirection = light.getDirection();
  float lightAngleX = (float)Math.toDegrees(Math.acos(lightDirection.z));
  float lightAngleY = (float)Math.toDegrees(Math.asin(lightDirection.x));
  float lightAngleZ = 0;
  Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
  DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
  Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
  depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
  Map<Mesh, List<GameItem>> mapMeshes = scene.getGameMeshes();
  for (Mesh mesh : mapMeshes.keySet()) {
    mesh.renderList(mapMeshes.get(mesh), (GameItem gameItem) -> {
      Matrix4f modelLightViewMatrix = transformation.buildModelViewMatrix(gameItem, lightViewMatrix);
      depthShaderProgram.setUniform("modelLightViewMatrix", modelLightViewMatrix);
    }
    );
  }
  // Unbind
  depthShaderProgram.unbind();
  glBindFramebuffer(GL_FRAMEBUFFER, 0);
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, true, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, true, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

private void renderDepthMap(Window window, Camera camera, Scene scene) {
  if (scene.isRenderShadows()) {
    // Setup view port to match the texture size
    glBindFramebuffer(GL_FRAMEBUFFER, shadowMap.getDepthMapFBO());
    glViewport(0, 0, ShadowMap.SHADOW_MAP_WIDTH, ShadowMap.SHADOW_MAP_HEIGHT);
    glClear(GL_DEPTH_BUFFER_BIT);
    depthShaderProgram.bind();
    DirectionalLight light = scene.getSceneLight().getDirectionalLight();
    Vector3f lightDirection = light.getDirection();
    float lightAngleX = (float) Math.toDegrees(Math.acos(lightDirection.z));
    float lightAngleY = (float) Math.toDegrees(Math.asin(lightDirection.x));
    float lightAngleZ = 0;
    Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
    DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
    Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);
    depthShaderProgram.setUniform("orthoProjectionMatrix", orthoProjMatrix);
    renderNonInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    renderInstancedMeshes(scene, depthShaderProgram, null, lightViewMatrix);
    // Unbind
    depthShaderProgram.unbind();
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
  }
}

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

Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);

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

Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);

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

Matrix4f lightViewMatrix = transformation.updateLightViewMatrix(new Vector3f(lightDirection).mul(light.getShadowPosMult()), new Vector3f(lightAngleX, lightAngleY, lightAngleZ));
DirectionalLight.OrthoCoords orthCoords = light.getOrthoCoords();
Matrix4f orthoProjMatrix = transformation.updateOrthoProjectionMatrix(orthCoords.left, orthCoords.right, orthCoords.bottom, orthCoords.top, orthCoords.near, orthCoords.far);

相关文章