Table of Contents

helper_effects.hps

Helper functions to control effects


Effect_Shake_Start
int Effect_Shake_Start(float afAmount,
                       float afTime,
                       float afFadeInTime,
                       float afFadeOutTime,
                       const cVector3f &in avDirAmount=cVector3f(1, 1, 1),
                       float afFrequency=0)

Makes the screen shake for a certain amount of time. Returns id to the current shaking. If several calls to shake has been made the largest one is used.


Effect_Shake_FadeOut
void Effect_Shake_FadeOut(int alID,
                          float afFadeOutTime)

Fades out one or all shake instances.


Effect_Shake_SetSourceEntity
void Effect_Shake_SetSourceEntity(int alID,
                                  const tString &in asSourceEntity,
                                  float afMinDist,
                                  float afMaxDist,
                                  eEasing aEasingType=eEasing_CubicIn)

Sets an entity as the source of a shake instance. The shake instance will increase in strength as the player gets closer to the entity.


Effect_Shake_GetCurrentShakeAmount
float Effect_Shake_GetCurrentShakeAmount()

Gets the current amount of shake (as in abs larges element in shake vector)


Effect_Shake_EnableAll
void Effect_Shake_EnableAll(bool abState)

Effect_VideoDistortion_EnableAll
void Effect_VideoDistortion_EnableAll(bool abState)

Effect_Fade_In
void Effect_Fade_In(float afTime)

Effect_Fade_Out
void Effect_Fade_Out(float afTime)

Effect_Fade_IsFading
bool Effect_Fade_IsFading()

Effect_Fade_GetAlpha
float Effect_Fade_GetAlpha()

Effect_Glow_AddEntity
void Effect_Glow_AddEntity(iLuxEntity @apEntity,
                           float afAlpha,
                           float afY)

Adds a glow effect to the object to make it more visible to the player Must be called from OnPostUpdate() every frame the glow should be visible


Effect_Bloom_SetActive
void Effect_Bloom_SetActive(bool abX)

Sets if bloom should be active Bloom is an effect that makes bright colors glow in a halo around the object


Effect_Bloom_FadeBrightPass
void Effect_Bloom_FadeBrightPass(float afBrightPass,
                                 float afTime)

Changes the bright pass of the bloom over time


Effect_Bloom_FadeBloomWidth
void Effect_Bloom_FadeBloomWidth(float afBloomWidth,
                                 float afTime)

Changes the width of the bloom over time


Effect_Bloom_FadeBloomFalloff
void Effect_Bloom_FadeBloomFalloff(float afBloomFalloff,
                                   float afTime)

Changes the sharpness of the bloom over time


Effect_Bloom_FadeBloomTint
void Effect_Bloom_FadeBloomTint(float afR,
                                float afG,
                                float afB,
                                float afTime)

Changes the color of the bloom over time


Effect_FilmGrain_SetActive
void Effect_FilmGrain_SetActive(bool abX)

Sets if film grain should be active Film Grain is an effect that applies animated noise to the image to remove banding and give life to it


Effect_FilmGrain_FadeFilmGrainIntensity
void Effect_FilmGrain_FadeFilmGrainIntensity(float afIntensity,
                                             float afTime)

Changes the amount of noise applied to the screen over time


Effect_DoF_Start
int Effect_DoF_Start(float afFocusStart,
                     float afFocusEnd,
                     float afFalloff,
                     float afTime)

Starts an instance of depth of field and returns the id


Effect_DoF_FadeFocus
void Effect_DoF_FadeFocus(int alID,
                          float afFocusStart,
                          float afFocusEnd,
                          float afTime)

Fade the start and end of the focus plane


Effect_DoF_FadeFalloff
void Effect_DoF_FadeFalloff(int alID,
                            float afFocusFalloff,
                            float afTime)

Fade the falloff of the instance


Effect_DoF_FadeOut
void Effect_DoF_FadeOut(int alID,
                        float afTime)

Fade out the instance of depth of field, the instance is removed after fading out


Effect_DoF_Reset
void Effect_DoF_Reset()

Effect_ToneMapping_UseSRGB
void Effect_ToneMapping_UseSRGB(bool abX)

If srgb gamma should be used. Default is normal pow(x, 1 / gamma)


Effect_ToneMapping_FadeExposure
void Effect_ToneMapping_FadeExposure(float afExposure,
                                     float afTime)

Changes the overall brightness of the image over time


Effect_ToneMapping_GetExposure
float Effect_ToneMapping_GetExposure()

Get the current exposure value of the viewport

Returns: , current exposure


Effect_ToneMapping_GetExposureBrightness
float Effect_ToneMapping_GetExposureBrightness()

Get the current exposure value of the viewport

Returns: , current brightness


Effect_ToneMapping_FadeWhiteCut
void Effect_ToneMapping_FadeWhiteCut(float afWhiteCut,
                                     float afTime)

Changes the white point of the tone mapper over time Every color brighter then the white cut gets clamped to (1,1,1)


Effect_ToneMapping_FadeGrading
void Effect_ToneMapping_FadeGrading(tString asTextureName,
                                    float afTime)

Fades in a grading texture which changes the final color of the image


Effect_ImageTrail_Start
int Effect_ImageTrail_Start(float afAmount,
                            float afFadeInTime,
                            float afStayTime,
                            float afFadeOutTime)

Image trail blends the image of multiple previous frames over time, multiple instances can be active at the same time The strongest instance of image trail will be used

Returns: the id to this image trail instance


Effect_ImageTrail_SetDirectAmount
void Effect_ImageTrail_SetDirectAmount(float afAmount)

Image trail blends the image of multiple previous frames over time. (in case Effect_ImageTrail_Start has also been used, the strongest instance of image trail will be used


Effect_ImageTrail_FadeOut
void Effect_ImageTrail_FadeOut(int alID,
                               float afFadeOutTime)

Fades out an active instance of image trail


Effect_ImageTrail_Clear
void Effect_ImageTrail_Clear()

Clears all effects


Effect_ChromaticAberration_StartAnim
void Effect_ChromaticAberration_StartAnim(float afDuration,
                                          float afAmount,
                                          float afRandomness,
                                          cVector2f avDirection)

Split the image into three images depending on color and makes rotation animation.


Effect_ChromaticAberration_SetDirect
void Effect_ChromaticAberration_SetDirect(float afAmount,
                                          float afRotation,
                                          float afHue=0,
                                          const cVector2f &in avOffset=cVector2f(0))

Split the image into three images depending on color


Effect_ChromaticAberration_CreateInstance
int Effect_ChromaticAberration_CreateInstance(float afAmount,
                                              float afRotation,
                                              float afHue=0,
                                              const cVector2f &in avOffset=cVector2f(0))

Effect_ChromaticAberration_SetInstanceValues
void Effect_ChromaticAberration_SetInstanceValues(int alID,
                                                  float afAmount,
                                                  float afRotation,
                                                  float afHue=0,
                                                  const cVector2f &in avOffset=cVector2f_Zero)

Effect_ChromaticAberration_DestroyInstance
void Effect_ChromaticAberration_DestroyInstance(int alID)

Effect_Flash_Start
void Effect_Flash_Start(float afFadeIn,
                        float afWhite,
                        float afFadeOut)

Fades exposure in and out to create a white flash effect.


Effect_Screen_Start
int Effect_Screen_Start(const tString &in asMaterial,
                        cVector2f avPosition,
                        cVector2f avSize)

Creates a images that shows up on the screen, it must be faded manually Remember that these must work on both 4:3 and 16:9 aspect ratio

Returns: the id to this screen material


Effect_Screen_Start
int Effect_Screen_Start(const tString &in asMaterial,
                        cVector2f avPosition,
                        cVector2f avSize,
                        float afTargetAlpha,
                        float afFadeInTime,
                        float afStayTime,
                        float afFadeOutTime)

Creates a images that fade in and then out Remember that these must work on both 4:3 and 16:9 aspect ratio

Returns: the id to this screen material


Effect_Screen_FadeOut
void Effect_Screen_FadeOut(int alID,
                           float afFadeTime)

Fades out a material


Effect_Screen_FadeLiquidAmount
void Effect_Screen_FadeLiquidAmount(int alID,
                                    float afAmount,
                                    float afFadeTime)

Fades the liquid amount of a material, this is a variable used by the shader to determine wetness


Effect_Screen_FadeAlpha
void Effect_Screen_FadeAlpha(int alID,
                             float afAlpha,
                             float afFadeTime)

Fades the transparency of a material


Effect_RadialBlur_SetDirect
void Effect_RadialBlur_SetDirect(float afSize,
                                 float afStartDistance,
                                 float afAlpha)

Directly sets the values of radial blur (but will blend with any instnace that has been started)


Effect_RadialBlur_Start
int Effect_RadialBlur_Start(float afSize,
                            float afAlpha,
                            float afStartDistance,
                            float afTime)

Starts a radial blur effect, will be active until

Returns: the id to this radial blur instance


Effect_RadialBlur_FadeSize
void Effect_RadialBlur_FadeSize(int alID,
                                float afSize,
                                float afTime)

Changes the size of the blur of this instance


Effect_RadialBlur_FadeStartDistance
void Effect_RadialBlur_FadeStartDistance(int alID,
                                         float afDistance,
                                         float afTime)

Changes how far away from the center to start blurring


Effect_RadialBlur_FadeAlpha
void Effect_RadialBlur_FadeAlpha(int alID,
                                 float afAlpha,
                                 float afTime)

Changes how visible the instance should be


Effect_RadialBlur_FadeOut
void Effect_RadialBlur_FadeOut(int alID,
                               float afTime)

Fades out this instance and removes it. The ID is invalid after this has been called


Effect_ImageFadeFX_SetAmount
void Effect_ImageFadeFX_SetAmount(float afX)

Effect_ImageFadeFX_FadeAmount
void Effect_ImageFadeFX_FadeAmount(float afAmount,
                                   float afTime)

Effect_ImageFadeFX_SetTextures
void Effect_ImageFadeFX_SetTextures(const tString &in asFadeTexture,
                                    const tString &in asColorTexture,
                                    const tString &in asOffsetTexture)

Effect_VideoDistortion_SetDirectAmount
void Effect_VideoDistortion_SetDirectAmount(float afX)

Sets the amount of video distortion directly. (if there are instances in play, then the max amount will be used)


Effect_VideoDistortion_Start
int Effect_VideoDistortion_Start(float afAmount,
                                 float afTime,
                                 float afFadeInTime,
                                 float afFadeOutTime,
                                 float afVolume=1.0f)

Starts the video distortion effect. If many have been started the max amount is used. Returns ID to this instnace.


Effect_VideoDistortion_FadeOut
void Effect_VideoDistortion_FadeOut(int alID,
                                    float afFadeOutTime)

Fades out a video distortion effect instance.


Effect_VideoDistortion_SetMaxAmount
void Effect_VideoDistortion_SetMaxAmount(int alID,
                                         float afMaxAmount)

Sets the max amount of an instnace (basically changes the amount)


Effect_VideoDistortion_GetAmount
float Effect_VideoDistortion_GetAmount()

Get the current amount of the distortion


Effect_VideoDistortion_GetEffectAmount
float Effect_VideoDistortion_GetEffectAmount()

Get the current effect amount of the distortion (the one that is sent to the post effect)


Effect_VideoDistortion_SetSoundEffectsDisabled
void Effect_VideoDistortion_SetSoundEffectsDisabled(bool abX)

Set if video distortion sounds should be disabled.


Effect_TimeGlitch_Start
void Effect_TimeGlitch_Start(float afTimeAdvancement,
                             float afPlayFastSoundTime,
                             float afShakeAmount,
                             bool abPlayEffectSound,
                             float afSoundEffectVolume=1.0f)

Starts an effect that makes physics and visual jump forward in time.


Effect_Sway_FadeIn
void Effect_Sway_FadeIn(float afSize,
                        float afTime,
                        float afRate,
                        float afAngle,
                        float afInitialAmount=-1.0f,
                        float afYMul=0.25f,
                        float afDecay=0.995f,
                        float afMoveFactor=0.4f)

Effect_Sway_SetDirect
void Effect_Sway_SetDirect(float afSize,
                           float afRate,
                           float afAngle,
                           float afInitialAmount=-1.0f,
                           float afYMul=0.25f,
                           float afDecay=0.995f,
                           float afMoveFactor=0.4f)

Effect_Sway_FadeOut
void Effect_Sway_FadeOut(float afTime)

Effect_Sway_Stop
void Effect_Sway_Stop()

Effect_Sway_GetOffset
cVector3f Effect_Sway_GetOffset()

Effect_Rumble_Start
int Effect_Rumble_Start(float afAmount,
                        float afTime,
                        float afFadeInTime=0,
                        float afFadeOutTime=0)

Start a gamepad rumble


Effect_GamepadColor_Fade
int Effect_GamepadColor_Fade(cColor aColor,
                             float afTime)

Fade the gamepad color (the backlight of the ps4 controller)


Effect_Rumble_Stop
void Effect_Rumble_Stop(int alID)

Stops the rumble from this id


Effect_Rumble_SetScreenShakeMul
void Effect_Rumble_SetScreenShakeMul(float afX)

Sets a multiplier for how much rumble should be generated from screenshake.


Effect_GamepadColor_Stop
void Effect_GamepadColor_Stop(int alID)

Stops the color fade from this id