Texture mBackgroundTexture;
FrameBuffer mMetaballFBO;
- Texture mMetaballFBOTexture;
Actor mMetaballRoot;
MetaballInfo mMetaballs[METABALL_NUMBER];
mScreenSize(),
mBackgroundTexture(),
mMetaballFBO(),
- mMetaballFBOTexture(),
mMetaballRoot(),
mMetaballs(),
mPositionIndex(),
// Create an FBO and a render task to create to render the metaballs with a fragment shader
Stage stage = Stage::GetCurrent();
- mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y, FrameBuffer::Attachment::NONE );
- mMetaballFBOTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
- Pixel::RGB888,
- mScreenSize.x, mScreenSize.y );
- mMetaballFBO.AttachColorTexture( mMetaballFBOTexture );
+ mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y );
stage.Add(mMetaballRoot);
// Create new texture set
auto textureSet = TextureSet::New();
textureSet.SetTexture( 0u, mBackgroundTexture );
- textureSet.SetTexture( 1u, mMetaballFBOTexture );
+ textureSet.SetTexture( 1u, mMetaballFBO.GetColorTexture() );
// Create geometry
Geometry metaballGeom = CreateGeometry( false );
Texture mBackgroundTexture;
FrameBuffer mMetaballFBO;
- Texture mMetaballFBOTexture;
Actor mMetaballRoot;
MetaballInfo mMetaballs[METABALL_NUMBER];
{
// Create an FBO and a render task to create to render the metaballs with a fragment shader
Stage stage = Stage::GetCurrent();
- mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y, FrameBuffer::Attachment::NONE );
- mMetaballFBOTexture = Texture::New( Dali::TextureType::TEXTURE_2D,
- Pixel::RGB888,
- mScreenSize.x, mScreenSize.y );
- mMetaballFBO.AttachColorTexture( mMetaballFBOTexture );
+ mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y );
stage.Add(mMetaballRoot);
// Create new texture set
mTextureSetRefraction = TextureSet::New();
mTextureSetRefraction.SetTexture( 0u, mBackgroundTexture );
- mTextureSetRefraction.SetTexture( 1u, mMetaballFBOTexture );
+ mTextureSetRefraction.SetTexture( 1u, mMetaballFBO.GetColorTexture() );
// Create normal shader
mShaderNormal = Shader::New( METABALL_VERTEX_SHADER, FRAG_SHADER );