当前位置: 首页>>代码示例>>Java>>正文


Java FrameBuffer.end方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.glutils.FrameBuffer.end方法的典型用法代码示例。如果您正苦于以下问题:Java FrameBuffer.end方法的具体用法?Java FrameBuffer.end怎么用?Java FrameBuffer.end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.glutils.FrameBuffer的用法示例。


在下文中一共展示了FrameBuffer.end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
@Override
protected void initialize() {
    batch = new SpriteBatch(4000);
    new ShapeRenderer();

    planetPixel = new TextureRegion(new Texture("planetcell.png"), 1, 1);

    dirtyMask = new int[SIMULATION_WIDTH * SIMULATION_HEIGHT];

    frameBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, SIMULATION_WIDTH, SIMULATION_HEIGHT, false);
    frameBuffer.getColorBufferTexture().setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
    frameBuffer.begin();
    Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    frameBuffer.end();

    vboCamera = new OrthographicCamera(SIMULATION_WIDTH, SIMULATION_HEIGHT);
    vboCamera.setToOrtho(true, SIMULATION_WIDTH, SIMULATION_HEIGHT);
    vboCamera.update();
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:21,代码来源:PlanetRenderSystem.java

示例2: setLightSource

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public AbsStdLight setLightSource(EscapyLightType light) {

		this.updState();
		this.lightSource = light;
		this.interCam = new EscapyGdxCamera((int) this.lightSource.getWidth(), (int) this.lightSource.getHeight());
		this.fbo = new StandartFBO(id, (int) this.lightSource.getWidth(), (int) this.lightSource.getHeight(), "<AbsLightTexture_FBUFFER>");
		FrameBuffer tmpBuff = new FrameBuffer(Pixmap.Format.RGBA8888, (int) this.lightSource.getWidth(),(int) this.lightSource.getHeight(), false);
		tmpBuff.begin();
		Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		tmpBuff.end();
		FrameBuffer bgBuff = new FrameBuffer(Pixmap.Format.RGBA8888, (int) this.lightSource.getWidth(),(int) this.lightSource.getHeight(), false);
		bgBuff.begin();
		Gdx.gl.glClearColor(0f, 0f, 0f, 0f);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		bgBuff.end();

		this.lightSprite = new Sprite(tmpBuff.getColorBufferTexture());
		this.bgSprite = new Sprite(bgBuff.getColorBufferTexture());

		System.out.println(lightSource.setName(Integer.toString(getID())));
		return this;
	}
 
开发者ID:henryco,项目名称:Escapy,代码行数:24,代码来源:AbsStdLight.java

示例3: renderBRDF

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
private Texture renderBRDF() {
    ShaderProgram brdfShader = new ShaderProgram(
            Gdx.files.internal("shaders/brdf_shader.vert"),
            Gdx.files.internal("shaders/brdf_shader.frag"));

    FrameBuffer frameBuffer = FrameBuffer.createFrameBuffer(Pixmap.Format.RGB888, (int) brdfWidth, (int) brdfHeight, true);

    brdfShader.begin();
    frameBuffer.begin();
    Gdx.gl.glViewport(0, 0, (int) brdfWidth, (int) brdfHeight);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
    quadMesh.render(brdfShader, GL20.GL_TRIANGLES);
    frameBuffer.end();
    brdfShader.end();
    brdfShader.dispose();

    return frameBuffer.getColorBufferTexture();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:19,代码来源:LightProbe.java

示例4: applyPasses

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public FrameBuffer applyPasses (SpriteBatch batch, FrameBuffer inputBuffer, FrameBuffer outputBuffer) {
	batch.begin();
	batch.setProjectionMatrix(matrix);
	FrameBuffer iBuffer = inputBuffer;
	FrameBuffer oBuffer = outputBuffer;
	for (int i = 0; i < passes.size; i++) {
		oBuffer.begin();
		Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.setShader(RavTech.sceneHandler.shaderManager.get(passes.get(i)));
		batch.draw(iBuffer.getColorBufferTexture(), 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
		batch.setShader(RavTech.sceneHandler.shaderManager.get("default"));
		oBuffer.end();
		FrameBuffer tempBuffer = oBuffer;
		oBuffer = iBuffer;
		iBuffer = tempBuffer;
	}
	batch.end();
	return oBuffer;
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:21,代码来源:PostProcessingEffect.java

示例5: render

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public void render(Batch batch, float delta, FrameBuffer buffer) {
   if (isEnabled()) {
      if (shaderManager.hasEffects()) {
         shaderManager.begin();
         this.batch.setProjectionMatrix(camera.combined);
         this.batch.begin();
         this.batch.draw(buffer.getColorBufferTexture(), 0f, 0f);
         this.batch.end();
         layer.render(batch, delta);
         shaderManager.end(buffer);
      } else {
         buffer.begin();
         layer.render(batch, delta);
         buffer.end();
      }
   }
}
 
开发者ID:bitbrain,项目名称:braingdx,代码行数:18,代码来源:CombinedRenderPipe.java

示例6: renderDecalsForBufferAndBatch

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public void renderDecalsForBufferAndBatch(FrameBuffer buffer, DecalBatch batch) {
  buffer.begin();
    renderContext.begin();
    renderContext.end();
    renderContext.begin();

      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glViewport(0, 0, buffer.getWidth(), buffer.getHeight());
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT  | GL20.GL_DEPTH_BUFFER_BIT);

      for (Entity entity : entities) {
        if (EntityDecalRenderable.class.isInstance(entity)) {
          EntityDecalRenderable en = (EntityDecalRenderable)entity;
          en.renderBatch(batch, environment);
        }
      }

      batch.flush();
    renderContext.end();
  buffer.end();
}
 
开发者ID:macbury,项目名称:BotLogic,代码行数:22,代码来源:GameLevelScreen.java

示例7: twoPassBlur

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
/**
 * gaussian blur on the entire screen
 * 
 * @param batch
 * @param buffer
 * @param blurshader
 * @param radius
 *            amount in pixels to blur
 */
public static void twoPassBlur(Batch batch, FrameBuffer buffer, ShaderProgram blurshader,
		float radius, float x, float y, float drawWidth, float drawHeight, int u, int v,
		int width, int height) {
	buffer.begin();
	batch.setShader(blurshader);
	blurshader.setUniformf("radius", (float) radius);
	blurshader.setUniformf("dir", 1f, 0f);
	batch.draw(buffer.getColorBufferTexture(), x, y, drawWidth, drawHeight, u, v, width,
			height, false, true);
	batch.flush();
	buffer.end();

	buffer.begin();
	blurshader.setUniformf("dir", 0f, 1f);
	batch.draw(buffer.getColorBufferTexture(), x, y, drawWidth, drawHeight, u, v, width,
			height, false, true);
	batch.setShader(null);
	buffer.end();

	batch.draw(buffer.getColorBufferTexture(), 0, Gdx.graphics.getHeight(), buffer.getWidth(),
			-buffer.getHeight());
	batch.flush();
}
 
开发者ID:chrislo27,项目名称:Stray-core,代码行数:33,代码来源:PostProcessing.java

示例8: drawActor

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
private FrameBuffer drawActor(Actor actor) {
	root.addActor(actor);

	int width = (int) (Gdx.graphics.getHeight() - Gdx.graphics.getDensity() * 56);
	int height = (int) (Gdx.graphics.getHeight() / 2.15f);

	FrameBuffer frameBuffer = new FrameBuffer(Format.RGB888, width, height,
			false);
	frameBuffer.begin();

	Gdx.gl.glClearColor(1f, 1f, 1f, 1f);
	Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
	batch.begin();
	root.draw(batch, 1.0f);
	batch.end();
	frameBuffer.end();
	batch.setColor(Color.WHITE);
	return frameBuffer;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:20,代码来源:CreateSceneThumbnail.java

示例9: drawToBuffer

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
/**
 * Draws the given gradient {@link Texture} to the given {@link FrameBuffer}, using the given {@link Color} with the given percent.
 * <p>
 * This is achieved via a gradient shader.
 *
 * @param buffer     the {@link FrameBuffer} to be drawn to
 * @param color      the {@link Color} which should be drawn
 * @param gradient   the gradient texture which should be drawn
 * @param perc       the percent the gradient texture should be drawn
 * @param projection projection matrix for pixel perfect rendering
 */
private void drawToBuffer(FrameBuffer buffer, Color color, TextureRegion gradient, float perc, Matrix4 projection) {
    buffer.begin();
    AL.graphics.getGL20().glClearColor(0, 0, 0, 0);
    AL.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT);

    shaderBatch.setProjectionMatrix(projection);
    shaderBatch.begin();
    shaderBatch.setColor(color);
    shader.setUniformf("u_gradient", perc);
    shaderBatch.draw(gradient, -buffer.getWidth() / 2, -buffer.getHeight() / 2);
    shaderBatch.end();
    buffer.end();
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:25,代码来源:PlayerHelper.java

示例10: drawToBuffer

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
/**
 * Draws the given gradient {@link Texture} to the given {@link FrameBuffer}, using the given {@link Color} with the given percent.
 * <p>
 * This is achieved via a gradient shader.
 *
 * @param buffer      the {@link FrameBuffer} to be drawn to
 * @param color       the {@link Color} which should be drawn
 * @param gradient    the gradient texture which should be drawn
 * @param perc        the percent the gradient texture should be drawn
 * @param shaderBatch the {@link SpriteBatch} to use
 * @param shader      the {@link ShaderProgram} to use
 * @param projection  projection matrix for pixel perfect rendering
 */
private static void drawToBuffer(FrameBuffer buffer, Color color, Texture gradient, float perc, SpriteBatch shaderBatch, ShaderProgram shader, Matrix4 projection) {
    buffer.begin();
    AL.graphics.getGL20().glClearColor(0, 0, 0, 0);
    AL.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT);

    shaderBatch.setProjectionMatrix(projection);
    shaderBatch.begin();
    shaderBatch.setColor(color);
    shader.setUniformf("u_gradient", perc);
    shaderBatch.draw(gradient, -buffer.getWidth() / 2, -buffer.getHeight() / 2);
    shaderBatch.end();
    buffer.end();
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:27,代码来源:CharacterRenderer.java

示例11: getMapScreenShot

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public Pixmap getMapScreenShot()
{

    float oldCameraZoom = getCamera().zoom;
    float oldCameraX = getCamera().position.x;
    float oldCameraY = getCamera().position.y;

    MapUtils.adjustCamera(getCamera(), grid);

    final FrameBuffer fbo = new FrameBuffer(Pixmap.Format.RGBA8888, WIDTH, HEIGHT, false);

    fbo.begin();
    batch.setProjectionMatrix(getCamera().combined);
    batch.begin();

    for(int i = 0; i < grid.getHexs().length; i++)
    {
        drawHexagon(grid.getHexs()[i], batch);
    }

    batch.end();
    Pixmap pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, WIDTH, HEIGHT);
    fbo.end();

    //fbo.dispose();

    getCamera().zoom = oldCameraZoom;
    getCamera().position.x = oldCameraX;
    getCamera().position.y = oldCameraY;

    return pixmap;
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:33,代码来源:PlayScreen.java

示例12: render

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
@Override
public void render(Texture source, FrameBuffer destination) {
	if (destination == null) {
		actualRender(source);
	} else {
		destination.begin();
		actualRender(source);
		destination.end();
	}
}
 
开发者ID:spookygames,项目名称:gdx-gfx,代码行数:11,代码来源:ShaderEffect.java

示例13: initMaskTexture

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
public LightMask initMaskTexture() {

		FrameBuffer tmp = new FrameBuffer(Pixmap.Format.RGBA8888, width, height, false);
		tmp.begin();
		Gdx.gl.glClearColor(this.color.r, this.color.g, this.color.b, 1f);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		tmp.end();
		maskTexture = tmp.getColorBufferTexture();
		return this;
	}
 
开发者ID:henryco,项目名称:Escapy,代码行数:11,代码来源:LightMask.java

示例14: renderOutBuffer

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
/**Render data from contained {@link FrameBuffer} into target buffer,
 * <br>this method uses for this {@link FBORenderProgram}.
 * @param buffer - target {@link FrameBuffer} to render for.
 * @param ePP - optional {@link EscapyPostProcessed} data for render.
 * @param cam - {@link EscapyGdxCamera} cannot be null.
 * @return buffer - {@link FrameBuffer} with rendered data.
 * @see {@link FBORenderProgram#renderProgram(EscapyGdxCamera, EscapyPostProcessed)} */
public FrameBuffer renderOutBuffer(FrameBuffer buffer, EscapyPostProcessed ePP, 
		EscapyGdxCamera cam) {	
	buffer.begin();
		this.renderProgram.renderProgram(cam, ePP);
	buffer.end();
	return buffer;
}
 
开发者ID:henryco,项目名称:Escapy,代码行数:15,代码来源:EscapyFBO.java

示例15: endFrameBuffer

import com.badlogic.gdx.graphics.glutils.FrameBuffer; //导入方法依赖的package包/类
/**
 * Stops rendering to the current FrameBuffer
 */
public void endFrameBuffer() {
    if (activeFrameBuffers.empty()) {
        throw new GdxRuntimeException("There is no active frame buffer that can be ended");
    }
    final FrameBuffer frameBuffer = activeFrameBuffers.pop();
    frameBuffer.end();
}
 
开发者ID:molp,项目名称:libgdx-shaders,代码行数:11,代码来源:ShaderManager.java


注:本文中的com.badlogic.gdx.graphics.glutils.FrameBuffer.end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。