use of org.rajawali3d.renderer.RenderTarget in project Rajawali by Rajawali.
the class PostProcessingManager method swapBuffers.
/**
* Swaps read and write buffers.
*/
public void swapBuffers() {
RenderTarget tmp = mReadBuffer;
mReadBuffer = mWriteBuffer;
mWriteBuffer = tmp;
}
use of org.rajawali3d.renderer.RenderTarget in project Rajawali by Rajawali.
the class ShadowEffect method initialize.
@Override
public void initialize(Renderer renderer) {
mShadowRenderTarget = new RenderTarget("shadowRT" + hashCode(), mShadowMapSize, mShadowMapSize, 0, 0, false, false, GLES20.GL_TEXTURE_2D, Config.ARGB_8888, FilterType.LINEAR, WrapType.CLAMP);
renderer.addRenderTarget(mShadowRenderTarget);
ShadowPass pass1 = new ShadowPass(ShadowPassType.CREATE_SHADOW_MAP, mScene, mCamera, mLight, mShadowRenderTarget);
addPass(pass1);
ShadowPass pass2 = new ShadowPass(ShadowPassType.APPLY_SHADOW_MAP, mScene, mCamera, mLight, mShadowRenderTarget);
mShadowMapMaterial = pass1.getShadowMapMaterial();
mShadowMapMaterial.setShadowInfluence(mShadowInfluence);
pass2.setShadowMapMaterial(pass1.getShadowMapMaterial());
addPass(pass2);
}
use of org.rajawali3d.renderer.RenderTarget in project Rajawali by Rajawali.
the class ObjectColorPicker method initialize.
public void initialize() {
final int size = Math.max(mRenderer.getViewportWidth(), mRenderer.getViewportHeight());
mRenderTarget = new RenderTarget("colorPickerTarget", size, size, 0, 0, false, false, GLES20.GL_TEXTURE_2D, Config.ARGB_8888, FilterType.LINEAR, WrapType.CLAMP);
mRenderer.addRenderTarget(mRenderTarget);
mPickerMaterial = new Material();
MaterialManager.getInstance().addMaterial(mPickerMaterial);
}
use of org.rajawali3d.renderer.RenderTarget in project Rajawali by Rajawali.
the class VuforiaRenderer method onRenderSurfaceSizeChanged.
@Override
public void onRenderSurfaceSizeChanged(GL10 gl, int width, int height) {
RajLog.i("onRenderSurfaceSizeChanged " + width + ", " + height);
super.onRenderSurfaceSizeChanged(gl, width, height);
updateRendering(width, height);
QCAR.onSurfaceChanged(width, height);
getCurrentCamera().setProjectionMatrix(getFOV(), getVideoWidth(), getVideoHeight());
if (mBackgroundRenderTarget == null) {
mBackgroundRenderTarget = new RenderTarget("rajVuforia", width, height);
addRenderTarget(mBackgroundRenderTarget);
Material material = new Material();
material.setColorInfluence(0);
try {
material.addTexture(mBackgroundRenderTarget.getTexture());
} catch (TextureException e) {
e.printStackTrace();
}
mBackgroundQuad = new ScreenQuad();
if (mVuforiaManager.getScreenOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
mBackgroundQuad.setScaleY((float) height / (float) getVideoHeight());
else
mBackgroundQuad.setScaleX((float) width / (float) getVideoWidth());
mBackgroundQuad.setMaterial(material);
getCurrentScene().addChildAt(mBackgroundQuad, 0);
}
}
Aggregations