當前位置: 首頁>>代碼示例>>Java>>正文


Java PostProcessor類代碼示例

本文整理匯總了Java中com.bitfire.postprocessing.PostProcessor的典型用法代碼示例。如果您正苦於以下問題:Java PostProcessor類的具體用法?Java PostProcessor怎麽用?Java PostProcessor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PostProcessor類屬於com.bitfire.postprocessing包,在下文中一共展示了PostProcessor類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CrtMonitor

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
public CrtMonitor (int fboWidth, int fboHeight, boolean barrelDistortion, boolean performBlur, RgbMode mode, int effectsSupport) {
	doblur = performBlur;

	if (doblur) {
		pingPongBuffer = PostProcessor.newPingPongBuffer(fboWidth, fboHeight, PostProcessor.getFramebufferFormat(), false, false);
		blur = new Blur(fboWidth, fboHeight);
		blur.setPasses(1);
		blur.setAmount(1f);
		// blur.setType( BlurType.Gaussian3x3b ); // high defocus
		blur.setType(BlurType.Gaussian3x3); // modern machines defocus
	} else {
		buffer = new FrameBuffer(PostProcessor.getFramebufferFormat(), fboWidth, fboHeight, false);
	}

	combine = new Combine();
	crt = new CrtScreen(barrelDistortion, mode, effectsSupport);
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:18,代碼來源:CrtMonitor.java

示例2: rebuildProcessor

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
public PostProcessor rebuildProcessor() {
	float screenw = Gdx.graphics.getWidth();
	float screenh = Gdx.graphics.getHeight();

	PostProcessor processor = new PostProcessor(false, true, true);
	Bloom.Settings settings = new Bloom.Settings(
			"blah",
			2,
			Config.get().bloomtreshold,
			Config.get().baseintensity,
			Config.get().basesaturation,
			Config.get().bloomintensity,
			Config.get().bloomsaturation);
	Bloom bloomEffect = new Bloom((int)(screenw/8), (int)(screenh/8));
	bloomEffect.setSettings(settings);
	if (Config.get().bloom) processor.addEffect(bloomEffect);
	processor.setClearColor(0.5f, 0.5f, 0.5f, 0f);

	bloom = Config.get().bloom;

	return processor;
}
 
開發者ID:matheus23,項目名稱:RuinsOfRevenge,代碼行數:23,代碼來源:ScreenGameMap.java

示例3: CrtMonitor

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
public CrtMonitor( boolean barrelDistortion, boolean performBlur ) {
	// the effect is designed to work on the whole screen area, no small/mid size tricks!
	int w = Gdx.graphics.getWidth();
	int h = Gdx.graphics.getHeight();
	doblur = performBlur;

	if( doblur ) {
		pingPongBuffer = PostProcessor.newPingPongBuffer( w, h, PostProcessor.getFramebufferFormat(), false );
		blur = new Blur( w, h );
		blur.setPasses( 1 );
		blur.setAmount( 1f );
		// blur.setType( BlurType.Gaussian3x3b ); // high defocus
		blur.setType( BlurType.Gaussian3x3 ); // modern machines defocus
	} else {
		buffer = new FrameBuffer( PostProcessor.getFramebufferFormat(), w, h, false );
	}

	combine = new Combine();
	combine.setSource1Intensity( barrelDistortion ? 0f : 0.15f );
	combine.setSource2Intensity( barrelDistortion ? 1.2f : 1.1f );
	combine.setSource1Saturation( 1f );
	combine.setSource2Saturation( 0.8f );

	crt = new CrtScreen( barrelDistortion );
}
 
開發者ID:matheus23,項目名稱:RuinsOfRevenge,代碼行數:26,代碼來源:CrtMonitor.java

示例4: DeferredGBuffer

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
/** Creates a new FrameBuffer having the given dimensions and potentially a depth and a stencil buffer attached.
 * 
 * @param format the format of the color buffer; according to the OpenGL ES 2.0 spec, only RGB565, RGBA4444 and RGB5_A1 are
 *           color-renderable
 * @param width the width of the framebuffer in pixels
 * @param height the height of the framebuffer in pixels
 * @param hasDepth whether to attach a depth buffer
 * @throws com.badlogic.gdx.utils.GdxRuntimeException in case the FrameBuffer could not be created */
public DeferredGBuffer (int width, int height, boolean hasDepth, boolean hasStencil, PostProcessor postProcessor) {
	this.width = width;
	this.height = height;
	this.hasDepth = hasDepth;
	this.hasStencil = hasStencil;
	this.postProcessor = postProcessor;
	build();

	addManagedFrameBuffer(Gdx.app, this);
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:19,代碼來源:DeferredGBuffer.java

示例5: Bloom

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
public Bloom (int fboWidth, int fboHeight) {
	pingPongBuffer = PostProcessor.newPingPongBuffer(fboWidth, fboHeight, PostProcessor.getFramebufferFormat(), false, false);

	blur = new Blur(fboWidth, fboHeight);
	threshold = new Threshold();
	combine = new Combine();

	setSettings(new Settings("default", 2, 0.277f, 1f, .85f, 1.1f, .85f));
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:10,代碼來源:Bloom.java

示例6: render

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
@Override
public void render (final FrameBuffer src, final FrameBuffer dest) {
	Texture texsrc = src.getColorBufferTexture();

	boolean blendingWasEnabled = PostProcessor.isStateEnabled(GL20.GL_BLEND);
	Gdx.gl.glDisable(GL20.GL_BLEND);

	pingPongBuffer.begin();
	{
		// threshold / high-pass filter
		// only areas with pixels >= threshold are blit to smaller fbo
		threshold.setInput(texsrc).setOutput(pingPongBuffer.getSourceBuffer()).render();

		// blur pass
		blur.render(pingPongBuffer);
	}
	pingPongBuffer.end();

	if (blending || blendingWasEnabled) {
		Gdx.gl.glEnable(GL20.GL_BLEND);
	}

	if (blending) {
		// TODO support for Gdx.gl.glBlendFuncSeparate(sfactor, dfactor, GL20.GL_ONE, GL20.GL_ONE );
		Gdx.gl.glBlendFunc(sfactor, dfactor);
	}

	restoreViewport(dest);

	// mix original scene and blurred threshold, modulate via
	// set(Base|Bloom)(Saturation|Intensity)
	combine.setOutput(dest).setInput(texsrc, pingPongBuffer.getResultTexture()).render();
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:34,代碼來源:Bloom.java

示例7: Bloom

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
public Bloom( int fboWidth, int fboHeight ) {
	pingPongBuffer = PostProcessor.newPingPongBuffer( fboWidth, fboHeight, PostProcessor.getFramebufferFormat(), false );

	blur = new Blur( fboWidth, fboHeight );
	threshold = new Threshold();
	combine = new Combine();

	setSettings( new Settings( "default", 2, 0.277f, 1f, .85f, 1.1f, .85f ) );
}
 
開發者ID:matheus23,項目名稱:RuinsOfRevenge,代碼行數:10,代碼來源:Bloom.java

示例8: render

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
@Override
public void render( final FrameBuffer src, final FrameBuffer dest ) {
	Texture texsrc = src.getColorBufferTexture();

	boolean blendingWasEnabled = PostProcessor.isStateEnabled( GL20.GL_BLEND );
	Gdx.gl.glDisable( GL20.GL_BLEND );

	pingPongBuffer.begin();
	{
		// threshold / high-pass filter
		// only areas with pixels >= threshold are blit to smaller fbo
		threshold.setInput( texsrc ).setOutput( pingPongBuffer.getSourceBuffer() ).render();

		// blur pass
		blur.render( pingPongBuffer );
	}
	pingPongBuffer.end();

	if( blending || blendingWasEnabled ) {
		Gdx.gl.glEnable( GL20.GL_BLEND );
	}

	if( blending ) {
		Gdx.gl.glBlendFunc( sfactor, dfactor );
	}

	// mix original scene and blurred threshold, modulate via
	// set(Base|Bloom)(Saturation|Intensity)
	combine.setOutput( dest ).setInput( texsrc, pingPongBuffer.getResultTexture() ).render();
}
 
開發者ID:matheus23,項目名稱:RuinsOfRevenge,代碼行數:31,代碼來源:Bloom.java

示例9: render

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
@Override
public void render (FrameBuffer src, FrameBuffer dest) {
	// the original scene
	Texture in = src.getColorBufferTexture();

	boolean blendingWasEnabled = PostProcessor.isStateEnabled(GL20.GL_BLEND);
	Gdx.gl.glDisable(GL20.GL_BLEND);

	Texture out = null;

	if (doblur) {

		pingPongBuffer.begin();
		{
			// crt pass
			crt.setInput(in).setOutput(pingPongBuffer.getSourceBuffer()).render();

			// blur pass
			blur.render(pingPongBuffer);
		}
		pingPongBuffer.end();

		out = pingPongBuffer.getResultTexture();
	} else {
		// crt pass
		crt.setInput(in).setOutput(buffer).render();

		out = buffer.getColorBufferTexture();
	}

	if (blending || blendingWasEnabled) {
		Gdx.gl.glEnable(GL20.GL_BLEND);
	}

	if (blending) {
		Gdx.gl.glBlendFunc(sfactor, dfactor);
	}

	restoreViewport(dest);

	// do combine pass
	combine.setOutput(dest).setInput(in, out).render();
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:44,代碼來源:CrtMonitor.java

示例10: newPostProcessor

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
private PostProcessBean newPostProcessor(int width, int height) {
    PostProcessBean ppb = new PostProcessBean();

    ppb.pp = new PostProcessor(width, height, true, false, true);
    return ppb;
}
 
開發者ID:langurmonkey,項目名稱:gaiasky,代碼行數:7,代碼來源:WebGLPostProcessor.java

示例11: changed

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
private boolean changed(PostProcessor postProcess, int width, int height) {
    return postProcess.getCombinedBuffer().width != width || postProcess.getCombinedBuffer().height != height;
}
 
開發者ID:langurmonkey,項目名稱:gaiasky,代碼行數:4,代碼來源:WebGLPostProcessor.java

示例12: changed

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
private boolean changed(PostProcessor postProcess, int width, int height) {
    return (postProcess.getCombinedBuffer().width != width || postProcess.getCombinedBuffer().height != height);
}
 
開發者ID:langurmonkey,項目名稱:gaiasky,代碼行數:4,代碼來源:DesktopPostProcessor.java

示例13: render

import com.bitfire.postprocessing.PostProcessor; //導入依賴的package包/類
@Override
public void render( FrameBuffer src, FrameBuffer dest ) {
	// the original scene
	Texture in = src.getColorBufferTexture();

	boolean blendingWasEnabled = PostProcessor.isStateEnabled( GL20.GL_BLEND );
	Gdx.gl.glDisable( GL10.GL_BLEND );

	Texture out = null;

	if( doblur ) {

		pingPongBuffer.begin();
		{
			// crt pass
			crt.setInput( in ).setOutput( pingPongBuffer.getSourceBuffer() ).render();

			// blur pass
			blur.render( pingPongBuffer );
		}
		pingPongBuffer.end();

		out = pingPongBuffer.getResultTexture();
	} else {
		// crt pass
		crt.setInput( in ).setOutput( buffer ).render();

		out = buffer.getColorBufferTexture();
	}

	if( blending || blendingWasEnabled ) {
		Gdx.gl.glEnable( GL20.GL_BLEND );
	}

	if( blending ) {
		Gdx.gl.glBlendFunc( sfactor, dfactor );
	}

	// do combine pass
	combine.setOutput( dest ).setInput( in, out ).render();
}
 
開發者ID:matheus23,項目名稱:RuinsOfRevenge,代碼行數:42,代碼來源:CrtMonitor.java


注:本文中的com.bitfire.postprocessing.PostProcessor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。