Exemplo n.º 1
0
  public void renderingToFBO(
      GL2GL3 gl, FBO fbo, int offsetx, int offsety, int width, int height, boolean show) {
    shader.use(gl);
    fbo.bind(gl);
    gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
    gl.glViewport(offsetx, offsety, width, height);

    shader.use(gl);
    updateligths(gl, shader);
    scene(gl, shader, show);

    shadertess.use(gl);
    updateligths(gl, shadertess);
    scenetess((GL3) gl, shadertess);
    shadertess.unuse(gl);

    fbo.unbind(gl);
    gl.glFlush();
  }
Exemplo n.º 2
0
  public void ShadowMap(GL2GL3 gl, boolean show) {
    smapfbo.bind(gl);
    gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
    gl.glViewport(0, 0, smapwidth, smapheight);

    shadowmapshadertess.use(gl);
    gl.glUniform1i(gl.glGetUniformLocation(shadowmapshadertess.getID(), "stage"), 0);
    smapupdatelightstess(gl);
    scenetess((GL4) gl, shadowmapshadertess);

    shadowmapshader.use(gl);
    gl.glUniform1i(gl.glGetUniformLocation(shadowmapshader.getID(), "stage"), 0);
    smapupdatelights(gl);
    scene(gl, shadowmapshader, show);

    gl.glFlush();
    smapfbo.unbind(gl);
    Shader.unuse(gl);
  }