import { RenderPass } from './renderpass.js';
import { RENDER_PASS_TYPE_OBJECT_COLOR } from '../values.js';
import { ShaderHelper } from '../material/shader/helper.js';

/**
 * Object color render pass
 * @internal
 */ class ObjectColorPass extends RenderPass {
    /**
   * Creates an instance of ForwardRenderPass
   */ constructor(){
        super(RENDER_PASS_TYPE_OBJECT_COLOR);
    }
    /** @internal */ _getGlobalBindGroupHash(_ctx) {
        return '';
    }
    /** @internal */ renderItems(ctx, camera, renderQueue) {
        const items = renderQueue.itemList;
        if (items) {
            ctx.drawEnvLight = false;
            ctx.env = null;
            ctx.flip = this.isAutoFlip(ctx);
            ctx.renderPassHash = this.getGlobalBindGroupHash(ctx, camera);
            const bindGroup = ctx.globalBindGroupAllocator.getGlobalBindGroup(ctx);
            ctx.device.setBindGroup(0, bindGroup);
            ShaderHelper.setCameraUniforms(bindGroup, ctx, camera, true);
            const reverseWinding = camera.worldMatrixDet < 0;
            for (const list of [
                items.opaque,
                items.transmission,
                items.transparent,
                items.transmission_trans
            ]){
                if (list) {
                    for (const lit of list.lit){
                        this.drawItemList(lit, ctx, reverseWinding);
                    }
                    for (const unlit of list.unlit){
                        this.drawItemList(unlit, ctx, reverseWinding);
                    }
                }
            }
        }
    }
}

export { ObjectColorPass };
//# sourceMappingURL=objectcolorpass.js.map
