PokéRogue
    Preparing search index...

    The PanoramaBlur Filter Controller.

    This filter controller manages the PanoramaBlur effect for a Camera.

    PanoramaBlur is a filter for blurring a panorama image. This is intended for use with filters like ImageLight that use a panorama image as the environment map. The blur treats a rectangular map as a sphere, and applies heavy distortion close to the poles to get a correct result. You should not use it for general purpose blurring.

    The effect can be very slow, as it uses a grid of samples. Total samples equals samplesX * samplesY. This can get very high, very quickly, so be careful when increasing these values. They don't need to be too high for good results.

    By default, the blur is fully diffuse, sampling an entire hemisphere per point. If you reduce the radius, the effect will be more focused. Use this to control different levels of glossiness in objects using environment maps.

    A PanoramaBlur effect is added to a Camera via the FilterList component:

    const camera = this.cameras.main;

    camera.filters.internal.addPanoramaBlur({});
    camera.filters.external.addPanoramaBlur({});

    Hierarchy (View Summary)

    Index
    active: boolean

    Toggle this boolean to enable or disable this filter, without removing it from and re-adding it to the Camera's filter list.

    allowBaseDraw: boolean

    If true, this filter will be permitted to draw to the base texture. This can be unwanted if, for example, the filter doesn't actually draw anything.

    This is an internal flag used by the renderer. You should not modify this value directly.

    camera: Camera

    A reference to the Camera that owns this filter.

    currentPadding: Rectangle

    The padding currently being used by this filter. This is read during rendering via getPadding, and may be updated by subclass implementations. It is necessary for filters being used in an external list. You should not modify this value directly.

    ignoreDestroy: boolean

    Whether this filter controller will be destroyed when the FilterList that owns it is destroyed. If you enable this, you must ensure that you clean up the filter controller at an appropriate time. This allows you to reuse a controller for multiple objects; this is not recommended unless you know what you're doing. It tends to work best with external filters.

    paddingOverride: Rectangle

    Padding override. This is on by default. If this is set, the filter will use this padding instead of calculating it. Prefer using setPaddingOverride instead of modifying this directly.

    power: number

    An exponent applied to samples. Power above 1 darkens the samples overall, but bright colors are suppressed less than dark ones, causing them to become relatively more dominant in the result. Power below 1 brightens samples overall, reducing the contrast between bright and dark colors. To simulate an HDR environment with bright sunlight that cannot be represented in sRGB color, use high power.

    radius: number

    The radius of the blur effect. 1 samples an entire hemisphere; 0 samples a single point.

    renderNode: string

    The ID of the RenderNode that this filter uses.

    samplesX: number

    The number of samples to take along the X axis. More samples produces a more accurate blur, but at the cost of performance. The X axis in a panorama is usually wider than the Y axis.

    Altering this value triggers a shader re-compile.

    samplesY: number

    The number of samples to take along the Y axis. More samples produces a more accurate blur, but at the cost of performance.

    Altering this value triggers a shader re-compile.

    • Destroys this Controller and nulls any references it holds.

      Returns void

    • Returns the raw padding required for this filter. This is typically not what you want to call; use getPaddingCeil instead. Values from this method are not rounded, which can cause quality loss.

      Override this method when creating a Filter that requires extra room, e.g. a blur or glow effect.undefined

      Returns Rectangle

      The padding required by this filter.

    • Returns the rounded padding required for this filter.

      Most filters don't need extra padding, but some may sample beyond the texture boundaries, such as a blur or glow effect.

      The bounds are encoded as a Rectangle. To enlarge the bounds, the top and left values should be negative, and the bottom and right values should be positive.

      This method calls getPadding() to get the raw padding values, and uses Math.ceil() to set the values of paddingOverride and currentPadding.undefined

      Returns Rectangle

      The rounded padding required by this filter.

    • Sets the active state of this filter.

      A disabled filter will not be used.

      Parameters

      • value: boolean

        true to enable this filter, or false to disable it.

      Returns this

      This filter instance.

    • Sets the padding override. If this is set, the filter will use this padding instead of calculating it. Call setPaddingOverride(null) to clear the override. Call setPaddingOverride() to set the padding to 0.

      Parameters

      • Optionalleft: number | null

        The left padding. Default 0.

      • Optionaltop: number

        The top padding. Default 0.

      • Optionalright: number

        The right padding. Default 0.

      • Optionalbottom: number

        The bottom padding. Default 0.

      Returns void