com.badlogic.gdx.graphics.glutils.FrameBuffer.getColorBufferTexture()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(137)

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

FrameBuffer.getColorBufferTexture介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public TextureDescriptor getDepthMap () {
  textureDesc.texture = fbo.getColorBufferTexture();
  return textureDesc;
}

代码示例来源:origin: libgdx/libgdx

@Override
public TextureDescriptor getDepthMap () {
  textureDesc.texture = fbo.getColorBufferTexture();
  return textureDesc;
}

代码示例来源:origin: libgdx/libgdx

public Texture getTexture (int n) {
  if (n >= getPassQuantity()) throw new GdxRuntimeException("Can't get texture " + n);
  return frameBuffers[n].getColorBufferTexture();
}

代码示例来源:origin: libgdx/libgdx

/** Set viewport according to allocator.
 * @param lp LightProperties to process.
 * @param cameraViewport Set camera viewport if true. */
protected void processViewport (LightProperties lp, boolean cameraViewport) {
  Camera camera = lp.camera;
  ShadowMapRegion r = allocator.nextResult(currentLight);
  if (r == null) return;
  TextureRegion region = lp.region;
  region.setTexture(frameBuffers[currentPass].getColorBufferTexture());
  
  // We don't use HdpiUtils
  // gl commands related to shadow map size and not to screen size
  Gdx.gl.glViewport(r.x, r.y, r.width, r.height);
  Gdx.gl.glScissor(r.x + 1, r.y + 1, r.width - 2, r.height - 2);
  region.setRegion(r.x, r.y, r.width, r.height);
  if (cameraViewport) {
    camera.viewportHeight = r.height;
    camera.viewportWidth = r.width;
    camera.update();
  }
}

代码示例来源:origin: stackoverflow.com

m_fboRegion = new TextureRegion(m_fbo.getColorBufferTexture());
m_fboRegion.flip(false, true);

代码示例来源:origin: libgdx/libgdx

spriteBatch.draw(frameBuffer.getColorBufferTexture(), 0, 0, 256, 256, 0, 0, frameBuffer.getColorBufferTexture().getWidth(),
  frameBuffer.getColorBufferTexture().getHeight(), false, true);
spriteBatch.draw(stencilFrameBuffer.getColorBufferTexture(), 256, 256, 256, 256, 0, 0, frameBuffer.getColorBufferTexture()
  .getWidth(), frameBuffer.getColorBufferTexture().getHeight(), false, true);
spriteBatch.end();

代码示例来源:origin: libgdx/libgdx

public void create () {
  ShaderProgram.pedantic = false;
  /*
   * shader = new ShaderProgram(Gdx.files.internal("data/shaders/default.vert").readString(), Gdx.files.internal(
   * "data/shaders/depthtocolor.frag").readString()); if (!shader.isCompiled()) { Gdx.app.log("EdgeDetectionTest",
   * "couldn't compile scene shader: " + shader.getLog()); }
   */
  batchShader = new ShaderProgram(Gdx.files.internal("data/shaders/batch.vert").readString(), Gdx.files.internal(
    "data/shaders/convolution.frag").readString());
  if (!batchShader.isCompiled()) {
    Gdx.app.log("EdgeDetectionTest", "couldn't compile post-processing shader: " + batchShader.getLog());
  }
  ObjLoader objLoader = new ObjLoader();
  scene = objLoader.loadModel(Gdx.files.internal("data/scene.obj"));
  sceneInstance = new ModelInstance(scene);
  modelBatch = new ModelBatch();
  fbo = new FrameBuffer(Format.RGB565, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
  cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  cam.position.set(0, 0, 10);
  cam.lookAt(0, 0, 0);
  cam.far = 30;
  batch = new SpriteBatch();
  batch.setShader(batchShader);
  fboRegion = new TextureRegion(fbo.getColorBufferTexture());
  fboRegion.flip(false, true);
  logger = new FPSLogger();
  calculateOffsets();
}

代码示例来源:origin: libgdx/libgdx

public void render () {
  Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
  Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
  fb.begin();
  fbshader.begin();
  fbshader.setUniformf("u_viewport", fb.getWidth(), fb.getHeight());
  fbshader.setUniformf("u_color", 0.0f, 1.0f, 0.0f);
  quad.render(fbshader, GL20.GL_TRIANGLES);
  fbshader.end();
  fb.end();
  ffb.begin();
  fbshader.begin();
  fbshader.setUniformf("u_viewport", ffb.getWidth(), ffb.getHeight());
  fbshader.setUniformf("u_color", 1.0f, 0.0f, 0.0f);
  quad.render(fbshader, GL20.GL_TRIANGLES);
  fbshader.end();
  ffb.end();
  shader.begin();
  fb.getColorBufferTexture().bind(0);
  ffb.getColorBufferTexture().bind(1);
  shader.setUniformMatrix("u_worldView", screenCamera.combined);
  shader.setUniformi("u_fbtex", 0);
  shader.setUniformi("u_ffbtex", 1);
  screenQuad.render(shader, GL20.GL_TRIANGLES);
  shader.end();
}

代码示例来源:origin: libgdx/box2dlights

/**
 * Expert functionality
 * 
 * @return Texture that contain lightmap texture that can be used as light
 *         texture in your shaders
 */
public Texture getLightMapTexture() {
  return lightMap.frameBuffer.getColorBufferTexture();
}

代码示例来源:origin: com.badlogicgames.box2dlights/box2dlights

/**
 * Expert functionality
 * 
 * @return Texture that contain lightmap texture that can be used as light
 *         texture in your shaders
 */
public Texture getLightMapTexture() {
  return lightMap.frameBuffer.getColorBufferTexture();
}

代码示例来源:origin: manuelbua/libgdx-contribs

/** When needed graphics memory could be invalidated so buffers should be rebuilt. */
public void rebind () {
  texture1 = buffer1.getColorBufferTexture();
  texture2 = buffer2.getColorBufferTexture();
}

代码示例来源:origin: dingjibang/GDX-RPG

public Combine setInput (FrameBuffer buffer1, FrameBuffer buffer2) {
  this.inputTexture = buffer1.getColorBufferTexture();
  this.inputTexture2 = buffer2.getColorBufferTexture();
  return this;
}

代码示例来源:origin: manuelbua/uracer-kotd

public Combine setInput (FrameBuffer buffer1, FrameBuffer buffer2) {
  this.inputTexture = buffer1.getColorBufferTexture();
  this.inputTexture2 = buffer2.getColorBufferTexture();
  return this;
}

代码示例来源:origin: manuelbua/uracer-kotd

/** When needed graphics memory could be invalidated so buffers should be rebuilt. */
public void rebind () {
  texture1 = buffer1.getColorBufferTexture();
  texture2 = buffer2.getColorBufferTexture();
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

@Override
public TextureDescriptor getDepthMap () {
  textureDesc.texture = fbo.getColorBufferTexture();
  return textureDesc;
}

代码示例来源:origin: manuelbua/libgdx-contribs

public T setInput (FrameBuffer input) {
  return setInput(input.getColorBufferTexture());
}

代码示例来源:origin: manuelbua/uracer-kotd

@Override
public void render () {
  from.getColorBufferTexture().bind(0);
  to.getColorBufferTexture().bind(1);
  fade.begin();
  fade.setUniformf("Ratio", factor);
  quad.render(fade);
  fade.end();
}

代码示例来源:origin: manuelbua/uracer-kotd

@Override
public void render () {
  from.getColorBufferTexture().bind(0);
  to.getColorBufferTexture().bind(1);
  fade.begin();
  fade.setUniformf("Ratio", factor);
  quad.render(fade);
  fade.end();
}

代码示例来源:origin: langurmonkey/gaiasky

@Override
public void draw(Batch batch, float parentAlpha) {
  super.draw(batch, parentAlpha);
  if (fb != null) {
    batch.draw(fb.getColorBufferTexture(), getX(), getY(), width, height);
  }
}

代码示例来源:origin: LonamiWebs/Klooni1010

@Override
public void resize(int width, int height) {
  this.width = width;
  this.height = height;
  if (frameBuffer != null)
    frameBuffer.dispose();
  frameBuffer = new FrameBuffer(Pixmap.Format.RGB565, width, height, false);
  bufferTexture = new TextureRegion(frameBuffer.getColorBufferTexture());
  bufferTexture.flip(false, true);
}

相关文章