FileDocCategorySizeDatePackage
RenderPass.javaAPI DocAndroid 5.1 API3771Thu Mar 12 22:22:44 GMT 2015com.android.scenegraph

RenderPass

public class RenderPass extends SceneGraphBase
hide

Fields Summary
TextureRenderTarget
mColorTarget
Float4
mClearColor
boolean
mShouldClearColor
TextureRenderTarget
mDepthTarget
float
mClearDepth
boolean
mShouldClearDepth
ArrayList
mObjectsToDraw
Camera
mCamera
ScriptField_RenderPass_s.Item
mRsField
Constructors Summary
public RenderPass()

        mObjectsToDraw = new ArrayList<RenderableBase>();
        mClearColor = new Float4(0.0f, 0.0f, 0.0f, 0.0f);
        mShouldClearColor = true;
        mClearDepth = 1.0f;
        mShouldClearDepth = true;
    
Methods Summary
public voidappendRenderable(Renderable d)

        mObjectsToDraw.add(d);
    
public java.util.ArrayListgetRenderables()

        return mObjectsToDraw;
    
ScriptField_RenderPass_s.ItemgetRsField(RenderScriptGL rs, android.content.res.Resources res)

        if (mRsField != null) {
            return mRsField;
        }

        mRsField = new ScriptField_RenderPass_s.Item();
        if (mColorTarget != null) {
            mRsField.color_target = mColorTarget.getRsData(true).get_texture(0);
        }
        if (mColorTarget != null) {
            mRsField.depth_target = mDepthTarget.getRsData(true).get_texture(0);
        }
        mRsField.camera = mCamera != null ? mCamera.getRSData().getAllocation() : null;

        if (mObjectsToDraw.size() != 0) {
            Allocation drawableData = Allocation.createSized(rs,
                                                              Element.ALLOCATION(rs),
                                                              mObjectsToDraw.size());
            Allocation[] drawableAllocs = new Allocation[mObjectsToDraw.size()];
            for (int i = 0; i < mObjectsToDraw.size(); i ++) {
                Renderable dI = (Renderable)mObjectsToDraw.get(i);
                drawableAllocs[i] = dI.getRsField(rs, res).getAllocation();
            }
            drawableData.copyFrom(drawableAllocs);
            mRsField.objects = drawableData;
        }

        mRsField.clear_color = mClearColor;
        mRsField.clear_depth = mClearDepth;
        mRsField.should_clear_color = mShouldClearColor;
        mRsField.should_clear_depth = mShouldClearDepth;
        return mRsField;
    
public voidsetCamera(Camera c)

        mCamera = c;
    
public voidsetClearColor(Float4 clearColor)

        mClearColor = clearColor;
    
public voidsetClearDepth(float clearDepth)

        mClearDepth = clearDepth;
    
public voidsetColorTarget(TextureRenderTarget colorTarget)

        mColorTarget = colorTarget;
    
public voidsetDepthTarget(TextureRenderTarget depthTarget)

        mDepthTarget = depthTarget;
    
public voidsetShouldClearColor(boolean shouldClearColor)

        mShouldClearColor = shouldClearColor;
    
public voidsetShouldClearDepth(boolean shouldClearDepth)

        mShouldClearDepth = shouldClearDepth;