Viewer
    Preparing search index...

    Class GridEffect

    A grid effect.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a new grid effect.

      Parameters

      • Optionaloptions: { blendFunction?: BlendFunction; lineWidth?: number; scale?: number }

        The options.

        • OptionalblendFunction?: BlendFunction

          The blend function of this effect.

        • OptionallineWidth?: number

          The line width of the grid pattern.

        • Optionalscale?: number

          The scale of the grid pattern.

      Returns GridEffect

    Properties

    blendMode: BlendMode

    The blend mode of this effect.

    defines: Map<string, string>

    Preprocessor macro definitions.

    Call Effect.setChanged after changing macro definitions.

    extensions: Set<WebGLExtension>

    WebGL extensions that are required by this effect.

    Call Effect.setChanged after adding or removing extensions.

    name: string

    The name of this effect.

    renderer: WebGLRenderer

    The renderer.

    uniforms: Map<string, Uniform<any>>

    Shader uniforms.

    Call Effect.setChanged after adding or removing uniforms.

    Accessors

    • get lineWidth(): number

      The line width.

      Returns number

    • set lineWidth(arg: number): void

      Parameters

      • arg: number

      Returns void

    • get scale(): number

      The scale.

      Returns number

    • set scale(arg: number): void

      Parameters

      • arg: number

      Returns void

    Methods

    • Performs a shallow search for properties that define a dispose method and deletes them.

      The EffectComposer calls this method when it is being destroyed.

      Returns void

    • Returns the blend mode.

      The result of this effect will be blended with the result of the previous effect using this blend mode.

      Returns BlendMode

      The blend mode.

      Use blendMode instead.

    • Returns the preprocessor macro definitions.

      Returns Map<string, string>

      The extensions.

      Use defines instead.

    • Returns the fragment shader.

      Returns string

      The fragment shader.

    • Returns the current grid line width.

      Returns number

      The grid line width.

      Use lineWidth instead.

    • Returns the name of this effect.

      Returns string

      The name.

      Use name instead.

    • Returns the current grid scale.

      Returns number

      The grid scale.

      Use scale instead.

    • Returns the uniforms of this effect.

      Returns Map<string, Uniform<any>>

      The extensions.

      Use uniforms instead.

    • Returns the vertex shader.

      Returns string

      The vertex shader.

    • Performs initialization tasks.

      This method is called when the associated EffectPass is added to an EffectComposer.

      Parameters

      • renderer: WebGLRenderer

        The renderer.

      • alpha: boolean

        Whether the renderer uses the alpha channel or not.

      • frameBufferType: number

        The type of the main frame buffers.

      Returns void

      if(!alpha && frameBufferType === UnsignedByteType) { this.myRenderTarget.texture.format = RGBFormat; }
      
    • Protected

      Sets the effect attributes.

      Effects that have the same attributes will be executed in the order in which they were registered. Some attributes imply a higher priority.

      Parameters

      Returns void

    • Protected

      Informs the associated EffectPass that this effect requires a shader recompilation.

      Should be called after changing macros or extensions and after adding/removing uniforms.

      Returns void

    • Protected

      Sets the fragment shader.

      Parameters

      • fragmentShader: string

        The fragment shader.

      Returns void

    • Sets the grid line width.

      Parameters

      • value: number

        The new grid line width.

      Returns void

      Use lineWidth instead.

    • Sets the grid scale.

      Parameters

      • value: number

        The new grid scale.

      Returns void

      Use scale instead.

    • Updates the size of this pass.

      Parameters

      • width: number

        The width.

      • height: number

        The height.

      Returns void

    • Protected

      Sets the vertex shader.

      Parameters

      • vertexShader: string

        The vertex shader.

      Returns void

    • Updates this effect by performing supporting operations.

      This method is called by the EffectPass right before the main fullscreen render operation, even if the blend function is set to SKIP.

      You may override this method if you need to update custom uniforms or render additional off-screen textures.

      Parameters

      • renderer: WebGLRenderer

        The renderer.

      • inputBuffer: WebGLRenderTarget

        A frame buffer that contains the result of the previous pass.

      • OptionaldeltaTime: number

        The time between the last frame and the current one in seconds.

      Returns void