Graphics.AllowingForOffscreenLightFlaresAndBlooms - lordmundi/wikidoctest GitHub Wiki

Allowing for Offscreen Light Flares and Blooms

« Using Frame Locking across multiple displays | EDGE User’s Guide | Perform Image Distortion »

Description

Depending on the light (or flare source), camera, lens, etc., sometimes there should be a lens flare or bloom in the view. In the case where the actual flare source is not within the view, sometimes you can get a flare when you shouldn't (such as an object should be obstructing the flare source), or not get a flare when you should.

To fix this, there are two ways to direct speedtest to account for a flare source that is out of the view.

Lensflare Raycast

The most direct solution to this problem is to direct speedtest to use the "-lensflare_raycast" command line option. The downside is that this will cause some performance hit. Try it for your situation to see if the performance hit is acceptable.

  1. Edit $USERDATA/user.cfg
  2. Redefine DOUG_SPEEDY_ARGS in your DEFINES block to include the "-lensflare_raycast" option. You can copy in the default args from $EDGE_HOME/edge_settings.cfg and then simply add -lensflare_raycast to the end of it.

Flare View Buffer

Another way to work around this issue is to command speedtest to render a separate pass with a flare view buffer. A flare view buffer can be defined as a separate rendering pass that speedtest will make (typically on a much bigger field of view) in order to determine if a flare should be visible within the original viewport. This can be needed if the flare source itself is not in the view but the flares should be (or vice versa).

Using a FLARE_VIEW_BUFFER will force dsp_speedtest3 to do two render passes, one for the displayed viewport and one that represents a much larger viewport that encompasses the full view you are concerned with, which depending on your scene and the size of the viewport, might slow it down more than the raycast option above.

To define a flare view buffer, you would add (somewhere in your config stream), something like the following:

DSP_SPEEDTEST
{
    FLARE_VIEW_BUFFERS
    {
          view(<viewname>);  window(<left>,<right>,<bottom>,<top>,<near>,<far>); size(<width_in_pixels>,<height_in_pixels>);
                             or
          view(<viewname>);  perspective(<vfov>,<aspect>,<near>,<far>); size(<width_in_pixels>,<height_in_pixels>);
    }
}

An example:

DSP_SPEEDTEST
{
    FLARE_VIEW_BUFFERS
    {
            view(MAIN);       window(-10.0,10,-10.0,10.0,1.0,10000000000000.0); size(2048,2048);
     }
}
⚠️ **GitHub.com Fallback** ⚠️