rhodonite
    Preparing search index...

    Variable createScreenDrawRenderPassWithBaseColorTextureReadonly

    createScreenDrawRenderPassWithBaseColorTexture: (
        engine: Engine,
        material: Material,
        texture: AbstractTexture,
        sampler?: Sampler,
    ) => RenderPass

    Type Declaration

      • (
            engine: Engine,
            material: Material,
            texture: AbstractTexture,
            sampler?: Sampler,
        ): RenderPass
      • Creates a RenderPass for full-screen rendering with a base color texture. This method automatically sets up texture sampling with linear filtering and clamp-to-edge wrapping. A default sampler is created and cached for reuse if no custom sampler is provided.

        Parameters

        • engine: Engine
        • material: Material

          The material to be used for rendering. The base color texture will be bound to this material.

        • texture: AbstractTexture

          The texture to be used as the base color texture for rendering.

        • Optionalsampler: Sampler

          Optional custom sampler for texture sampling. If not provided, a default linear sampler with clamp-to-edge wrapping will be used.

        Returns RenderPass

        A configured RenderPass instance with the texture properly bound to the material.

        const material = new Material();
        const texture = new Texture2D();
        const renderPass = RenderPassHelper.createScreenDrawRenderPassWithBaseColorTexture(material, texture);

        // With custom sampler
        const customSampler = new Sampler({ magFilter: TextureParameter.Nearest });
        const renderPassWithCustomSampler = RenderPassHelper.createScreenDrawRenderPassWithBaseColorTexture(
        material,
        texture,
        customSampler
        );