Search in sources :

Example 1 with RenderTarget

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;
}
Also used : RenderTarget(org.rajawali3d.renderer.RenderTarget)

Example 2 with RenderTarget

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);
}
Also used : ShadowPass(org.rajawali3d.postprocessing.passes.ShadowPass) RenderTarget(org.rajawali3d.renderer.RenderTarget)

Example 3 with RenderTarget

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);
}
Also used : Material(org.rajawali3d.materials.Material) RenderTarget(org.rajawali3d.renderer.RenderTarget)

Example 4 with RenderTarget

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);
    }
}
Also used : TextureException(org.rajawali3d.materials.textures.ATexture.TextureException) ScreenQuad(org.rajawali3d.primitives.ScreenQuad) Material(org.rajawali3d.materials.Material) RenderTarget(org.rajawali3d.renderer.RenderTarget)

Aggregations

RenderTarget (org.rajawali3d.renderer.RenderTarget)4 Material (org.rajawali3d.materials.Material)2 TextureException (org.rajawali3d.materials.textures.ATexture.TextureException)1 ShadowPass (org.rajawali3d.postprocessing.passes.ShadowPass)1 ScreenQuad (org.rajawali3d.primitives.ScreenQuad)1