예제 #1
0
 public void setShadowmapShader1i(GL2GL3 gl, int i, String name) {
   shadowmapshader.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shadowmapshader.getID(), name), i);
   shadowmapshadertess.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shadowmapshadertess.getID(), name), i);
   shadowmapshadertess.unuse(gl);
 }
예제 #2
0
 public void setShadowmapShaderTexture(GL2GL3 gl, TexBindSet tbs, String texname) {
   shadowmapshader.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shadowmapshader.getID(), texname), tbs.texunit);
   shadowmapshadertess.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shadowmapshadertess.getID(), texname), tbs.texunit);
   shadowmapshadertess.unuse(gl);
 }
예제 #3
0
  public void setTessLevel(GL2GL3 gl, int level) {
    shadowmapshadertess.use(gl);
    gl.glUniform1i(gl.glGetUniformLocation(shadowmapshadertess.getID(), "tesslevel"), level);
    shadowmapshadertess.unuse(gl);

    shadertess.use(gl);
    gl.glUniform1i(gl.glGetUniformLocation(shadertess.getID(), "tesslevel"), level);
    shadertess.unuse(gl);
  }
예제 #4
0
 public void shader1i(GL2GL3 gl, int i, String name) {
   shader.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shader.getID(), name), i);
   // gl.glUniform(new GLUniformData(name, i));
   shadertess.use(gl);
   gl.glUniform1i(gl.glGetUniformLocation(shadertess.getID(), name), i);
   // GLUniformData tmp = new GLUniformData(name, i);
   // tmp.setLocation(gl.glGetUniformLocation(shadertess.getID(), name));
   // gl.glUniform(tmp);
   shadertess.unuse(gl);
 }
예제 #5
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);
  }