/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <iomanip>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/images/texture-set-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
namespace Dali
{
void BloomView::OnInitialize()
{
// root actor to parent all user added actors, needed to allow us to set that subtree as exclusive for our child render task
- mChildrenRoot.SetParentOrigin( ParentOrigin::CENTER );
- mInternalRoot.SetParentOrigin( ParentOrigin::CENTER );
+ mChildrenRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mInternalRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
//////////////////////////////////////////////////////
// Create actors
// Create an image view for rendering from the scene texture to the bloom texture
- mBloomExtractImageView = Toolkit::ImageView::New();
- mBloomExtractImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mBloomExtractActor = Actor::New();
+ mBloomExtractActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Create an image view for compositing the result (scene and bloom textures) to output
- mCompositeImageView = Toolkit::ImageView::New();
- mCompositeImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mCompositeActor = Actor::New();
+ mCompositeActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Create an image view for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
- mTargetImageView = Toolkit::ImageView::New();
- mTargetImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mTargetActor = Actor::New();
+ mTargetActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Create the Gaussian Blur object + render tasks
// Note that we use mBloomExtractTarget as the source image and also re-use this as the gaussian blur final render target. This saves the gaussian blur code from creating it
// render targets etc internally, so we make better use of resources
// Note, this also internally creates the render tasks used by the Gaussian blur, this must occur after the bloom extraction and before the compositing
mGaussianBlurView = Dali::Toolkit::GaussianBlurView::New(mBlurNumSamples, mBlurBellCurveWidth, mPixelFormat, mDownsampleWidthScale, mDownsampleHeightScale, true);
- mGaussianBlurView.SetParentOrigin( ParentOrigin::CENTER );
+ mGaussianBlurView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
//////////////////////////////////////////////////////
// Create cameras for the renders corresponding to the (potentially downsampled) render targets' size
mRenderDownsampledCamera = CameraActor::New();
- mRenderDownsampledCamera.SetParentOrigin(ParentOrigin::CENTER);
+ mRenderDownsampledCamera.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER );
mRenderDownsampledCamera.SetInvertYAxis( true );
mRenderFullSizeCamera = CameraActor::New();
- mRenderFullSizeCamera.SetParentOrigin(ParentOrigin::CENTER);
+ mRenderFullSizeCamera.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER );
mRenderFullSizeCamera.SetInvertYAxis( true );
// Connect to actor tree
Self().Add( mChildrenRoot );
Self().Add( mInternalRoot );
- mInternalRoot.Add( mBloomExtractImageView );
+ mInternalRoot.Add( mBloomExtractActor );
mInternalRoot.Add( mGaussianBlurView );
- mInternalRoot.Add( mCompositeImageView );
- mInternalRoot.Add( mTargetImageView );
+ mInternalRoot.Add( mCompositeActor );
+ mInternalRoot.Add( mTargetActor );
mInternalRoot.Add( mRenderDownsampledCamera );
mInternalRoot.Add( mRenderFullSizeCamera );
// bind properties for / set shader constants to defaults
SetupProperties();
+
+ DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+ return std::unique_ptr< Dali::Accessibility::Accessible >(
+ new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::ANIMATION ) );
+ } );
}
void BloomView::OnSizeSet(const Vector3& targetSize)
{
- Control::OnSizeSet( targetSize );
-
mTargetSize = Vector2(targetSize);
- mChildrenRoot.SetSize(targetSize);
- mCompositeImageView.SetSize(targetSize);
- mTargetImageView.SetSize(targetSize);
+ mChildrenRoot.SetProperty( Actor::Property::SIZE, targetSize);
+ mCompositeActor.SetProperty( Actor::Property::SIZE, targetSize);
+ mTargetActor.SetProperty( Actor::Property::SIZE, targetSize);
// Children render camera must move when GaussianBlurView object is
// resized. This is since we cannot change render target size - so we need
// this is the trade off for not being able to modify render target size
// Change camera z position based on GaussianBlurView actor height
float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
- mRenderFullSizeCamera.SetZ( mTargetSize.height * cameraPosConstraintScale);
+ mRenderFullSizeCamera.SetProperty( Actor::Property::POSITION_Z, mTargetSize.height * cameraPosConstraintScale);
// if we have already activated the blur, need to update render target sizes now to reflect the new size of this actor
if(mActivated)
Deactivate();
Activate();
}
+
+ Control::OnSizeSet( targetSize );
}
void BloomView::OnChildAdd( Actor& child )
{
- Control::OnChildAdd( child );
-
if( child != mChildrenRoot && child != mInternalRoot)
{
mChildrenRoot.Add( child );
}
+
+ Control::OnChildAdd( child );
}
void BloomView::OnChildRemove( Actor& child )
// Create and place a camera for the renders corresponding to the (potentially downsampled) render targets' size
mRenderDownsampledCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
- // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
- mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
+ mRenderDownsampledCamera.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, ( ( mDownsampledHeight * 0.5f ) / tanf( ARBITRARY_FIELD_OF_VIEW * 0.5f ) ) ) );
// Create and place a camera for the children render, corresponding to its render target size
mRenderFullSizeCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
- // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
- mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
+ mRenderFullSizeCamera.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale ) );
//////////////////////////////////////////////////////
// Pass size change onto GaussianBlurView, so it matches
- mGaussianBlurView.SetSize(mTargetSize);
+ mGaussianBlurView.SetProperty( Actor::Property::SIZE, mTargetSize );
GetImpl(mGaussianBlurView).AllocateResources();
+ mGaussianBlurView.SetProperty( Actor::Property::VISIBLE, true );
//////////////////////////////////////////////////////
// Create render targets
// create off screen buffer of new size to render our child actors to
- mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
- mBloomExtractTarget = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat );
- FrameBufferImage mBlurExtractTarget = FrameBufferImage::New( mDownsampledWidth, mDownsampledHeight, mPixelFormat );
- mOutputRenderTarget = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+ mRenderTargetForRenderingChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+ Texture textureForChildren = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+ mRenderTargetForRenderingChildren.AttachColorTexture( textureForChildren );
+
+ mBloomExtractTarget = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight) );
+ mBloomExtractTarget.AttachColorTexture( texture );
+ FrameBuffer blurExtractTarget = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
+ texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight) );
+ blurExtractTarget.AttachColorTexture( texture );
+
+ mOutputRenderTarget = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+ Texture outputTexture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+ mOutputRenderTarget.AttachColorTexture( outputTexture );
//////////////////////////////////////////////////////
// Point actors and render tasks at new render targets
- mBloomExtractImageView.SetImage( mRenderTargetForRenderingChildren );
- mBloomExtractImageView.SetSize(mDownsampledWidth, mDownsampledHeight); // size needs to match render target
- // Create shader used for extracting the bright parts of an image
- Property::Map customShader;
- customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = BLOOM_EXTRACT_FRAGMENT_SOURCE;
- Property::Map visualMap;
- visualMap.Insert( Toolkit::DevelVisual::Property::SHADER, customShader );
- mBloomExtractImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
+ Renderer bloomRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, BLOOM_EXTRACT_FRAGMENT_SOURCE );
+ SetRendererTexture( bloomRenderer, mRenderTargetForRenderingChildren );
+ mBloomExtractActor.AddRenderer( bloomRenderer );
+ mBloomExtractActor.SetProperty( Actor::Property::SIZE, Vector2( mDownsampledWidth, mDownsampledHeight ) ); // size needs to match render target
// set GaussianBlurView to blur our extracted bloom
- mGaussianBlurView.SetUserImageAndOutputRenderTarget(mBloomExtractTarget, mBlurExtractTarget);
+ mGaussianBlurView.SetUserImageAndOutputRenderTarget( mBloomExtractTarget.GetColorTexture(), blurExtractTarget );
// use the completed blur in the first buffer and composite with the original child actors render
- mCompositeImageView.SetImage( mRenderTargetForRenderingChildren );
- // Create shader used to composite bloom and original image to output render target
- customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = COMPOSITE_FRAGMENT_SOURCE;
- visualMap[ Toolkit::DevelVisual::Property::SHADER ] = customShader;
- mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
- TextureSet textureSet = mCompositeImageView.GetRendererAt(0).GetTextures();
- TextureSetImage( textureSet, 1u, mBlurExtractTarget );
+ Renderer compositeRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, COMPOSITE_FRAGMENT_SOURCE );
+ SetRendererTexture( compositeRenderer, mRenderTargetForRenderingChildren );
+ TextureSet textureSet = compositeRenderer.GetTextures();
+ textureSet.SetTexture( 0u, mRenderTargetForRenderingChildren.GetColorTexture() );
+ textureSet.SetTexture( 1u, blurExtractTarget.GetColorTexture() );
+ mCompositeActor.AddRenderer( compositeRenderer );
// set up target actor for rendering result, i.e. the blurred image
- mTargetImageView.SetImage(mOutputRenderTarget);
+ Renderer targetRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, BASIC_FRAGMENT_SOURCE );
+ SetRendererTexture( targetRenderer, mOutputRenderTarget );
+ mTargetActor.AddRenderer( targetRenderer );
}
}
mRenderChildrenTask.SetInputEnabled( false );
mRenderChildrenTask.SetClearEnabled( true );
mRenderChildrenTask.SetCameraActor(mRenderFullSizeCamera); // use camera that covers render target exactly
- mRenderChildrenTask.SetTargetFrameBuffer( mRenderTargetForRenderingChildren );
+ mRenderChildrenTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
// Extract the bright part of the image and render to a new buffer. Downsampling also occurs at this stage to save pixel fill, if it is set up.
mBloomExtractTask = taskList.CreateTask();
- mBloomExtractTask.SetSourceActor( mBloomExtractImageView );
+ mBloomExtractTask.SetSourceActor( mBloomExtractActor );
mBloomExtractTask.SetExclusive(true);
mBloomExtractTask.SetInputEnabled( false );
mBloomExtractTask.SetClearEnabled( true );
mBloomExtractTask.SetCameraActor(mRenderDownsampledCamera);
- mBloomExtractTask.SetTargetFrameBuffer( mBloomExtractTarget );
+ mBloomExtractTask.SetFrameBuffer( mBloomExtractTarget );
// GaussianBlurView tasks must be created here, so they are executed in the correct order with respect to BloomView tasks
GetImpl(mGaussianBlurView).CreateRenderTasks();
// Use an image view displaying the children render and composite it with the blurred bloom buffer, targeting the output
mCompositeTask = taskList.CreateTask();
- mCompositeTask.SetSourceActor( mCompositeImageView );
+ mCompositeTask.SetSourceActor( mCompositeActor );
mCompositeTask.SetExclusive(true);
mCompositeTask.SetInputEnabled( false );
mCompositeTask.SetClearEnabled( true );
mCompositeTask.SetCameraActor(mRenderFullSizeCamera);
- mCompositeTask.SetTargetFrameBuffer( mOutputRenderTarget );
+ mCompositeTask.SetFrameBuffer( mOutputRenderTarget );
}
void BloomView::RemoveRenderTasks()
// stop render tasks processing
// Note: render target resources are automatically freed since we set the Image::Unused flag
RemoveRenderTasks();
+
mRenderTargetForRenderingChildren.Reset();
mBloomExtractTarget.Reset();
mOutputRenderTarget.Reset();
+
+ // Reset children
+ mBloomExtractActor.RemoveRenderer( 0u );
+ mTargetActor.RemoveRenderer( 0u );
+ mCompositeActor.RemoveRenderer( 0u );
+
+ mGaussianBlurView.SetProperty( Actor::Property::VISIBLE, false );
+
mActivated = false;
}
// bloom threshold
// set defaults, makes sure properties are registered with shader
- mBloomExtractImageView.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
- mBloomExtractImageView.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
+ mBloomExtractActor.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
+ mBloomExtractActor.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
// Register a property that the user can control to change the bloom threshold
mBloomThresholdPropertyIndex = self.RegisterProperty(BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT);
- Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
- Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderBloomThresholdPropertyIndex, EqualToConstraint());
+ Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractActor.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
+ Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractActor, shaderBloomThresholdPropertyIndex, EqualToConstraint());
bloomThresholdConstraint.AddSource( Source(self, mBloomThresholdPropertyIndex) );
bloomThresholdConstraint.Apply();
// precalc 1.0 / (1.0 - threshold) on CPU to save shader insns, using constraint to tie to the normal threshold property
- Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
- Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
+ Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractActor.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
+ Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractActor, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
thresholdConstraint.AddSource( LocalSource(shaderBloomThresholdPropertyIndex) );
thresholdConstraint.Apply();
// Register a property that the user can control to fade the bloom intensity via internally hidden shader
mBloomIntensityPropertyIndex = self.RegisterProperty(BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT);
- mCompositeImageView.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
- Property::Index shaderBloomIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
- Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomIntensityPropertyIndex, EqualToConstraint());
+ mCompositeActor.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
+ Property::Index shaderBloomIntensityPropertyIndex = mCompositeActor.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
+ Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeActor, shaderBloomIntensityPropertyIndex, EqualToConstraint());
bloomIntensityConstraint.AddSource( Source(self, mBloomIntensityPropertyIndex) );
bloomIntensityConstraint.Apply();
// Register a property that the user can control to fade the bloom saturation via internally hidden shader
mBloomSaturationPropertyIndex = self.RegisterProperty(BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT);
- mCompositeImageView.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
- Property::Index shaderBloomSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
- Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomSaturationPropertyIndex, EqualToConstraint());
+ mCompositeActor.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
+ Property::Index shaderBloomSaturationPropertyIndex = mCompositeActor.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
+ Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeActor, shaderBloomSaturationPropertyIndex, EqualToConstraint());
bloomSaturationConstraint.AddSource( Source(self, mBloomSaturationPropertyIndex) );
bloomSaturationConstraint.Apply();
// Register a property that the user can control to fade the image intensity via internally hidden shader
mImageIntensityPropertyIndex = self.RegisterProperty(IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT);
- mCompositeImageView.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
- Property::Index shaderImageIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
- Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderImageIntensityPropertyIndex, EqualToConstraint());
+ mCompositeActor.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
+ Property::Index shaderImageIntensityPropertyIndex = mCompositeActor.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
+ Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeActor, shaderImageIntensityPropertyIndex, EqualToConstraint());
imageIntensityConstraint.AddSource( Source(self, mImageIntensityPropertyIndex) );
imageIntensityConstraint.Apply();
// Register a property that the user can control to fade the image saturation via internally hidden shader
mImageSaturationPropertyIndex = self.RegisterProperty(IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT);
- mCompositeImageView.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
- Property::Index shaderImageSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
- Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderImageSaturationPropertyIndex, EqualToConstraint());
+ mCompositeActor.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
+ Property::Index shaderImageSaturationPropertyIndex = mCompositeActor.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
+ Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeActor, shaderImageSaturationPropertyIndex, EqualToConstraint());
imageSaturationConstraint.AddSource( Source(self, mImageSaturationPropertyIndex) );
imageSaturationConstraint.Apply();
}