Helper functions to control effects
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.
void Effect_Shake_FadeOut(int alID, float afFadeOutTime)
Fades out one or all shake instances.
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.
float Effect_Shake_GetCurrentShakeAmount()
Gets the current amount of shake (as in abs larges element in shake vector)
void Effect_Shake_EnableAll(bool abState)
void Effect_VideoDistortion_EnableAll(bool abState)
void Effect_Fade_In(float afTime)
void Effect_Fade_Out(float afTime)
bool Effect_Fade_IsFading()
float Effect_Fade_GetAlpha()
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
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
void Effect_Bloom_FadeBrightPass(float afBrightPass, float afTime)
Changes the bright pass of the bloom over time
void Effect_Bloom_FadeBloomWidth(float afBloomWidth, float afTime)
Changes the width of the bloom over time
void Effect_Bloom_FadeBloomFalloff(float afBloomFalloff, float afTime)
Changes the sharpness of the bloom over time
void Effect_Bloom_FadeBloomTint(float afR, float afG, float afB, float afTime)
Changes the color of the bloom over time
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
void Effect_FilmGrain_FadeFilmGrainIntensity(float afIntensity, float afTime)
Changes the amount of noise applied to the screen over time
int Effect_DoF_Start(float afFocusStart, float afFocusEnd, float afFalloff, float afTime)
Starts an instance of depth of field and returns the id
void Effect_DoF_FadeFocus(int alID, float afFocusStart, float afFocusEnd, float afTime)
Fade the start and end of the focus plane
void Effect_DoF_FadeFalloff(int alID, float afFocusFalloff, float afTime)
Fade the falloff of the instance
void Effect_DoF_FadeOut(int alID, float afTime)
Fade out the instance of depth of field, the instance is removed after fading out
void Effect_DoF_Reset()
void Effect_ToneMapping_UseSRGB(bool abX)
If srgb gamma should be used. Default is normal pow(x, 1 / gamma)
void Effect_ToneMapping_FadeExposure(float afExposure, float afTime)
Changes the overall brightness of the image over time
float Effect_ToneMapping_GetExposure()
Get the current exposure value of the viewport
Returns: , current exposure
float Effect_ToneMapping_GetExposureBrightness()
Get the current exposure value of the viewport
Returns: , current brightness
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)
void Effect_ToneMapping_FadeGrading(tString asTextureName, float afTime)
Fades in a grading texture which changes the final color of the image
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
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
void Effect_ImageTrail_FadeOut(int alID, float afFadeOutTime)
Fades out an active instance of image trail
void Effect_ImageTrail_Clear()
Clears all effects
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.
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
int Effect_ChromaticAberration_CreateInstance(float afAmount, float afRotation, float afHue=0, const cVector2f &in avOffset=cVector2f(0))
void Effect_ChromaticAberration_SetInstanceValues(int alID, float afAmount, float afRotation, float afHue=0, const cVector2f &in avOffset=cVector2f_Zero)
void Effect_ChromaticAberration_DestroyInstance(int alID)
void Effect_Flash_Start(float afFadeIn, float afWhite, float afFadeOut)
Fades exposure in and out to create a white flash effect.
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
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
void Effect_Screen_FadeOut(int alID, float afFadeTime)
Fades out a material
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
void Effect_Screen_FadeAlpha(int alID, float afAlpha, float afFadeTime)
Fades the transparency of a material
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)
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
void Effect_RadialBlur_FadeSize(int alID, float afSize, float afTime)
Changes the size of the blur of this instance
void Effect_RadialBlur_FadeStartDistance(int alID, float afDistance, float afTime)
Changes how far away from the center to start blurring
void Effect_RadialBlur_FadeAlpha(int alID, float afAlpha, float afTime)
Changes how visible the instance should be
void Effect_RadialBlur_FadeOut(int alID, float afTime)
Fades out this instance and removes it. The ID is invalid after this has been called
void Effect_ImageFadeFX_SetAmount(float afX)
void Effect_ImageFadeFX_FadeAmount(float afAmount, float afTime)
void Effect_ImageFadeFX_SetTextures(const tString &in asFadeTexture, const tString &in asColorTexture, const tString &in asOffsetTexture)
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)
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.
void Effect_VideoDistortion_FadeOut(int alID, float afFadeOutTime)
Fades out a video distortion effect instance.
void Effect_VideoDistortion_SetMaxAmount(int alID, float afMaxAmount)
Sets the max amount of an instnace (basically changes the amount)
float Effect_VideoDistortion_GetAmount()
Get the current amount of the distortion
float Effect_VideoDistortion_GetEffectAmount()
Get the current effect amount of the distortion (the one that is sent to the post effect)
void Effect_VideoDistortion_SetSoundEffectsDisabled(bool abX)
Set if video distortion sounds should be disabled.
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.
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)
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)
void Effect_Sway_FadeOut(float afTime)
void Effect_Sway_Stop()
cVector3f Effect_Sway_GetOffset()
int Effect_Rumble_Start(float afAmount, float afTime, float afFadeInTime=0, float afFadeOutTime=0)
Start a gamepad rumble
int Effect_GamepadColor_Fade(cColor aColor, float afTime)
Fade the gamepad color (the backlight of the ps4 controller)
void Effect_Rumble_Stop(int alID)
Stops the rumble from this id
void Effect_Rumble_SetScreenShakeMul(float afX)
Sets a multiplier for how much rumble should be generated from screenshake.
void Effect_GamepadColor_Stop(int alID)
Stops the color fade from this id