Cy Billboard Lensflare is a unique material, it allows you to do everything that is proposed in the features in a single material, but it is internally segmented by options in the form of Boolean, which allows the engine to recompile the shader and use only what you need, this allows to gain in performance but makes some options more complex to modify in real time, that's why all the presets are designed in Material Instance Constant.
In the main folder "Content/_Cy_Assets/Cy_Billboard_LensFlare/" you will find the preset folder which contains the material instance and all associated textures in separate folders.
You will also find the base material, the main actor, the example and test map, and 2 simple actors that use one a plane and the other a waterfall or niagara particle.
In the LensFlare folder, there is an actor which is the Material billboard version with option included in it, but it is quite possible to use the material in other context like in a particle or a plane (by activating the Billboard Shader).
The main actor is preconfigured to work properly with the preset instance you will be using, and it also adds some option to simplify the real time modification of the parameters via several options included in the actor.
You will notice that the scale of the actor is huge, this is for the outscreen effect to work properly.
Base Parameters
Preset Material Instance Constant : is the reference to the preset you want to use, or your own custom instance, if UseDynamicMaterial is checked, the instance will be transformed to dynamic in the actor.
Billboard Size : This variable allows you to set the size of the billboard on the screen, the value of 58 is correct for 21/9 screens, it allows you to make the lensflare on the whole surface of the screen, this value is dependent on the distance configured in the material, which is 40.
UseDynamicMaterial : If enabled, the actor will create a dynamic instance, which can then be used to apply values in real time or by the sequencer.
Use Update Value On Tick : is an option that will automatically activate "UseDynamicMaterial". and it allows to use variables that are present in the actor and exposed to the sequencer, these values will be updated to the tick, which allows a simplicity for the cinematics.
Update Value
All the values in this category are exposed to the kinematics, which allows you to just modify the value to be set directly in the dynamic material instance. The two basic values "ScreenFadeMask" and "Boost" allow a small basic control, then you can use the custom Scalar and Vector, you just have to configure the good name of the value that will be set in the material. You can also use the functions present in the actor that allows you to change all the parameters of the material instance except for Bool, so the options
New options have been added with version 1.1, it is now possible to make the occlusion test using the blueprint and to move the lensflare to the simulated location of the sun using the rotation of a "Directional Light".
Occlusion Tracer
Occlusion tracer will use a method of testing occlusion directly via the blueprint using a multitude of sphere traces.
This can allow in some cases to keep the lensflare even when the point of origin is no longer on the screen.
There are several possibilities for the origin point, the BP can get directly the location of the camera of a player or that of an actor or a location update by another code via a variable.
Note: If occlusion tracer is enabled, the occlusion shader test and screenfade will be disabled,
Occlusion Tracer Test Count : is the number of test per tick, the higher the number, the more accurate the fade.
OcclusionTracerFadeSize : is the test radius, occlusion tracer performs a test with trace spheres, the larger the radius, the more progressive the fade.
OcclusionTracerTraceComplex : activate the complex test "Recommended"
OcclusionTracerIgnoreActor : allows to add actor to ignore in the test.
OcclusionTracerGetCameraPlayer : This is the type of get that the blueprint will do to make its occlusion test, AutoGetPlayer allows to get directly the location of the camera of the player ID, FromInput_Location will use the InputTarget variable and From_Actor will look at the location of the target actor.
OcclusionTracerTargetPlayerIndex : is the index of the target player .
OcclusionTracerTargetInputLocation : variable used for option 2.
OcclusionTracerTargetActor : is the target for option 3.
OcclusionTracerChannel : defines the channel to use between camera and visibility.
OcclusionTracerDebug : allows to display the debug for the occlusion test.
OcclusionTracer_SetMatOcclusionToFalse_inConstruction : allows you to set the construction script to stop the occlusion test shader.
Move To sunÂ
Another option has been added that allows you to target a directional light and then place the lensflare at the virtual location of the sun.
You can activate it with a button to place direction in the editor, but also activate the automatic update in game.