docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct RenderGraphUtils.BlitMaterialParameters

    This struct specifies all the arugments to the blit-with-material function. As there are many parameters with some of them only rarely used moving them to a struct makes it easier to use the function.

    Use one of the constructor overloads for common use cases.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering.RenderGraphModule.Util
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public struct RenderGraphUtils.BlitMaterialParameters

    Constructors

    BlitMaterialParameters(TextureHandle, TextureHandle, Material, int)

    Simple constructor to set a few amount of parameters to blit.

    Declaration
    public BlitMaterialParameters(TextureHandle source, TextureHandle destination, Material material, int shaderPass)
    Parameters
    Type Name Description
    TextureHandle source

    The texture the data is copied from.

    TextureHandle destination

    The texture the data is copied to.

    Material material

    Material used for blitting.

    int shaderPass

    The shader pass index to use for the material.

    BlitMaterialParameters(TextureHandle, TextureHandle, Material, int, MaterialPropertyBlock, int, int, int, int, int, int, FullScreenGeometryType, int, int, int)

    Constructor to set the source and destination mip and slices as well as material property and IDs to interact with it.

    Declaration
    public BlitMaterialParameters(TextureHandle source, TextureHandle destination, Material material, int shaderPass, MaterialPropertyBlock mpb, int destinationSlice, int destinationMip, int numSlices = 1, int numMips = 1, int sourceSlice = -1, int sourceMip = -1, RenderGraphUtils.FullScreenGeometryType geometry = FullScreenGeometryType.Mesh, int sourceTexturePropertyID = -1, int sourceSlicePropertyID = -1, int sourceMipPropertyID = -1)
    Parameters
    Type Name Description
    TextureHandle source

    The texture the data is copied from.

    TextureHandle destination

    The texture the data is copied to.

    Material material

    Material used for blitting.

    int shaderPass

    The shader pass index to use for the material.

    MaterialPropertyBlock mpb

    Material property block to use to render the blit. This property should contain all data the shader needs.

    int destinationSlice

    The first slice to copy to if the texture is an 3D or array texture. Must be zero for regular textures.

    int destinationMip

    The first mipmap level to copy to. Must be zero for non-mipmapped textures. Must be a valid index for mipmapped textures.

    int numSlices

    The number of slices to copy. -1 to copy all slices until the end of the texture. Arguments that copy invalid slices to be copied will lead to an error.

    int numMips

    The number of mipmaps to copy. -1 to copy all mipmaps. Arguments that copy invalid mips to be copied will lead to an error.

    int sourceSlice

    The first slice to copy from if the texture is an 3D or array texture. Must be zero for regular textures. Default is set to -1 to ignore source slices and set it to 0 without looping for each destination slice

    int sourceMip

    The first mipmap level to copy from. Must be zero for non-mipmapped textures. Must be a valid index for mipmapped textures. Defaults to -1 to ignore source mips and set it to 0 without looping for each destination mip.

    RenderGraphUtils.FullScreenGeometryType geometry

    Geometry used for blitting the source texture.

    int sourceTexturePropertyID

    The texture property to set with the source texture. If -1 the default "_MainTex" texture property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If propertyBlock is null the texture will be applied directly to the material.

    int sourceSlicePropertyID

    The scalar property to set with the source slice index. If -1 the default "_SourceSlice" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one slice is rendered using the blit function (numSlices>1) several full screen quads will be rendered for each slice with different sourceSlicePropertyID values set.

    int sourceMipPropertyID

    The scalar property to set with the source mip index. If -1 the default "_SourceMip" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one mip is rendered using the blit function (numMips>1) several full screen quads will be rendered for each slice with different sourceMipPropertyID values set.

    BlitMaterialParameters(TextureHandle, TextureHandle, Material, int, MaterialPropertyBlock, FullScreenGeometryType, int, int, int)

    Constructor to set textures, material, shader pass and material property block.

    Declaration
    public BlitMaterialParameters(TextureHandle source, TextureHandle destination, Material material, int shaderPass, MaterialPropertyBlock mpb, RenderGraphUtils.FullScreenGeometryType geometry = FullScreenGeometryType.Mesh, int sourceTexturePropertyID = -1, int sourceSlicePropertyID = -1, int sourceMipPropertyID = -1)
    Parameters
    Type Name Description
    TextureHandle source

    The texture the data is copied from.

    TextureHandle destination

    The texture the data is copied to.

    Material material

    Material used for blitting.

    int shaderPass

    The shader pass index to use for the material.

    MaterialPropertyBlock mpb

    Material property block to use to render the blit. This property should contain all data the shader needs.

    RenderGraphUtils.FullScreenGeometryType geometry

    Geometry used for blitting the source texture.

    int sourceTexturePropertyID

    The texture property to set with the source texture. If -1 the default "_MainTex" texture property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If propertyBlock is null the texture will be applied directly to the material.

    int sourceSlicePropertyID

    The scalar property to set with the source slice index. If -1 the default "_SourceSlice" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one slice is rendered using the blit function (numSlices>1) several full screen quads will be rendered for each slice with different sourceSlicePropertyID values set.

    int sourceMipPropertyID

    The scalar property to set with the source mip index. If -1 the default "_SourceMip" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one mip is rendered using the blit function (numMips>1) several full screen quads will be rendered for each slice with different sourceMipPropertyID values set.

    Fields

    destination

    The texture to blit into. This subresources (mips,slices) of this texture texture will be set-up as a render attachment based on the destination argumments.

    Declaration
    public TextureHandle destination
    Field Value
    Type Description
    TextureHandle

    destinationMip

    The first destination mipmap to blit into.

    Declaration
    public int destinationMip
    Field Value
    Type Description
    int

    destinationSlice

    The first slice of the destination texture to blit into.

    Declaration
    public int destinationSlice
    Field Value
    Type Description
    int

    geometry

    The type of full-screen geometry to use when rendering the blit material. See FullScreenGeometryType for details.

    Declaration
    public RenderGraphUtils.FullScreenGeometryType geometry
    Field Value
    Type Description
    RenderGraphUtils.FullScreenGeometryType

    material

    The material to use, cannot be null. The blit functions will not modify this material in any way.

    Declaration
    public Material material
    Field Value
    Type Description
    Material

    numMips

    The number of mipmaps to blit. -1 to blit all mipmaps until the end of the texture starting from destinationMip. Arguments that copy invalid slices (e.g. out of range or zero) will lead to an error.

    Declaration
    public int numMips
    Field Value
    Type Description
    int

    numSlices

    The number of slices to blit. -1 to blit all slices until the end of the texture starting from destinationSlice. Arguments that copy invalid slices (e.g. out of range or zero) will lead to an error.

    Declaration
    public int numSlices
    Field Value
    Type Description
    int

    propertyBlock

    The material propery block to use, can be null. The blit functions will modify the sourceTexturePropertyID, sourceSliceProperty, and sourceMipPropertyID of this material poperty block as part of the blit. Calling propertyBlock's SetTexture(...) function used by BlitMaterialParameters should be avoid since it will cause untracked textures when using RenderGraph. This can cause unexpected behaviours.

    Declaration
    public MaterialPropertyBlock propertyBlock
    Field Value
    Type Description
    MaterialPropertyBlock

    shaderPass

    The shader pass index to use.

    Declaration
    public int shaderPass
    Field Value
    Type Description
    int

    source

    The source texture. This texture will be set on the specified material property block property with the name specified sourceTexturePropertyID. If the property block is null, a temp property block will be allocated by the blit function.

    Declaration
    public TextureHandle source
    Field Value
    Type Description
    TextureHandle

    sourceMip

    The first source mipmap to blit from. -1 to ignore source mips and set it to 0 without looping for each destination mip.

    Declaration
    public int sourceMip
    Field Value
    Type Description
    int

    sourceMipPropertyID

    The scalar property to set with the source mip index. If -1 the default "_SourceMip" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one mip is rendered using the blit function (numMips>1) several full screen quads will be rendered for each slice with different sourceMipPropertyID values set.///

    Declaration
    public int sourceMipPropertyID
    Field Value
    Type Description
    int

    sourceSlice

    The first slice of the source texture to blit from. -1 to ignore source slices and set it to 0 without looping for each destination slice.

    Declaration
    public int sourceSlice
    Field Value
    Type Description
    int

    sourceSlicePropertyID

    The scalar property to set with the source slice index. If -1 the default "_SourceSlice" property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If more than one slice is rendered using the blit function (numSlices>1) several full screen quads will be rendered for each slice with different sourceSlicePropertyID values set.

    Declaration
    public int sourceSlicePropertyID
    Field Value
    Type Description
    int

    sourceTexturePropertyID

    The texture property to set with the source texture. If -1 the default "_MainTex" texture property will be used. Note: Use Shader.PropertyToID to convert a string property name to an ID. If propertyBlock is null the texture will be applied directly to the material.

    Declaration
    public int sourceTexturePropertyID
    Field Value
    Type Description
    int

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)