- Size stageSize = Stage::GetCurrent().GetSize();
- mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) );
- mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) );
-
- Image image = LoadImageFittedInBox( MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
- mMotionBlurImageActor = ImageActor::New(image);
- mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
-
- mContentLayer.Add( mMotionBlurImageActor );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect = Toolkit::CreateMotionBlurEffect();
- Dali::Property::Index uModelProperty = mMotionBlurEffect.GetPropertyIndex( "uModelLastFrame" );
- Constraint constraint = Constraint::New<Matrix>( mMotionBlurEffect, uModelProperty, EqualToConstraint() );
- constraint.AddSource( Source( mMotionBlurImageActor , Actor::Property::WORLD_MATRIX ) );
- constraint.Apply();
- mMotionBlurImageActor.SetShaderEffect( mMotionBlurEffect );
-
-
-#ifdef MULTIPLE_MOTION_BLURRED_ACTORS
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 2
- //
-
- mMotionBlurImageActor2 = ImageActor::New(image);
- mMotionBlurImageActor2.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor2.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor2.SetPosition(mMotionBlurActorSize.x * 1.1f, 0.0f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor2 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect2 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor2.SetShaderEffect( mMotionBlurEffect2 );
-
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 3
- //
-
- mMotionBlurImageActor3 = ImageActor::New(image);
- mMotionBlurImageActor3.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor3.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor3.SetPosition(-mMotionBlurActorSize.x * 1.1f, 0.0f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor3 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect3 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor3.SetShaderEffect( mMotionBlurEffect3 );
-
-
- ///////////////////////////////////////////////////////
- //
- // Motion blurred actor 4
- //
-
- mMotionBlurImageActor4 = ImageActor::New(image);
- mMotionBlurImageActor4.SetParentOrigin( ParentOrigin::CENTER );
- mMotionBlurImageActor4.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
- mMotionBlurImageActor4.SetPosition(0.0f, mMotionBlurActorSize.y * 1.1f);
- mMotionBlurImageActor.Add( mMotionBlurImageActor4 );
-
- // Create shader used for doing motion blur
- mMotionBlurEffect4 = CreateMotionBlurEffect(MOTION_BLUR_NUM_SAMPLES);
-
- // set actor shader to the blur one
- mMotionBlurImageActor4.SetShaderEffect( mMotionBlurEffect4 );
-