com.jme3.renderer.Renderer.clearBuffers()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(131)

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

Renderer.clearBuffers介绍

[英]Clears certain channels of the currently bound framebuffer.
[中]清除当前绑定的帧缓冲区的某些通道。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleRender(RenderManager rm){
  Renderer r = rm.getRenderer();
  //do FBO rendering
  r.setFrameBuffer(fb);
  rm.setCamera(cam, false); // FBO uses current camera
  r.clearBuffers(true, true, true);
  rm.renderScene(fbNode, viewPort);
  rm.flushQueue(viewPort);
  //go back to default rendering and let
  //SimpleApplication render the default scene
  r.setFrameBuffer(null);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleRender(RenderManager rm){
  Renderer r = rm.getRenderer();
  //do FBO rendering
  r.setFrameBuffer(fb);
  rm.setCamera(cam, false); // FBO uses current camera
  r.clearBuffers(true, true, true);
  rm.renderScene(fbNode, viewPort);
  rm.flushQueue(viewPort);
  //go back to default rendering and let
  //SimpleApplication render the default scene
  r.setFrameBuffer(null);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
protected void postQueue(RenderQueue queue) {
  if(!approximateNormals) {
    Renderer r = renderManager.getRenderer();
    r.setFrameBuffer(normalPass.getRenderFrameBuffer());
    renderManager.getRenderer().clearBuffers(true, true, true);
    renderManager.setForcedTechnique("PreNormalPass");
    renderManager.renderViewPortQueues(viewPort, false);
    renderManager.setForcedTechnique(null);
    renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
protected void postQueue(RenderQueue queue) {
  Renderer r = renderManager.getRenderer();
  r.setFrameBuffer(normalPass.getRenderFrameBuffer());
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedTechnique("PreNormalPass");
  renderManager.renderViewPortQueues(viewPort, false);
  renderManager.setForcedTechnique(null);
  renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
protected void postQueue(RenderQueue queue) {
  if (glowMode != GlowMode.Scene) {           
    renderManager.getRenderer().setBackgroundColor(ColorRGBA.BlackNoAlpha);            
    renderManager.getRenderer().setFrameBuffer(preGlowPass.getRenderFrameBuffer());
    renderManager.getRenderer().clearBuffers(true, true, true);
    renderManager.setForcedTechnique("Glow");
    renderManager.renderViewPortQueues(viewPort, false);         
    renderManager.setForcedTechnique(null);
    renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected void renderShadowMap(int shadowMapIndex) {
  shadowMapOccluders = getOccludersToRender(shadowMapIndex, shadowMapOccluders);
  Camera shadowCam = getShadowCam(shadowMapIndex);
  //saving light view projection matrix for this split            
  lightViewProjectionsMatrices[shadowMapIndex].set(shadowCam.getViewProjectionMatrix());
  renderManager.setCamera(shadowCam, false);
  renderManager.getRenderer().setFrameBuffer(shadowFB[shadowMapIndex]);
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedRenderState(forcedRenderState);
  // render shadow casters to shadow map
  viewPort.getQueue().renderShadowQueue(shadowMapOccluders, renderManager, shadowCam, true);
  renderManager.setForcedRenderState(null);
}
boolean debugfrustums = false;

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected void renderShadowMap(int shadowMapIndex) {
  shadowMapOccluders = getOccludersToRender(shadowMapIndex, shadowMapOccluders);
  Camera shadowCam = getShadowCam(shadowMapIndex);
  //saving light view projection matrix for this split            
  lightViewProjectionsMatrices[shadowMapIndex].set(shadowCam.getViewProjectionMatrix());
  renderManager.setCamera(shadowCam, false);
  renderManager.getRenderer().setFrameBuffer(shadowFB[shadowMapIndex]);
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedRenderState(forcedRenderState);
  // render shadow casters to shadow map
  viewPort.getQueue().renderShadowQueue(shadowMapOccluders, renderManager, shadowCam, true);
  renderManager.setForcedRenderState(null);
}
boolean debugfrustums = false;

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void postQueue(RenderQueue rq) {
  //we need special treatement for the sky because it must not be clipped
  rm.getRenderer().setFrameBuffer(reflectionBuffer);
  reflectionCam.setProjectionMatrix(null);
  rm.setCamera(reflectionCam, false);
  rm.getRenderer().clearBuffers(true, true, true);
  //Rendering the sky whithout clipping
  rm.getRenderer().setDepthRange(1, 1);
  vp.getQueue().renderQueue(RenderQueue.Bucket.Sky, rm, reflectionCam, true);
  rm.getRenderer().setDepthRange(0, 1);
  //setting the clip plane to the cam
  reflectionCam.setClipPlane(reflectionClipPlane, Plane.Side.Positive);//,1
  rm.setCamera(reflectionCam, false);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

renderManager.getRenderer().clearBuffers(true, true, true);
if( renderManager.getRenderer().getCaps().contains(Caps.GLSL150) ) {
  renderManager.setForcedTechnique("PreNormalPass15");

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

renderer.setBackgroundColor(vp.getBackgroundColor());
renderer.clearBuffers(vp.isClearColor(),
    vp.isClearDepth(),
    vp.isClearStencil());

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private void renderProcessing(Renderer r, FrameBuffer dst, Material mat){
  if (dst == null){
    fsQuad.setWidth(mainSceneFB.getWidth());
    fsQuad.setHeight(mainSceneFB.getHeight());
    fbCam.resize(mainSceneFB.getWidth(), mainSceneFB.getHeight(), true);
  }else{
    fsQuad.setWidth(dst.getWidth());
    fsQuad.setHeight(dst.getHeight());
    fbCam.resize(dst.getWidth(), dst.getHeight(), true);
  }
  fsQuad.setMaterial(mat);
  fsQuad.updateGeometricState();
  renderManager.setCamera(fbCam, true);
  r.setFrameBuffer(dst);
  r.clearBuffers(true, true, true);
  renderManager.renderGeometry(fsQuad);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

r.clearBuffers(true, true, true);
renderManager.renderGeometry(fsQuad);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

r.clearBuffers(true, true, true);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

r.clearBuffers(true, true, true);
viewPort.getQueue().renderShadowQueue(shadowOccluders, renderManager, shadowCam, true);
r.setFrameBuffer(viewPort.getOutputFrameBuffer());

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-effects

@Override
protected void postQueue(RenderQueue queue) {
  Renderer r = renderManager.getRenderer();
  r.setFrameBuffer(normalPass.getRenderFrameBuffer());
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedTechnique("PreNormalPass");
  renderManager.renderViewPortQueues(viewPort, false);
  renderManager.setForcedTechnique(null);
  renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
}

代码示例来源:origin: info.projectkyoto/mms-engine

@Override
protected void postQueue(RenderQueue queue) {
  Renderer r = renderManager.getRenderer();
  r.setFrameBuffer(normalPass.getRenderFrameBuffer());
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedTechnique("PreNormalPass");
  renderManager.renderViewPortQueues(viewPort, false);
  renderManager.setForcedTechnique(null);
  renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
}

代码示例来源:origin: org.jmonkeyengine/jme3-effects

@Override
protected void postQueue(RenderQueue queue) {
  Renderer r = renderManager.getRenderer();
  r.setFrameBuffer(normalPass.getRenderFrameBuffer());
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedTechnique("PreNormalPass");
  renderManager.renderViewPortQueues(viewPort, false);
  renderManager.setForcedTechnique(null);
  renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
}

代码示例来源:origin: org.jmonkeyengine/jme3-effects

@Override
protected void postQueue(RenderQueue queue) {
  if(!approximateNormals) {
    Renderer r = renderManager.getRenderer();
    r.setFrameBuffer(normalPass.getRenderFrameBuffer());
    renderManager.getRenderer().clearBuffers(true, true, true);
    renderManager.setForcedTechnique("PreNormalPass");
    renderManager.renderViewPortQueues(viewPort, false);
    renderManager.setForcedTechnique(null);
    renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
  }
}

代码示例来源:origin: info.projectkyoto/mms-engine

@Override
protected void postQueue(RenderQueue queue) {
  Renderer r = renderManager.getRenderer();
  r.setFrameBuffer(normalPass.getRenderFrameBuffer());
  renderManager.getRenderer().clearBuffers(true, true, true);
  renderManager.setForcedTechnique("PreNormalPass");
  renderManager.renderViewPortQueues(viewPort, false);
  renderManager.setForcedTechnique(null);
  renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-effects

@Override
protected void postQueue(RenderQueue queue) {
  if (glowMode != GlowMode.Scene) {           
    renderManager.getRenderer().setBackgroundColor(ColorRGBA.BlackNoAlpha);            
    renderManager.getRenderer().setFrameBuffer(preGlowPass.getRenderFrameBuffer());
    renderManager.getRenderer().clearBuffers(true, true, true);
    renderManager.setForcedTechnique("Glow");
    renderManager.renderViewPortQueues(viewPort, false);         
    renderManager.setForcedTechnique(null);
    renderManager.getRenderer().setFrameBuffer(viewPort.getOutputFrameBuffer());
  }
}

相关文章