Skip to main content

Custom Effect Set

It is now possible to configure the list of Effects required by the application. A new project will be created in this regard, which will include the generated EffectSet and the necessary dependent source files.

CMake Flag

A new flag has been introduced to specify that a custom Effect Set shall be used: CGIAPP_ENABLE_CUSTOM_EFFECT_SET. This feature is disabled by default.

CMakeLists Template File

A CMakeLists.txt template file can be used as reference on how to configure the custom effect set and integrate it in the application. This is located in cgi_studio_candera/templates/EffectLists.template.txt

  • CGIEFFECTS_LIST - refers to a list of Candera Effects that should be added to the generated EffectSet
  • CGIEFFECTS_PROJECTNAME - specifies the project name

Integrate Custom Effect Set into application

  • Create a new folder in the application source directory (eg: Effects) and add a CMakeLists.txt file inside, based on the template file mentioned above.
  • Populate the list of needed effects and specify the project name.
  • In the CMake configuration file of the application add the following line: CgiAddProject(Effects).
  • Configure and build the application as usual.

Example CMakeLists file

Do not include the "Candera" namespace, this will be automatically added when the EffectSet will be generated.


  # Effect List
  set(PRV_CGIAPP_EFFECT_LIBRARY_LIST
      GlRadialGradientBrushBlend
      BitmapBrushBlend
      BitmapBrushColorBlend
      ShadowBitmapBrushBlend
  )

  set(PRV_CGIAPP_EFFECTSET_SUBDIRS
      .
  )
    
  CgiGetCurrentDir(PRV_CUR_DIR)

  # Enable Custom EffectSet flag
  set(CGIAPP_ENABLE_CUSTOM_EFFECT_SET TRUE CACHE BOOL "Enable Custom Effect Set")

  # Include EffectSet Generator
  set(CGISTUDIO_EFFECTSET_CMAKE_INCLUDE "${FeatStd_DIR}/cmake/cgistudio/cgistudio_effectset_generator.cmake")
  if(EXISTS ${CGISTUDIO_EFFECTSET_CMAKE_INCLUDE})
      include(${CGISTUDIO_EFFECTSET_CMAKE_INCLUDE})
      # Create Custom EffectSet
      if(CGIAPP_ENABLE_CUSTOM_EFFECT_SET)
          CgiCreateEffectSet("EffectSet" "${PRV_CGIAPP_EFFECT_LIBRARY_LIST}")
      endif(CGIAPP_ENABLE_CUSTOM_EFFECT_SET)
  else()
      message(FATAL_ERROR "EffectSet Generator '${FeatStd_DIR}/cmake/cgistudio/cgistudio_effectset_generator.cmake' could not be found, further processing is aborted.")
  endif()

Is is not possible to generate an empty EffectSet. An appropriate error message will be shown during project configuration and further processing will be halted.

The user takes responsibility of assuring that all effects which are needed by the used CGI Studio products are included. (eg.: Candera::BitmapBrushColorBlend is required by Candera::TextNode2D).