update(entity)
    {
        if (entity.filters.length === 0) return;

        // stop obj renderer
        this.renderer.activeObjectRenderer.stop();

        // process the filters
        this.quad.map(FilterUtils.activeRenderTarget, FilterUtils.activeBounds).upload();

        if (entity.filters.length === 1)
        {
            const filter = entity.filters[0];

            if (filter.enable)
            {
                filter.run(this, FilterUtils.activeRenderTarget, FilterUtils.initialRenderTarget, false);
            }
        }
        else
        {
            const activeFilters = [];
            let flip = FilterUtils.activeRenderTarget;
            let flop = FilterUtils.getRenderTarget(this.renderer.gl);
            let i = 0;

            for (i = 0; i < entity.filters.length - 1; ++i)
            {
                if (entity.filters[i].enable)
                {
                    activeFilters.push(entity.filters[i]);
                }
            }

            for (i = 0; i < activeFilters.length - 1; ++i)
            {
                const filter = activeFilters[i];

                filter.run(this, flip, flop, true);

                const t = flip;

                flip = flop;
                flop = t;
            }

            activeFilters[i].run(this, flip, FilterUtils.initialRenderTarget, false);

            FilterUtils.freeRenderTarget(flop);
        }

        // start obj renderer
        this.renderer.activeObjectRenderer.start();
    }
/**
     * Render the entity using filtered rendering.
     *
     * @param {Entity} entity - The entity to update
     */
Render the entity using filtered rendering.
@param {Entity} entity - The entity to update
Render the entity using filtered rendering . @param { Entity } entity - The entity to update
update(entity)
    {
        if (entity.filters.length === 0) return;
        this.renderer.activeObjectRenderer.stop();
        this.quad.map(FilterUtils.activeRenderTarget, FilterUtils.activeBounds).upload();
        if (entity.filters.length === 1)
        {
            const filter = entity.filters[0];
            if (filter.enable)
            {
                filter.run(this, FilterUtils.activeRenderTarget, FilterUtils.initialRenderTarget, false);
            }
        }
        else
        {
            const activeFilters = [];
            let flip = FilterUtils.activeRenderTarget;
            let flop = FilterUtils.getRenderTarget(this.renderer.gl);
            let i = 0;
            for (i = 0; i < entity.filters.length - 1; ++i)
            {
                if (entity.filters[i].enable)
                {
                    activeFilters.push(entity.filters[i]);
                }
            }
            for (i = 0; i < activeFilters.length - 1; ++i)
            {
                const filter = activeFilters[i];
                filter.run(this, flip, flop, true);
                const t = flip;
                flip = flop;
                flop = t;
            }
            activeFilters[i].run(this, flip, FilterUtils.initialRenderTarget, false);
            FilterUtils.freeRenderTarget(flop);
        }
        this.renderer.activeObjectRenderer.start();
    }
update ( entity ) { if ( entity . filters . length === 0 ) return ; this . renderer . activeObjectRenderer . stop ( ) ; this . quad . map ( FilterUtils . activeRenderTarget , FilterUtils . activeBounds ) . upload ( ) ; if ( entity . filters . length === 1 ) { const filter = entity . filters [ 0 ] ; if ( filter . enable ) { filter . run ( this , FilterUtils . activeRenderTarget , FilterUtils . initialRenderTarget , false ) ; } } else { const activeFilters = [ ] ; let flip = FilterUtils . activeRenderTarget ; let flop = FilterUtils . getRenderTarget ( this . renderer . gl ) ; let i = 0 ; for ( i = 0 ; i < entity . filters . length - 1 ; ++ i ) { if ( entity . filters [ i ] . enable ) { activeFilters . push ( entity . filters [ i ] ) ; } } for ( i = 0 ; i < activeFilters . length - 1 ; ++ i ) { const filter = activeFilters [ i ] ; filter . run ( this , flip , flop , true ) ; const t = flip ; flip = flop ; flop = t ; } activeFilters [ i ] . run ( this , flip , FilterUtils . initialRenderTarget , false ) ; FilterUtils . freeRenderTarget ( flop ) ; } this . renderer . activeObjectRenderer . start ( ) ; }
Render the entity using filtered rendering.
Render the entity using filtered rendering .
// stop obj renderer // process the filters // start obj renderer