Documentation
¶
Overview ¶
Package mpsrayintersector provides purego-based Go bindings for the macOS MPSRayIntersector framework.
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector
Index ¶
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MPSAccelerationStructure
- func (o *MPSAccelerationStructure) BoundingBox() MPSAxisAlignedBoundingBox
- func (o *MPSAccelerationStructure) CopyWithZoneGroup(zone unsafe.Pointer, group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
- func (o *MPSAccelerationStructure) EncodeRefitToCommandBuffer(commandBuffer metal.MTLCommandBuffer)
- func (o *MPSAccelerationStructure) EncodeWithCoder(coder *foundation.NSCoder)
- func (o *MPSAccelerationStructure) Group() *MPSAccelerationStructureGroup
- func (o *MPSAccelerationStructure) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSAccelerationStructure
- func (o *MPSAccelerationStructure) InitWithCoderGroup(aDecoder *foundation.NSCoder, group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
- func (o *MPSAccelerationStructure) InitWithDevice(device metal.MTLDevice) *MPSAccelerationStructure
- func (o *MPSAccelerationStructure) InitWithGroup(group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
- func (o *MPSAccelerationStructure) Rebuild()
- func (o *MPSAccelerationStructure) RebuildWithCompletionHandler(completionHandler func(*MPSAccelerationStructure))
- func (o *MPSAccelerationStructure) SetUsage(usage MPSAccelerationStructureUsage)
- func (o *MPSAccelerationStructure) Status() MPSAccelerationStructureStatus
- func (o *MPSAccelerationStructure) Usage() MPSAccelerationStructureUsage
- type MPSAccelerationStructureGroup
- type MPSAccelerationStructureStatus
- type MPSAccelerationStructureUsage
- type MPSAxisAlignedBoundingBox
- type MPSBoundingBoxIntersectionTestType
- type MPSInstanceAccelerationStructure
- func (o *MPSInstanceAccelerationStructure) AccelerationStructures() *foundation.NSArray[*MPSPolygonAccelerationStructure]
- func (o *MPSInstanceAccelerationStructure) InstanceBuffer() metal.MTLBuffer
- func (o *MPSInstanceAccelerationStructure) InstanceBufferOffset() uint
- func (o *MPSInstanceAccelerationStructure) InstanceCount() uint
- func (o *MPSInstanceAccelerationStructure) MaskBuffer() metal.MTLBuffer
- func (o *MPSInstanceAccelerationStructure) MaskBufferOffset() uint
- func (o *MPSInstanceAccelerationStructure) SetAccelerationStructures(accelerationStructures *foundation.NSArray[*MPSPolygonAccelerationStructure])
- func (o *MPSInstanceAccelerationStructure) SetInstanceBuffer(instanceBuffer metal.MTLBuffer)
- func (o *MPSInstanceAccelerationStructure) SetInstanceBufferOffset(instanceBufferOffset uint)
- func (o *MPSInstanceAccelerationStructure) SetInstanceCount(instanceCount uint)
- func (o *MPSInstanceAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)
- func (o *MPSInstanceAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)
- func (o *MPSInstanceAccelerationStructure) SetTransformBuffer(transformBuffer metal.MTLBuffer)
- func (o *MPSInstanceAccelerationStructure) SetTransformBufferOffset(transformBufferOffset uint)
- func (o *MPSInstanceAccelerationStructure) SetTransformType(transformType MPSTransformType)
- func (o *MPSInstanceAccelerationStructure) TransformBuffer() metal.MTLBuffer
- func (o *MPSInstanceAccelerationStructure) TransformBufferOffset() uint
- func (o *MPSInstanceAccelerationStructure) TransformType() MPSTransformType
- type MPSIntersectionDataType
- type MPSIntersectionDistance
- type MPSIntersectionDistancePrimitiveIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex
- type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexCoordinates
- type MPSIntersectionDistancePrimitiveIndexInstanceIndex
- type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates
- type MPSIntersectionType
- type MPSPackedFloat3
- type MPSPolygonAccelerationStructure
- func (o *MPSPolygonAccelerationStructure) IndexBuffer() metal.MTLBuffer
- func (o *MPSPolygonAccelerationStructure) IndexBufferOffset() uint
- func (o *MPSPolygonAccelerationStructure) IndexType() mpscore.MPSDataType
- func (o *MPSPolygonAccelerationStructure) MaskBuffer() metal.MTLBuffer
- func (o *MPSPolygonAccelerationStructure) MaskBufferOffset() uint
- func (o *MPSPolygonAccelerationStructure) PolygonBuffers() *foundation.NSArray[*MPSPolygonBuffer]
- func (o *MPSPolygonAccelerationStructure) PolygonCount() uint
- func (o *MPSPolygonAccelerationStructure) PolygonType() MPSPolygonType
- func (o *MPSPolygonAccelerationStructure) SetIndexBuffer(indexBuffer metal.MTLBuffer)
- func (o *MPSPolygonAccelerationStructure) SetIndexBufferOffset(indexBufferOffset uint)
- func (o *MPSPolygonAccelerationStructure) SetIndexType(indexType mpscore.MPSDataType)
- func (o *MPSPolygonAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)
- func (o *MPSPolygonAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)
- func (o *MPSPolygonAccelerationStructure) SetPolygonBuffers(polygonBuffers *foundation.NSArray[*MPSPolygonBuffer])
- func (o *MPSPolygonAccelerationStructure) SetPolygonCount(polygonCount uint)
- func (o *MPSPolygonAccelerationStructure) SetPolygonType(polygonType MPSPolygonType)
- func (o *MPSPolygonAccelerationStructure) SetVertexBuffer(vertexBuffer metal.MTLBuffer)
- func (o *MPSPolygonAccelerationStructure) SetVertexBufferOffset(vertexBufferOffset uint)
- func (o *MPSPolygonAccelerationStructure) SetVertexStride(vertexStride uint)
- func (o *MPSPolygonAccelerationStructure) VertexBuffer() metal.MTLBuffer
- func (o *MPSPolygonAccelerationStructure) VertexBufferOffset() uint
- func (o *MPSPolygonAccelerationStructure) VertexStride() uint
- type MPSPolygonBuffer
- func (o *MPSPolygonBuffer) IndexBuffer() metal.MTLBuffer
- func (o *MPSPolygonBuffer) IndexBufferOffset() uint
- func (o *MPSPolygonBuffer) Init() *MPSPolygonBuffer
- func (o *MPSPolygonBuffer) InitWithCoder(aDecoder *foundation.NSCoder) *MPSPolygonBuffer
- func (o *MPSPolygonBuffer) MaskBuffer() metal.MTLBuffer
- func (o *MPSPolygonBuffer) MaskBufferOffset() uint
- func (o *MPSPolygonBuffer) PolygonCount() uint
- func (o *MPSPolygonBuffer) SetIndexBuffer(indexBuffer metal.MTLBuffer)
- func (o *MPSPolygonBuffer) SetIndexBufferOffset(indexBufferOffset uint)
- func (o *MPSPolygonBuffer) SetMaskBuffer(maskBuffer metal.MTLBuffer)
- func (o *MPSPolygonBuffer) SetMaskBufferOffset(maskBufferOffset uint)
- func (o *MPSPolygonBuffer) SetPolygonCount(polygonCount uint)
- func (o *MPSPolygonBuffer) SetVertexBuffer(vertexBuffer metal.MTLBuffer)
- func (o *MPSPolygonBuffer) SetVertexBufferOffset(vertexBufferOffset uint)
- func (o *MPSPolygonBuffer) VertexBuffer() metal.MTLBuffer
- func (o *MPSPolygonBuffer) VertexBufferOffset() uint
- type MPSPolygonType
- type MPSQuadrilateralAccelerationStructure
- type MPSRayDataType
- type MPSRayIntersector
- func (o *MPSRayIntersector) BoundingBoxIntersectionTestType() MPSBoundingBoxIntersectionTestType
- func (o *MPSRayIntersector) CullMode() metal.MTLCullMode
- func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, ...)
- func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountBufferRayCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, ...)
- func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, ...)
- func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountBufferRayIndexCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, ...)
- func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayTextureIntersectionTextureAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, ...)
- func (o *MPSRayIntersector) EncodeWithCoder(coder *foundation.NSCoder)
- func (o *MPSRayIntersector) FrontFacingWinding() metal.MTLWinding
- func (o *MPSRayIntersector) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSRayIntersector
- func (o *MPSRayIntersector) InitWithDevice(device metal.MTLDevice) *MPSRayIntersector
- func (o *MPSRayIntersector) IntersectionDataType() MPSIntersectionDataType
- func (o *MPSRayIntersector) IntersectionStride() uint
- func (o *MPSRayIntersector) RayDataType() MPSRayDataType
- func (o *MPSRayIntersector) RayIndexDataType() mpscore.MPSDataType
- func (o *MPSRayIntersector) RayMask() uint
- func (o *MPSRayIntersector) RayMaskOperator() MPSRayMaskOperator
- func (o *MPSRayIntersector) RayMaskOptions() MPSRayMaskOptions
- func (o *MPSRayIntersector) RayStride() uint
- func (o *MPSRayIntersector) RecommendedMinimumRayBatchSizeForRayCount(rayCount uint) uint
- func (o *MPSRayIntersector) SetBoundingBoxIntersectionTestType(boundingBoxIntersectionTestType MPSBoundingBoxIntersectionTestType)
- func (o *MPSRayIntersector) SetCullMode(cullMode metal.MTLCullMode)
- func (o *MPSRayIntersector) SetFrontFacingWinding(frontFacingWinding metal.MTLWinding)
- func (o *MPSRayIntersector) SetIntersectionDataType(intersectionDataType MPSIntersectionDataType)
- func (o *MPSRayIntersector) SetIntersectionStride(intersectionStride uint)
- func (o *MPSRayIntersector) SetRayDataType(rayDataType MPSRayDataType)
- func (o *MPSRayIntersector) SetRayIndexDataType(rayIndexDataType mpscore.MPSDataType)
- func (o *MPSRayIntersector) SetRayMask(rayMask uint)
- func (o *MPSRayIntersector) SetRayMaskOperator(rayMaskOperator MPSRayMaskOperator)
- func (o *MPSRayIntersector) SetRayMaskOptions(rayMaskOptions MPSRayMaskOptions)
- func (o *MPSRayIntersector) SetRayStride(rayStride uint)
- func (o *MPSRayIntersector) SetTriangleIntersectionTestType(triangleIntersectionTestType MPSTriangleIntersectionTestType)
- func (o *MPSRayIntersector) TriangleIntersectionTestType() MPSTriangleIntersectionTestType
- type MPSRayMaskOperator
- type MPSRayMaskOptions
- type MPSRayOriginDirection
- type MPSRayOriginMaskDirectionMaxDistance
- type MPSRayOriginMinDistanceDirectionMaxDistance
- type MPSRayPackedOriginDirection
- type MPSSVGF
- func (o *MPSSVGF) BilateralFilterRadius() uint
- func (o *MPSSVGF) BilateralFilterSigma() float32
- func (o *MPSSVGF) ChannelCount() uint
- func (o *MPSSVGF) ChannelCount2() uint
- func (o *MPSSVGF) DepthWeight() float32
- func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, ...)
- func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureSourceTexture2DestinationTexture2DepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, ...)
- func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTextureSourceTexture2PreviousTexture2DestinationTexture2PreviousLuminanceMomentsTexture2DestinationLuminanceMomentsTexture2PreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureSourceTexture2LuminanceMomentsTexture2DestinationTexture2FrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSSVGF) EncodeWithCoder(coder *foundation.NSCoder)
- func (o *MPSSVGF) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSSVGF
- func (o *MPSSVGF) InitWithDevice(device metal.MTLDevice) *MPSSVGF
- func (o *MPSSVGF) LuminanceWeight() float32
- func (o *MPSSVGF) MinimumFramesForVarianceEstimation() uint
- func (o *MPSSVGF) NormalWeight() float32
- func (o *MPSSVGF) ReprojectionThreshold() float32
- func (o *MPSSVGF) SetBilateralFilterRadius(bilateralFilterRadius uint)
- func (o *MPSSVGF) SetBilateralFilterSigma(bilateralFilterSigma float32)
- func (o *MPSSVGF) SetChannelCount(channelCount uint)
- func (o *MPSSVGF) SetChannelCount2(channelCount2 uint)
- func (o *MPSSVGF) SetDepthWeight(depthWeight float32)
- func (o *MPSSVGF) SetLuminanceWeight(luminanceWeight float32)
- func (o *MPSSVGF) SetMinimumFramesForVarianceEstimation(minimumFramesForVarianceEstimation uint)
- func (o *MPSSVGF) SetNormalWeight(normalWeight float32)
- func (o *MPSSVGF) SetReprojectionThreshold(reprojectionThreshold float32)
- func (o *MPSSVGF) SetTemporalReprojectionBlendFactor(temporalReprojectionBlendFactor float32)
- func (o *MPSSVGF) SetTemporalWeighting(temporalWeighting MPSTemporalWeighting)
- func (o *MPSSVGF) SetVarianceEstimationRadius(varianceEstimationRadius uint)
- func (o *MPSSVGF) SetVarianceEstimationSigma(varianceEstimationSigma float32)
- func (o *MPSSVGF) SetVariancePrefilterRadius(variancePrefilterRadius uint)
- func (o *MPSSVGF) SetVariancePrefilterSigma(variancePrefilterSigma float32)
- func (o *MPSSVGF) TemporalReprojectionBlendFactor() float32
- func (o *MPSSVGF) TemporalWeighting() MPSTemporalWeighting
- func (o *MPSSVGF) VarianceEstimationRadius() uint
- func (o *MPSSVGF) VarianceEstimationSigma() float32
- func (o *MPSSVGF) VariancePrefilterRadius() uint
- func (o *MPSSVGF) VariancePrefilterSigma() float32
- type MPSSVGFDefaultTextureAllocator
- func (o *MPSSVGFDefaultTextureAllocator) AllocatedTextureCount() uint
- func (o *MPSSVGFDefaultTextureAllocator) Device() metal.MTLDevice
- func (o *MPSSVGFDefaultTextureAllocator) InitWithDevice(device metal.MTLDevice) *MPSSVGFDefaultTextureAllocator
- func (o *MPSSVGFDefaultTextureAllocator) Reset()
- func (o *MPSSVGFDefaultTextureAllocator) ReturnTexture(texture metal.MTLTexture)
- func (o *MPSSVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight(pixelFormat metal.MTLPixelFormat, width uint, height uint) metal.MTLTexture
- type MPSSVGFDenoiser
- func (o *MPSSVGFDenoiser) BilateralFilterIterations() uint
- func (o *MPSSVGFDenoiser) ClearTemporalHistory()
- func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureDestinationTextureSourceTexture2DestinationTexture2MotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...) metal.MTLTexture
- func (o *MPSSVGFDenoiser) InitWithDevice(device metal.MTLDevice) *MPSSVGFDenoiser
- func (o *MPSSVGFDenoiser) InitWithSVGFTextureAllocator(svgf *MPSSVGF, textureAllocator MPSSVGFTextureAllocator) *MPSSVGFDenoiser
- func (o *MPSSVGFDenoiser) ReleaseTemporaryTextures()
- func (o *MPSSVGFDenoiser) SetBilateralFilterIterations(bilateralFilterIterations uint)
- func (o *MPSSVGFDenoiser) Svgf() *MPSSVGF
- func (o *MPSSVGFDenoiser) TextureAllocator() MPSSVGFTextureAllocator
- type MPSSVGFTextureAllocator
- type MPSTemporalAA
- func (o *MPSTemporalAA) BlendFactor() float32
- func (o *MPSTemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, ...)
- func (o *MPSTemporalAA) EncodeWithCoder(coder *foundation.NSCoder)
- func (o *MPSTemporalAA) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSTemporalAA
- func (o *MPSTemporalAA) InitWithDevice(device metal.MTLDevice) *MPSTemporalAA
- func (o *MPSTemporalAA) SetBlendFactor(blendFactor float32)
- type MPSTemporalWeighting
- type MPSTransformType
- type MPSTriangleAccelerationStructure
- type MPSTriangleIntersectionTestType
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type Os_clockid_t
- type Ptrauth_key
- type Qos_class_t
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int64
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int64
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int64
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int64
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int64
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t int64
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type Launch_data_type_t ¶
type Launch_data_type_t int64
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int64
@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int64
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int64
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type MPSAccelerationStructure ¶
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsaccelerationstructure
func MPSAccelerationStructureFromID ¶
func MPSAccelerationStructureFromID(id objc.ID) *MPSAccelerationStructure
func (*MPSAccelerationStructure) BoundingBox ¶
func (o *MPSAccelerationStructure) BoundingBox() MPSAxisAlignedBoundingBox
@brief The bounding box fully enclosing the geometry this acceleration structure was built over. @discussion The value of this property is not available until the acceleration structure has finished rebuilding or refitting
func (*MPSAccelerationStructure) CopyWithZoneGroup ¶
func (o *MPSAccelerationStructure) CopyWithZoneGroup(zone unsafe.Pointer, group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
@brief Create a a copy of this acceleration structure @discussion The acceleration structure may be copied with a different acceleration structure group. Buffer properties of the acceleration structure such as the vertex buffer, instance buffer, etc. are set to nil. Copy these buffers with the new Metal device and assign them to the new acceleration structure instead. Do not copy the acceleration structure until any prior refit or rebuild operations have completed. @param zone This parameter is ignored. Memory zones are no longer used by Objective-C. @param group New acceleration structure group
func (*MPSAccelerationStructure) EncodeRefitToCommandBuffer ¶
func (o *MPSAccelerationStructure) EncodeRefitToCommandBuffer(commandBuffer metal.MTLCommandBuffer)
@brief Refit the existing acceleration structure to new data @discussion This method is used to refit the acceleration structure to new vertex data, index data, instance data, etc. while preserving the existing acceleration structure topology. This is typically much faster than a full rebuild of the acceleration structure. Refitting can also be pipelined with other GPU work such as ray intersection. Until the command buffer has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, or rebuilt. Changes to properties such as the triangle count or instance count might not be reflected. These changes require that the acceleration structure be rebuilt instead. The acceleration structure must be rebuilt at least once before this method can be called.
func (*MPSAccelerationStructure) EncodeWithCoder ¶
func (o *MPSAccelerationStructure) EncodeWithCoder(coder *foundation.NSCoder)
@brief Encode the acceleration structure with an NSCoder @discussion Buffer properties such as the vertex buffer, index buffer, etc. are not be encoded. Encode and decode these buffers along with the acceleration structure instead. Do not encode the acceleration structure until any prior refit or rebuild operations have completed. @param coder An archiver object
func (*MPSAccelerationStructure) Group ¶
func (o *MPSAccelerationStructure) Group() *MPSAccelerationStructureGroup
@brief The group this acceleration structure was created with
func (*MPSAccelerationStructure) InitWithCoderDevice ¶
func (o *MPSAccelerationStructure) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSAccelerationStructure
@brief Initialize the acceleration structure with an NSCoder and a Metal device. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the acceleration structure instead.
func (*MPSAccelerationStructure) InitWithCoderGroup ¶
func (o *MPSAccelerationStructure) InitWithCoderGroup(aDecoder *foundation.NSCoder, group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
@brief Initialize the acceleration structure with an NSCoder and an acceleration structure group, if the acceleration structure will be used in an instance hierarchy. All acceleration structures in the instance hierarchy must share the same group. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the acceleration structure instead.
func (*MPSAccelerationStructure) InitWithDevice ¶
func (o *MPSAccelerationStructure) InitWithDevice(device metal.MTLDevice) *MPSAccelerationStructure
@brief Initialize the acceleration structure with a Metal device
func (*MPSAccelerationStructure) InitWithGroup ¶
func (o *MPSAccelerationStructure) InitWithGroup(group *MPSAccelerationStructureGroup) *MPSAccelerationStructure
@brief Initialize the acceleration structure with an acceleration structure group, if the acceleration structure will be used in an instance hierarchy. @discussion The Metal device is determined from the acceleration structure group. All acceleration structures in the instance hierarchy must share the same group.
func (*MPSAccelerationStructure) Rebuild ¶
func (o *MPSAccelerationStructure) Rebuild()
@brief Rebuild the acceleration structure @discussion This method must be called before any intersection tests can be scheduled with this acceleration structure. Before calling this method, fill out the properties of the acceleration structure such as vertex buffer, instance buffer, etc. The acceleration structure should be rebuilt when its contents (e.g. vertices in a triangle acceleration structure) have been modified significantly and must be rebuilt when properties such as triangle count, vertex stride, etc. have changed. When the contents of the acceleration structure have only been modified slightly, it may be cheaper to refit the acceleration structure instead. This method blocks until the acceleration structure has been rebuilt. Until the rebuild has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, rebuilt, or refit. Before this method can be called, any pending GPU writes to the vertex buffer, index buffer, etc. must be completed (and, for managed buffers, synchronized). Any prior intersection tests must also be completed before the acceleration structure can be rebuilt.
func (*MPSAccelerationStructure) RebuildWithCompletionHandler ¶
func (o *MPSAccelerationStructure) RebuildWithCompletionHandler(completionHandler func(*MPSAccelerationStructure))
@brief Rebuild the acceleration structure asynchronously @discussion This method must be called before any intersection tests can be scheduled with this acceleration structure. Before calling this method, fill out the properties of the acceleration structure such as vertex buffer, instance buffer, etc. The acceleration structure should be rebuilt when its contents (e.g. vertices in a triangle acceleration structure) have been modified significantly and must be rebuilt when properties such as triangle count, vertex stride, etc. have changed. When the contents of the acceleration structure have only been modified slightly, it may be cheaper to refit the acceleration structure instead. Until the rebuild has completed, the acceleration structure cannot be copied, encoded with NSSecureCoding, rebuilt, or refit. Before this method can be called, any pending GPU writes to the vertex buffer, index buffer, etc. must be completed (and, for managed buffers, synchronized). Any prior intersection tests must also be completed before the acceleration structure can be rebuilt.
func (*MPSAccelerationStructure) SetUsage ¶
func (o *MPSAccelerationStructure) SetUsage(usage MPSAccelerationStructureUsage)
func (*MPSAccelerationStructure) Status ¶
func (o *MPSAccelerationStructure) Status() MPSAccelerationStructureStatus
@brief Status indicating whether the acceleration structure has finished building
func (*MPSAccelerationStructure) Usage ¶
func (o *MPSAccelerationStructure) Usage() MPSAccelerationStructureUsage
@brief Acceleration structure usage options. Changes to this property require rebuilding the acceleration structure. Defaults to MPSAccelerationStructureUsageNone.
type MPSAccelerationStructureGroup ¶
type MPSAccelerationStructureGroup struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsaccelerationstructuregroup
func MPSAccelerationStructureGroupFromID ¶
func MPSAccelerationStructureGroupFromID(id objc.ID) *MPSAccelerationStructureGroup
func (*MPSAccelerationStructureGroup) Device ¶
func (o *MPSAccelerationStructureGroup) Device() metal.MTLDevice
@brief The Metal device this acceleration structure group was created with
func (*MPSAccelerationStructureGroup) InitWithDevice ¶
func (o *MPSAccelerationStructureGroup) InitWithDevice(device metal.MTLDevice) *MPSAccelerationStructureGroup
type MPSAccelerationStructureStatus ¶
type MPSAccelerationStructureStatus uint64
@brief Possible values of the acceleration structure status property
const ( // @brief The acceleration structure has not been built yet MPSAccelerationStructureStatusUnbuilt MPSAccelerationStructureStatus = 0 // @brief The acceleration structure has finished building MPSAccelerationStructureStatusBuilt MPSAccelerationStructureStatus = 1 )
func (MPSAccelerationStructureStatus) String ¶
func (e MPSAccelerationStructureStatus) String() string
type MPSAccelerationStructureUsage ¶
type MPSAccelerationStructureUsage uint64
@brief Options describing how an acceleration structure will be used
const ( // @brief No usage options specified MPSAccelerationStructureUsageNone MPSAccelerationStructureUsage = 0 // @brief Enable support for refitting the acceleration structure after it has been built. This option may reduce raytracing performance so do not use it unless the acceleration structure will be refit. MPSAccelerationStructureUsageRefit MPSAccelerationStructureUsage = 1 // @brief Option indicating that the acceleration structure will be rebuilt frequently. In this case, the acceleration structure may choose a higher performance but lower quality acceleration structure construction algorithm. This option may reduce raytracing performance performance so do not use it unless reduced acceleration structure build time is worth reduced raytracing performance. This option may be useful if, for example, the user is interactively editing a live view of the scene. MPSAccelerationStructureUsageFrequentRebuild MPSAccelerationStructureUsage = 2 // @brief Prefer building the acceleration structure on the GPU. By default, the acceleration structure will be built on the GPU when possible. However, in some cases such as very small triangle counts, the acceleration structure may be built on the CPU. This option will force the acceleration structure to be always be built on the GPU whenever possible. MPSAccelerationStructureUsagePreferGPUBuild MPSAccelerationStructureUsage = 4 // @brief Prefer building the acceleration structure on the CPU. By default, the acceleration structure will be built on the GPU when possible, which is typically much faster than building on the CPU. However, in some cases it may be preferable to build on the CPU such as to avoid framerate hitches when the GPU is rendering the user interface. MPSAccelerationStructureUsagePreferCPUBuild MPSAccelerationStructureUsage = 8 )
func (MPSAccelerationStructureUsage) String ¶
func (e MPSAccelerationStructureUsage) String() string
type MPSAxisAlignedBoundingBox ¶
@brief An axis aligned bounding box with a min and max point C struct: _MPSAxisAlignedBoundingBox
type MPSBoundingBoxIntersectionTestType ¶
type MPSBoundingBoxIntersectionTestType uint64
@brief Options for the MPSRayIntersector bounding box intersection test type property
const ( // @brief Use the default MPSBoundingBoxIntersectionTestTypeAxisAligned ray/bounding box intersection test. Note: this option was equivalent to MPSBoundingBoxIntersectionTestTypeFast in macOS 10.14/iOS 12.0. This option was changed in macOS 10.15/iOS 13.0 to handle axis-aligned rays correctly by default. The old behavior can be restored by explicitly setting the intersection test type to MPSBoundingBoxIntersectionTestTypeFast on macOS 10.15/iOS 13.0 and above. MPSBoundingBoxIntersectionTestTypeDefault MPSBoundingBoxIntersectionTestType = 0 // @brief This intersection test is potentially slower than MPSBoundingBoxIntersectionTestTypeFast but does not generate false negatives for axis aligned rays (i.e. rays which have one or more components of their direction set to zero). These rays often do not come up in practice due to perspective projections and randomized ray distributions. However, synthetic ray distributions or orthographic projections can generate these rays. It may be faster to slightly perturb the ray direction and use the fast intersection test type. MPSBoundingBoxIntersectionTestTypeAxisAligned MPSBoundingBoxIntersectionTestType = 1 // @brief This intersection test is potentially faster than MPSBoundingBoxIntersectionTestTypeAxisAligned but can generate false negatives for axis aligned rays (i.e. rays which have one or more components of their direction set to zero). These rays often do not come up in practice due to perspective projections and randomized ray distributions. However, synthetic ray distributions or orthographic projections can generate these rays. MPSBoundingBoxIntersectionTestTypeFast MPSBoundingBoxIntersectionTestType = 2 )
func (MPSBoundingBoxIntersectionTestType) String ¶
func (e MPSBoundingBoxIntersectionTestType) String() string
type MPSInstanceAccelerationStructure ¶
type MPSInstanceAccelerationStructure struct {
MPSAccelerationStructure
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsinstanceaccelerationstructure
func MPSInstanceAccelerationStructureFromID ¶
func MPSInstanceAccelerationStructureFromID(id objc.ID) *MPSInstanceAccelerationStructure
func (*MPSInstanceAccelerationStructure) AccelerationStructures ¶
func (o *MPSInstanceAccelerationStructure) AccelerationStructures() *foundation.NSArray[*MPSPolygonAccelerationStructure]
@brief Acceleration structures available for use in this instance acceleration structure. Each instance must provide an index into this array in the instance buffer as well as a transformation matrix in the transform buffer. All acceleration structures must share a single vertex buffer, optional index buffer, and optional mask buffer, though they may have different offsets within each buffer, and all acceleration structures must share the same acceleration structure group. If a polygon acceleration structure is rebuilt or refit, the instance acceleration structure must subsequently be rebuilt or refit.
func (*MPSInstanceAccelerationStructure) InstanceBuffer ¶
func (o *MPSInstanceAccelerationStructure) InstanceBuffer() metal.MTLBuffer
@brief Buffer containing the 32 bit unsigned integer index into the acceleration structure array for each instance
func (*MPSInstanceAccelerationStructure) InstanceBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) InstanceBufferOffset() uint
@brief Offset, in bytes, into the instance buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*MPSInstanceAccelerationStructure) InstanceCount ¶
func (o *MPSInstanceAccelerationStructure) InstanceCount() uint
@brief Number of instances. Changes to this property require rebuilding the acceleration structure.
func (*MPSInstanceAccelerationStructure) MaskBuffer ¶
func (o *MPSInstanceAccelerationStructure) MaskBuffer() metal.MTLBuffer
@brief Mask buffer containing one uint32_t mask per instance. May be nil.
func (*MPSInstanceAccelerationStructure) MaskBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) MaskBufferOffset() uint
@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*MPSInstanceAccelerationStructure) SetAccelerationStructures ¶
func (o *MPSInstanceAccelerationStructure) SetAccelerationStructures(accelerationStructures *foundation.NSArray[*MPSPolygonAccelerationStructure])
func (*MPSInstanceAccelerationStructure) SetInstanceBuffer ¶
func (o *MPSInstanceAccelerationStructure) SetInstanceBuffer(instanceBuffer metal.MTLBuffer)
func (*MPSInstanceAccelerationStructure) SetInstanceBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) SetInstanceBufferOffset(instanceBufferOffset uint)
func (*MPSInstanceAccelerationStructure) SetInstanceCount ¶
func (o *MPSInstanceAccelerationStructure) SetInstanceCount(instanceCount uint)
func (*MPSInstanceAccelerationStructure) SetMaskBuffer ¶
func (o *MPSInstanceAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)
func (*MPSInstanceAccelerationStructure) SetMaskBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)
func (*MPSInstanceAccelerationStructure) SetTransformBuffer ¶
func (o *MPSInstanceAccelerationStructure) SetTransformBuffer(transformBuffer metal.MTLBuffer)
func (*MPSInstanceAccelerationStructure) SetTransformBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) SetTransformBufferOffset(transformBufferOffset uint)
func (*MPSInstanceAccelerationStructure) SetTransformType ¶
func (o *MPSInstanceAccelerationStructure) SetTransformType(transformType MPSTransformType)
func (*MPSInstanceAccelerationStructure) TransformBuffer ¶
func (o *MPSInstanceAccelerationStructure) TransformBuffer() metal.MTLBuffer
@brief Buffer containing one column major matrix_float4x4 transformation matrix per instance
func (*MPSInstanceAccelerationStructure) TransformBufferOffset ¶
func (o *MPSInstanceAccelerationStructure) TransformBufferOffset() uint
@brief Offset, in bytes, into the transform buffer. Defaults to 0 bytes. Must be aligned to the stride of the transform type.
func (*MPSInstanceAccelerationStructure) TransformType ¶
func (o *MPSInstanceAccelerationStructure) TransformType() MPSTransformType
@brief Instance transform type. Defaults to MPSTransformTypeFloat4x4. Changes to this property require rebuilding the acceleration structure.
type MPSIntersectionDataType ¶
type MPSIntersectionDataType uint64
@brief Intersection data type options
const ( // @brief Use the MPSIntersectionDistance struct type MPSIntersectionDataTypeDistance MPSIntersectionDataType = 0 // @brief Use the MPSIntersectionDistancePrimitiveIndex struct type MPSIntersectionDataTypeDistancePrimitiveIndex MPSIntersectionDataType = 1 // @brief Use the MPSIntersectionDistancePrimitiveIndexCoordinates struct type MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates MPSIntersectionDataType = 2 // @brief Use the DistancePrimitiveIndexInstanceIndex struct type MPSIntersectionDataTypeDistancePrimitiveIndexInstanceIndex MPSIntersectionDataType = 3 // @brief Use the DistancePrimitiveIndexInstanceIndexCoordinates struct type MPSIntersectionDataTypeDistancePrimitiveIndexInstanceIndexCoordinates MPSIntersectionDataType = 4 // @brief Use the MPSIntersectionDistancePrimitiveIndexBufferIndex struct type MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndex MPSIntersectionDataType = 5 // @brief Use the MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct type MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexCoordinates MPSIntersectionDataType = 6 // @brief Use the DistancePrimitiveIndexBufferIndexInstanceIndex struct type MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndex MPSIntersectionDataType = 7 // @brief Use the DistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct type MPSIntersectionDataTypeDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates MPSIntersectionDataType = 8 )
func (MPSIntersectionDataType) String ¶
func (e MPSIntersectionDataType) String() string
type MPSIntersectionDistance ¶
type MPSIntersectionDistance struct {
Distance float32
}
@brief Returned intersection result which contains the distance from the ray origin to the intersection point @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndex ¶
@brief Intersection result which contains the distance from the ray origin to the intersection point and the index of the intersected primitive @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndex ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndex struct {
Distance float32
PrimitiveIndex uint
BufferIndex uint
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the polygon buffer index of the intersected primitive. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexCoordinates struct {
Distance float32
PrimitiveIndex uint
BufferIndex uint
Coordinates unsafe.Pointer
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndex struct {
Distance float32
PrimitiveIndex uint
BufferIndex uint
InstanceIndex uint
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, and the index of the intersected instance. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexBufferIndexInstanceIndexCoordinates struct {
Distance float32
PrimitiveIndex uint
BufferIndex uint
InstanceIndex uint
Coordinates unsafe.Pointer
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the polygon buffer index of the intersected primitive, the index of the intersected instance, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexCoordinates struct {
Distance float32
PrimitiveIndex uint
Coordinates unsafe.Pointer
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexInstanceIndex ¶
type MPSIntersectionDistancePrimitiveIndexInstanceIndex struct {
Distance float32
PrimitiveIndex uint
InstanceIndex uint
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, and the index of the intersected instance. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates ¶
type MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates struct {
Distance float32
PrimitiveIndex uint
InstanceIndex uint
Coordinates unsafe.Pointer
}
@brief Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the index of the intersected instance, and the two dimensional parameterization of the intersection point. @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSIntersectionType ¶
type MPSIntersectionType uint64
@brief Options for the MPSRayIntersector intersection type property
const ( // @brief Find the closest intersection to the ray's origin along the ray direction. This is potentially slower than MPSIntersectionTypeAny but is well suited to primary visibility rays. MPSIntersectionTypeNearest MPSIntersectionType = 0 // @brief Find any intersection along the ray direction. This is potentially faster than MPSIntersectionTypeNearest and is well suited to shadow and occlusion rays. MPSIntersectionTypeAny MPSIntersectionType = 1 )
func (MPSIntersectionType) String ¶
func (e MPSIntersectionType) String() string
type MPSPackedFloat3 ¶
C struct: _MPSPackedFloat3
type MPSPolygonAccelerationStructure ¶
type MPSPolygonAccelerationStructure struct {
MPSAccelerationStructure
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpspolygonaccelerationstructure
func MPSPolygonAccelerationStructureFromID ¶
func MPSPolygonAccelerationStructureFromID(id objc.ID) *MPSPolygonAccelerationStructure
func (*MPSPolygonAccelerationStructure) IndexBuffer ¶
func (o *MPSPolygonAccelerationStructure) IndexBuffer() metal.MTLBuffer
@brief Index buffer containing index data. Each index references a vertex in the vertex buffer. May be nil. This is an alias for polygonBuffers[0].indexBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) IndexBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) IndexBufferOffset() uint
@brief Offset, in bytes, into the index buffer. Defaults to 0 bytes. Must be aligned to a multiple of the index type. Changes to this property require rebuilding the acceleration structure. This is an alias for polygonBuffers[0].indexBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) IndexType ¶
func (o *MPSPolygonAccelerationStructure) IndexType() mpscore.MPSDataType
@brief Index type. Defaults to MPSDataTypeUInt32. Only MPSDataTypeUInt16 and MPSDataTypeUInt32 are supported.
func (*MPSPolygonAccelerationStructure) MaskBuffer ¶
func (o *MPSPolygonAccelerationStructure) MaskBuffer() metal.MTLBuffer
@brief Mask buffer containing one uint32_t mask per polygon. May be nil. Otherwise, the mask type must be specified on the MPSRayIntersector with which it is used. This is an alias for polygonBuffers[0].maskBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) MaskBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) MaskBufferOffset() uint
@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes. This is an alias for polygonBuffers[0].maskBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) PolygonBuffers ¶
func (o *MPSPolygonAccelerationStructure) PolygonBuffers() *foundation.NSArray[*MPSPolygonBuffer]
@brief Array of polygon buffers. Each buffer contains a vertex buffer and optional index and mask buffer for an array of polygons. Changing the length of this array requires rebuilding the acceleration structure. Using more than one MPSPolygonBuffer will reduce performance. It is better to concatenate these buffers into a single vertex buffer, index buffer, and mask buffer and use a single MPSPolygonBuffer if possible. This also applies when using an MPSInstanceAccelerationStructure: each instance or subclass of MPSPolygonAccelerationStructure in an instance hierarchy should use the same vertex buffer, index buffer, and mask buffer, although each acceleration structure may use different offsets into these buffers. This allows for the vertex, index, and mask buffers to be bound directly instead of indirectly through an argument buffer. There must be at least one MPSPolygonBuffer. On argument buffer tier 1 devices, there must be be exactly one MPSPolygonBuffer. Use the argumentBuffersSupport property of the MTLDevice to check for support.
func (*MPSPolygonAccelerationStructure) PolygonCount ¶
func (o *MPSPolygonAccelerationStructure) PolygonCount() uint
@brief Number of polygons. Changes to this property require rebuilding the acceleration structure. This is an alias for polygonBuffers[0].polygonCount. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) PolygonType ¶
func (o *MPSPolygonAccelerationStructure) PolygonType() MPSPolygonType
@brief The type of polygon. Defaults to MPSPolygonTypeTriangle. Changes to this property require rebuilding the acceleration structure.
func (*MPSPolygonAccelerationStructure) SetIndexBuffer ¶
func (o *MPSPolygonAccelerationStructure) SetIndexBuffer(indexBuffer metal.MTLBuffer)
func (*MPSPolygonAccelerationStructure) SetIndexBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) SetIndexBufferOffset(indexBufferOffset uint)
func (*MPSPolygonAccelerationStructure) SetIndexType ¶
func (o *MPSPolygonAccelerationStructure) SetIndexType(indexType mpscore.MPSDataType)
func (*MPSPolygonAccelerationStructure) SetMaskBuffer ¶
func (o *MPSPolygonAccelerationStructure) SetMaskBuffer(maskBuffer metal.MTLBuffer)
func (*MPSPolygonAccelerationStructure) SetMaskBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) SetMaskBufferOffset(maskBufferOffset uint)
func (*MPSPolygonAccelerationStructure) SetPolygonBuffers ¶
func (o *MPSPolygonAccelerationStructure) SetPolygonBuffers(polygonBuffers *foundation.NSArray[*MPSPolygonBuffer])
func (*MPSPolygonAccelerationStructure) SetPolygonCount ¶
func (o *MPSPolygonAccelerationStructure) SetPolygonCount(polygonCount uint)
func (*MPSPolygonAccelerationStructure) SetPolygonType ¶
func (o *MPSPolygonAccelerationStructure) SetPolygonType(polygonType MPSPolygonType)
func (*MPSPolygonAccelerationStructure) SetVertexBuffer ¶
func (o *MPSPolygonAccelerationStructure) SetVertexBuffer(vertexBuffer metal.MTLBuffer)
func (*MPSPolygonAccelerationStructure) SetVertexBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) SetVertexBufferOffset(vertexBufferOffset uint)
func (*MPSPolygonAccelerationStructure) SetVertexStride ¶
func (o *MPSPolygonAccelerationStructure) SetVertexStride(vertexStride uint)
func (*MPSPolygonAccelerationStructure) VertexBuffer ¶
func (o *MPSPolygonAccelerationStructure) VertexBuffer() metal.MTLBuffer
@brief Vertex buffer containing vertex data encoded as three 32 bit floats per vertex. Note that by default each vertex is aligned to the alignment of the vector_float3 type: 16 bytes. This can be changed using the vertexStride property. A vertex buffer must be provided before the acceleration structure is built. When using triangle polygons, degenerate (zero or negative area) triangles are ignored during acceleration structure construction. This can be used to pad triangle indices if needed. Quadrilateral polygons are internally treated as two triangles. If the quadrilateral has vertices v0, v1, v2, and v3, the two triangles will have vertices v0, v1, v2 and v0, v2, v3. A quadrilateral may be used to represent a triangle by repeating the last vertex. If the first triangle is degenerate (zero or negative area), the entire quadrilateral will be ignored. This can be used to pad quadrilateral indices if needed. All four vertices of a quadrilateral must be coplanar and the quadrilateral must be convex. This is an alias for polygonBuffers[0].vertexBuffer. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) VertexBufferOffset ¶
func (o *MPSPolygonAccelerationStructure) VertexBufferOffset() uint
@brief Offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes. This is an alias for polygonBuffers[0].vertexBufferOffset. There must be exactly one polygon buffer to use this property, or the polygonBuffers property must be nil, in which case an MPSPolygonBuffer will be created automatically.
func (*MPSPolygonAccelerationStructure) VertexStride ¶
func (o *MPSPolygonAccelerationStructure) VertexStride() uint
@brief Offset, in bytes, between consecutive vertices in the vertex buffer. Defaults to 0 bytes, indicating that the vertices are packed according to the natural alignment of the vector_float3 type: 16 bytes. @discussion This can be used to skip past any additional per-vertex data which may be stored alongside the position such as the vertex normal and texture coordinates. Must be a multiple of 4 bytes, and must be at least 12 bytes. Changes to this property require rebuilding the acceleration structure.
type MPSPolygonBuffer ¶
type MPSPolygonBuffer struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpspolygonbuffer
func MPSPolygonBufferFromID ¶
func MPSPolygonBufferFromID(id objc.ID) *MPSPolygonBuffer
func MPSPolygonBufferPolygonBuffer ¶
func MPSPolygonBufferPolygonBuffer() *MPSPolygonBuffer
func (*MPSPolygonBuffer) IndexBuffer ¶
func (o *MPSPolygonBuffer) IndexBuffer() metal.MTLBuffer
@brief Index buffer containing index data. Each index references a vertex in the vertex buffer. May be nil.
func (*MPSPolygonBuffer) IndexBufferOffset ¶
func (o *MPSPolygonBuffer) IndexBufferOffset() uint
@brief Offset, in bytes, into the index buffer. Defaults to 0 bytes. Must be aligned to a multiple of the index type. Changes to this property require rebuilding the acceleration structure.
func (*MPSPolygonBuffer) Init ¶
func (o *MPSPolygonBuffer) Init() *MPSPolygonBuffer
@brief Initialize the polygon buffer
func (*MPSPolygonBuffer) InitWithCoder ¶
func (o *MPSPolygonBuffer) InitWithCoder(aDecoder *foundation.NSCoder) *MPSPolygonBuffer
@brief Initialize the polygon buffer with an NSCoder. Buffer properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with the polygon buffer instead.
func (*MPSPolygonBuffer) MaskBuffer ¶
func (o *MPSPolygonBuffer) MaskBuffer() metal.MTLBuffer
@brief Mask buffer containing one uint32_t mask per polygon. May be nil. Otherwise, the mask type must be specified on the MPSRayIntersector with which it is used.
func (*MPSPolygonBuffer) MaskBufferOffset ¶
func (o *MPSPolygonBuffer) MaskBufferOffset() uint
@brief Offset, in bytes, into the mask buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
func (*MPSPolygonBuffer) PolygonCount ¶
func (o *MPSPolygonBuffer) PolygonCount() uint
@brief Number of polygons. Changes to this property require rebuilding the acceleration structure.
func (*MPSPolygonBuffer) SetIndexBuffer ¶
func (o *MPSPolygonBuffer) SetIndexBuffer(indexBuffer metal.MTLBuffer)
func (*MPSPolygonBuffer) SetIndexBufferOffset ¶
func (o *MPSPolygonBuffer) SetIndexBufferOffset(indexBufferOffset uint)
func (*MPSPolygonBuffer) SetMaskBuffer ¶
func (o *MPSPolygonBuffer) SetMaskBuffer(maskBuffer metal.MTLBuffer)
func (*MPSPolygonBuffer) SetMaskBufferOffset ¶
func (o *MPSPolygonBuffer) SetMaskBufferOffset(maskBufferOffset uint)
func (*MPSPolygonBuffer) SetPolygonCount ¶
func (o *MPSPolygonBuffer) SetPolygonCount(polygonCount uint)
func (*MPSPolygonBuffer) SetVertexBuffer ¶
func (o *MPSPolygonBuffer) SetVertexBuffer(vertexBuffer metal.MTLBuffer)
func (*MPSPolygonBuffer) SetVertexBufferOffset ¶
func (o *MPSPolygonBuffer) SetVertexBufferOffset(vertexBufferOffset uint)
func (*MPSPolygonBuffer) VertexBuffer ¶
func (o *MPSPolygonBuffer) VertexBuffer() metal.MTLBuffer
@brief Vertex buffer containing vertex data encoded as three 32 bit floats per vertex. Note that by default each vertex is aligned to the alignment of the vector_float3 type: 16 bytes. This can be changed using the vertexStride property. A vertex buffer must be provided before the acceleration structure is built. When using triangle polygons, degenerate (zero or negative area) triangles are ignored during acceleration structure construction. This can be used to pad triangle indices if needed. Quadrilateral polygons are internally treated as two triangles. If the quadrilateral has vertices v0, v1, v2, and v3, the two triangles will have vertices v0, v1, v2 and v0, v2, v3. A quadrilateral may be used to represent a triangle by repeating the last vertex. If the first triangle is degenerate (zero or negative area), the entire quadrilateral will be ignored. This can be used to pad quadrilateral indices if needed. All four vertices of a quadrilateral must be coplanar and the quadrilateral must be convex.
func (*MPSPolygonBuffer) VertexBufferOffset ¶
func (o *MPSPolygonBuffer) VertexBufferOffset() uint
@brief Offset, in bytes, into the vertex buffer. Defaults to 0 bytes. Must be aligned to 4 bytes.
type MPSPolygonType ¶
type MPSPolygonType uint64
const ( // @brief Triangles with three vertices MPSPolygonTypeTriangle MPSPolygonType = 0 // @brief Quadrilaterals with four vertices MPSPolygonTypeQuadrilateral MPSPolygonType = 1 )
func (MPSPolygonType) String ¶
func (e MPSPolygonType) String() string
type MPSQuadrilateralAccelerationStructure ¶
type MPSQuadrilateralAccelerationStructure struct {
MPSPolygonAccelerationStructure
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsquadrilateralaccelerationstructure
func MPSQuadrilateralAccelerationStructureFromID ¶
func MPSQuadrilateralAccelerationStructureFromID(id objc.ID) *MPSQuadrilateralAccelerationStructure
func (*MPSQuadrilateralAccelerationStructure) QuadrilateralCount ¶
func (o *MPSQuadrilateralAccelerationStructure) QuadrilateralCount() uint
@brief Number of quads. Changes to this property require rebuilding the acceleration structure. This is an alias for the polygonCount property.
func (*MPSQuadrilateralAccelerationStructure) SetQuadrilateralCount ¶
func (o *MPSQuadrilateralAccelerationStructure) SetQuadrilateralCount(quadrilateralCount uint)
type MPSRayDataType ¶
type MPSRayDataType uint64
@brief Options for the MPSRayIntersector ray data type property
const ( // @brief Use the MPSRayOriginDirection struct type MPSRayDataTypeOriginDirection MPSRayDataType = 0 // @brief Use the MPSRayOriginMinDistanceDirectionMaxDistance struct type MPSRayDataTypeOriginMinDistanceDirectionMaxDistance MPSRayDataType = 1 // @brief Use the MPSRayOriginMaxDistanceDirectionMask struct type MPSRayDataTypeOriginMaskDirectionMaxDistance MPSRayDataType = 2 // @brief Use the MPSPackedRayOriginDirection struct type MPSRayDataTypePackedOriginDirection MPSRayDataType = 3 )
func (MPSRayDataType) String ¶
func (e MPSRayDataType) String() string
type MPSRayIntersector ¶
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpsrayintersector
func MPSRayIntersectorFromID ¶
func MPSRayIntersectorFromID(id objc.ID) *MPSRayIntersector
func (*MPSRayIntersector) BoundingBoxIntersectionTestType ¶
func (o *MPSRayIntersector) BoundingBoxIntersectionTestType() MPSBoundingBoxIntersectionTestType
@brief Ray/bounding box intersection test type. Defaults to MPSBoundingBoxIntersectionTestTypeDefault.
func (*MPSRayIntersector) CullMode ¶
func (o *MPSRayIntersector) CullMode() metal.MTLCullMode
@brief Whether to ignore intersections between rays and back-facing or front-facing triangles or quadrilaterals. Defaults to MTLCullModeNone. @discussion A triangle or quadrilateral is back-facing if its normal points in the same direction as a ray and front-facing if its normal points in the opposite direction as a ray. If the cull mode is set to MTLCullModeBack, then back-facing triangles and quadrilaterals will be ignored. If the cull mode is set to MTLCullModeFront, then front-facing triangles and quadrilaterals will be ignored. Otherwise, if the cull mode is set to MTLCullModeNone, no triangles or quadrilaterals will be ignored. The front and back faces can be swapped using the frontFacingWinding property. Backface culling is necessary for some scenes but can reduce raytracing performance.
func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountAccelerationStructure ¶
func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayCount uint, accelerationStructure *MPSAccelerationStructure)
@brief Schedule intersection tests between rays and an acceleration structure @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayCount Number of rays @param accelerationStructure Acceleration structure to test against
func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountBufferRayCountBufferOffsetAccelerationStructure ¶
func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetIntersectionBufferIntersectionBufferOffsetRayCountBufferRayCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayCountBuffer metal.MTLBuffer, rayCountBufferOffset uint, accelerationStructure *MPSAccelerationStructure)
@brief Schedule intersection tests between rays and an acceleration structure with a ray count provided in a buffer @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayCountBuffer Buffer containing number of rays as a 32 bit unsigned integer @param rayCountBufferOffset Offset, in bytes, into the ray count buffer. Must be a multiple of 4 bytes. @param accelerationStructure Acceleration structure to test against
func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountAccelerationStructure ¶
func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, rayIndexBuffer metal.MTLBuffer, rayIndexBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayIndexCount uint, accelerationStructure *MPSAccelerationStructure)
@brief Schedule intersection tests between rays and an acceleration structure @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param rayIndexBuffer Buffer containing ray indices. Each index references a ray in the ray buffer. The ray index data type is controlled by the rayIndexDataType property. @param rayIndexBufferOffset Offset, in bytes, into the ray index buffer. Must be a multiple of the stride of the ray index type. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayIndexCount Number of ray indices @param accelerationStructure Acceleration structure to test against
func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountBufferRayIndexCountBufferOffsetAccelerationStructure ¶
func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayBufferRayBufferOffsetRayIndexBufferRayIndexBufferOffsetIntersectionBufferIntersectionBufferOffsetRayIndexCountBufferRayIndexCountBufferOffsetAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayBuffer metal.MTLBuffer, rayBufferOffset uint, rayIndexBuffer metal.MTLBuffer, rayIndexBufferOffset uint, intersectionBuffer metal.MTLBuffer, intersectionBufferOffset uint, rayIndexCountBuffer metal.MTLBuffer, rayIndexCountBufferOffset uint, accelerationStructure *MPSAccelerationStructure)
@brief Schedule intersection tests between rays and an acceleration structure with a ray count provided in a buffer @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayBuffer Buffer containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType and rayStride properties. @param rayBufferOffset Offset, in bytes, into the ray buffer. Must be a multiple of the ray stride. @param rayIndexBuffer Buffer containing ray indices. Each index references a ray in the ray buffer. The ray index data type is controlled by the rayIndexDataType property. @param rayIndexBufferOffset Offset, in bytes, into the ray index buffer. Must be a multiple of the stride of the ray index type. @param intersectionBuffer Buffer to store intersection in. Intersections are stored in the same order as the ray buffer, one intersection per ray. The intersection data type is defined by the intersectionDataType and intersectionStride properties. @param intersectionBufferOffset Offset, in bytes, into the intersection buffer. Must be a multiple of the intersection stride. @param rayIndexCountBuffer Buffer containing number of rays as a 32 bit unsigned integer @param rayIndexCountBufferOffset Offset, in bytes, into the ray count buffer. Must be a multiple of 4 bytes. @param accelerationStructure Acceleration structure to test against
func (*MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayTextureIntersectionTextureAccelerationStructure ¶
func (o *MPSRayIntersector) EncodeIntersectionToCommandBufferIntersectionTypeRayTextureIntersectionTextureAccelerationStructure(commandBuffer metal.MTLCommandBuffer, intersectionType MPSIntersectionType, rayTexture metal.MTLTexture, intersectionTexture metal.MTLTexture, accelerationStructure *MPSAccelerationStructure)
@brief Schedule intersection tests between rays and an acceleration structure, where rays and loaded from a texture and intersections are stored into a texture. This is convenient for hybrid rendering applications which produce ray data from a fragment shader. The ray and intersection texture must be 2D array textures. Ray data must be packed into consecutive channels and slices of the ray texture. Intersection data will be packed the same way. The ray and intersection data types are defined by the rayDataType and intersectionDataType properties. The rayStride and intersectionStride properties are ignored. Channels and slices beyond the required number are ignored when reading from the ray texture. Channels and slices beyond the required number are undefined when writing to the intersection texture. For example, if the ray data type is MPSRayDataTypeOriginMaskDirectionMaxDistance, the ray texture must have pixel format MTLPixelFormatRGBA32Float and at least two array slices, packed as follows: @code tex.write(float4(ray.position, as_type<float>(ray.mask)), pixel, 0); // slice 0 tex.write(float4(ray.direction, ray.maxDistance), pixel, 1); // slice 1 @end If the intersection data type is MPSIntersectionDataTypeDistance, the intersection texture may have pixel format MTLPixelFormatR32Float with just a single channel and one array slice, and should be unpacked as follows: @code float distance = tex.read(pixel, 0).x; @end On the other hand, if the intersection data type is MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates, the intersection texture must have pixel format MTLPixelFormatRGBA32Float and at least two slices: @code float3 f0 = tex.read(pixel, 0); float distance = f0.x; unsigned int primitiveIndex = as_type<unsigned int>(f0.y); unsigned int instanceIndex = as_type<unsigned int>(f0.z); // w component is padding for this intersection data type float2 coordinates = tex.read(pixel, 1).xy; @end @param commandBuffer Command buffer to schedule intersection testing in @param intersectionType Which type of intersection to test for @param rayTexture A 2D array texture containing rays to intersect against the acceleration structure. The ray data type is defined by the rayDataType property. @param intersectionTexture Texture to store intersection in. Intersections are stored in the same position as the ray texture, one intersection per ray. The intersection data type is defined by the intersectionDataType property. @param accelerationStructure Acceleration structure to test against
func (*MPSRayIntersector) EncodeWithCoder ¶
func (o *MPSRayIntersector) EncodeWithCoder(coder *foundation.NSCoder)
func (*MPSRayIntersector) FrontFacingWinding ¶
func (o *MPSRayIntersector) FrontFacingWinding() metal.MTLWinding
@brief Winding order used to determine which direction a triangle or quadrilateral's normal points when back face or front face culling is enabled. Defaults to MTLWindingClockwise. @discussion If the front face winding is set to MTLWindingClockwise, the triangle or quadrilateral normal is considered to point towards the direction where the vertices are in clockwise order when viewed from that direction. Otherwise, if the front facing winding is set to MTLWindingCounterClockwise, the triangle or quadrilateral normal is considered to point in the opposite direction.
func (*MPSRayIntersector) InitWithCoderDevice ¶
func (o *MPSRayIntersector) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSRayIntersector
@brief Initialize the raytracer with an NSCoder and a Metal device
func (*MPSRayIntersector) InitWithDevice ¶
func (o *MPSRayIntersector) InitWithDevice(device metal.MTLDevice) *MPSRayIntersector
@brief Initialize the raytracer with a Metal device
func (*MPSRayIntersector) IntersectionDataType ¶
func (o *MPSRayIntersector) IntersectionDataType() MPSIntersectionDataType
@brief Intersection data type. Defaults to MPSIntersectionDataTypeDistancePrimitiveIndexCoordinates.
func (*MPSRayIntersector) IntersectionStride ¶
func (o *MPSRayIntersector) IntersectionStride() uint
@brief Offset, in bytes, between consecutive intersections in the intersection buffer. Defaults to 0, indicating that the intersections are packed according to their natural aligned size. @discussion This can be used to skip past any additional per-intersection that which may be stored alongside the MPSRayIntersection struct such as the surface normal at the point of intersection. Must be aligned to the alignment of the intersection data type.
func (*MPSRayIntersector) RayDataType ¶
func (o *MPSRayIntersector) RayDataType() MPSRayDataType
@brief Ray data type. Defaults to MPSRayDataTypeOriginDirection.
func (*MPSRayIntersector) RayIndexDataType ¶
func (o *MPSRayIntersector) RayIndexDataType() mpscore.MPSDataType
@brief Ray index data type. Defaults to MPSDataTypeUInt32. Only MPSDataTypeUInt16 and MPSDataTypeUInt32 are supported.
func (*MPSRayIntersector) RayMask ¶
func (o *MPSRayIntersector) RayMask() uint
@brief Global ray mask. Defaults to 0xFFFFFFFF. This value will be logically AND-ed with the per-ray mask if the ray data type contains a mask.
func (*MPSRayIntersector) RayMaskOperator ¶
func (o *MPSRayIntersector) RayMaskOperator() MPSRayMaskOperator
@brief The operator to apply to determine whether to accept an intersection between a ray and a primitive or instance. Defaults to MPSRayMaskOperatorAnd.
func (*MPSRayIntersector) RayMaskOptions ¶
func (o *MPSRayIntersector) RayMaskOptions() MPSRayMaskOptions
@brief Whether to enable primitive and instance masks. Defaults to MPSRayMaskOptionNone. @discussion If MPSRayMaskOptionPrimitive or MPSRayMaskOptionInstance is enabled, each ray and primitive and/or instance is associated with a 32 bit unsigned integer mask. Before checking for intersection between a ray and a primitive or instance, the corresponding masks are compared using the ray mask operator defined by the rayMaskOperator property. If the result is zero, the intersection is skipped. This can be used to make certain primitives or instances invisible to certain rays. For example, objects can be grouped into layers and their visibility can be toggled by modifying the ray masks rather than removing the objects from the scene and rebuilding the acceleration structure. Alternatively, certain objects can be prevented from casting shadows by making them invisible to shadow rays. Enabling this option may reduce raytracing performance.
func (*MPSRayIntersector) RayStride ¶
func (o *MPSRayIntersector) RayStride() uint
@brief Offset, in bytes, between consecutive rays in the ray buffer. Defaults to 0, indicating that the rays are packed according to their natural aligned size. @discussion This can be used to skip past any additional per-ray data that may be stored alongside the MPSRay struct such as the current radiance along the ray or the source pixel coordinates. Must be aligned to the alignment of the ray data type.
func (*MPSRayIntersector) RecommendedMinimumRayBatchSizeForRayCount ¶
func (o *MPSRayIntersector) RecommendedMinimumRayBatchSizeForRayCount(rayCount uint) uint
@brief Get the recommended minimum number of rays to submit for intersection in one batch @discussion In order to keep the system responsive, and to limit the amount of memory allocated to ray and intersection buffers, it may be desirable to divide the rays to be intersected against an acceleration structure into smaller batches. However, submitting too few rays in a batch reduces GPU utilization and performance. This method provides a recommended minimum number of rays to submit in any given batch. For example, for a 1920x1080 image, this method may recommend that the image be divided into 512x512 tiles. The actual recommendation varies per device and total ray count. @param rayCount The total number of rays to be submitted @return The recommended minimum ray batch size
func (*MPSRayIntersector) SetBoundingBoxIntersectionTestType ¶
func (o *MPSRayIntersector) SetBoundingBoxIntersectionTestType(boundingBoxIntersectionTestType MPSBoundingBoxIntersectionTestType)
func (*MPSRayIntersector) SetCullMode ¶
func (o *MPSRayIntersector) SetCullMode(cullMode metal.MTLCullMode)
func (*MPSRayIntersector) SetFrontFacingWinding ¶
func (o *MPSRayIntersector) SetFrontFacingWinding(frontFacingWinding metal.MTLWinding)
func (*MPSRayIntersector) SetIntersectionDataType ¶
func (o *MPSRayIntersector) SetIntersectionDataType(intersectionDataType MPSIntersectionDataType)
func (*MPSRayIntersector) SetIntersectionStride ¶
func (o *MPSRayIntersector) SetIntersectionStride(intersectionStride uint)
func (*MPSRayIntersector) SetRayDataType ¶
func (o *MPSRayIntersector) SetRayDataType(rayDataType MPSRayDataType)
func (*MPSRayIntersector) SetRayIndexDataType ¶
func (o *MPSRayIntersector) SetRayIndexDataType(rayIndexDataType mpscore.MPSDataType)
func (*MPSRayIntersector) SetRayMask ¶
func (o *MPSRayIntersector) SetRayMask(rayMask uint)
func (*MPSRayIntersector) SetRayMaskOperator ¶
func (o *MPSRayIntersector) SetRayMaskOperator(rayMaskOperator MPSRayMaskOperator)
func (*MPSRayIntersector) SetRayMaskOptions ¶
func (o *MPSRayIntersector) SetRayMaskOptions(rayMaskOptions MPSRayMaskOptions)
func (*MPSRayIntersector) SetRayStride ¶
func (o *MPSRayIntersector) SetRayStride(rayStride uint)
func (*MPSRayIntersector) SetTriangleIntersectionTestType ¶
func (o *MPSRayIntersector) SetTriangleIntersectionTestType(triangleIntersectionTestType MPSTriangleIntersectionTestType)
func (*MPSRayIntersector) TriangleIntersectionTestType ¶
func (o *MPSRayIntersector) TriangleIntersectionTestType() MPSTriangleIntersectionTestType
@brief Ray/triangle intersection test type. Defaults to MPSTriangleIntersectionTestTypeDefault. Quads are broken into two triangles for intersection testing, so this property also applies to quadrilateral intersections.
type MPSRayMaskOperator ¶
type MPSRayMaskOperator uint64
@brief Options for the MPSRayIntersector ray mask operator property
const ( // @brief Accept the intersection if (primitive mask & ray mask) != 0. MPSRayMaskOperatorAnd MPSRayMaskOperator = 0 // @brief Accept the intersection if ~(primitive mask & ray mask) != 0. MPSRayMaskOperatorNotAnd MPSRayMaskOperator = 1 // @brief Accept the intersection if (primitive mask | ray mask) != 0. MPSRayMaskOperatorOr MPSRayMaskOperator = 2 // @brief Accept the intersection if ~(primitive mask | ray mask) != 0. MPSRayMaskOperatorNotOr MPSRayMaskOperator = 3 // @brief Accept the intersection if (primitive mask ^ ray mask) != 0. MPSRayMaskOperatorXor MPSRayMaskOperator = 4 // @brief Accept the intersection if ~(primitive mask ^ ray mask) != 0. MPSRayMaskOperatorNotXor MPSRayMaskOperator = 5 // @brief Accept the intersection if primitive mask < ray mask. MPSRayMaskOperatorLessThan MPSRayMaskOperator = 6 // @brief Accept the intersection if primitive mask <= ray mask. MPSRayMaskOperatorLessThanOrEqualTo MPSRayMaskOperator = 7 // @brief Accept the intersection if primitive mask > ray mask. MPSRayMaskOperatorGreaterThan MPSRayMaskOperator = 8 // @brief Accept the intersection if primitive mask >= ray mask. MPSRayMaskOperatorGreaterThanOrEqualTo MPSRayMaskOperator = 9 // @brief Accept the intersection if primitive mask == ray mask. MPSRayMaskOperatorEqual MPSRayMaskOperator = 10 // @brief Accept the intersection if primitive mask != ray mask. MPSRayMaskOperatorNotEqual MPSRayMaskOperator = 11 )
func (MPSRayMaskOperator) String ¶
func (e MPSRayMaskOperator) String() string
type MPSRayMaskOptions ¶
type MPSRayMaskOptions uint64
@brief Options for the MPSRayIntersector ray mask options property
const ( // @brief Disable primitive and instance masks MPSRayMaskOptionNone MPSRayMaskOptions = 0 // @brief Enable primitive masks MPSRayMaskOptionPrimitive MPSRayMaskOptions = 1 // @brief Enable instance masks MPSRayMaskOptionInstance MPSRayMaskOptions = 2 )
func (MPSRayMaskOptions) String ¶
func (e MPSRayMaskOptions) String() string
type MPSRayOriginDirection ¶
@brief Represents a 3D ray with an origin and a direction @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSRayOriginMaskDirectionMaxDistance ¶
type MPSRayOriginMaskDirectionMaxDistance struct {
Origin MPSPackedFloat3
Mask uint
Direction MPSPackedFloat3
MaxDistance float32
}
@brief Represents a 3D ray with an origin, a direction, and a mask to filter out intersections @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSRayOriginMinDistanceDirectionMaxDistance ¶
type MPSRayOriginMinDistanceDirectionMaxDistance struct {
Origin MPSPackedFloat3
MinDistance float32
Direction MPSPackedFloat3
MaxDistance float32
}
@brief Represents a 3D ray with an origin, a direction, and an intersection distance range from the origin @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSRayPackedOriginDirection ¶
type MPSRayPackedOriginDirection struct {
Origin MPSPackedFloat3
Direction MPSPackedFloat3
}
@brief Represents a 3D ray with an origin and a direction @discussion This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
type MPSSVGF ¶
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgf
func MPSSVGFFromID ¶
func (*MPSSVGF) BilateralFilterRadius ¶
@brief The radius of the bilateral filter. Defaults to 2 resulting in a 5x5 filter.
func (*MPSSVGF) BilateralFilterSigma ¶
@brief The sigma value of the Gaussian function used by the bilateral filter. Must be greater than zero. Defaults to 1.2.
func (*MPSSVGF) ChannelCount ¶
@brief The number of channels to filter in the source image. Must be at least one and at most three. Defaults to 3.
func (*MPSSVGF) ChannelCount2 ¶
@brief The number of channels to filter in the second source image. Must be at least one and at most three. Defaults to 3.
func (*MPSSVGF) DepthWeight ¶
@brief Controls how samples' depths are compared during reprojection, variance estimation, and bilateral filtering. The final weight is given by exp(-abs(Z1 - Z2) / depthWeight). Must be greater than zero. Defaults to 1.0.
func (*MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture ¶
func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)
@brief Encode bilateral filter into a command buffer @discussion Performs an edge avoiding blur with radius given by the bilateraFilterRadius property with sampling weighted by a Gaussian filter with sigma given by the bilteralFilterSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the blur. These values are weighted by the depthWeight, normalWeight, and luminanceWeight properties. Before the variance values are used for luminance weighting, the variance is prefiltered with a small Gaussian blur with radius given by the variancePrefilterRadius property and sigma given by the variancePrefilterSigma property. This kernel should be run multiple times with a step distance of pow(2, i), starting with i = 0. It is recommended that the output of the first iteration be used as the image to be reprojected in the next frame. Then several more iterations should be run to compute the denoised image for the current frame. 5 total iterations is reasonable. The bilateral filter can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same normal and depth values. The number of channels to filter in the source image(s) are given by the channelCount and channelCount2 properties. Furthermore, the luminance variance is packed into the final channel of the source image(s) to reduce the number of texture sample instructions required. The filtered color and variance values are packed the same way in the destination image(s). Therefore, the source and destination images must have at least channelCount + 1 and channelCount2 + 1 channels. Channels beyond the required number are ignored when reading from source images and set to zero when writing to destination images. The source image should be produced by either the variance estimation kernel or a previous iteration of the bilateral filter. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. @param commandBuffer Command buffer to encode into @param stepDistance Number of pixels to skip between samples @param sourceTexture Source packed color and variance texture @param destinationTexture Destination packed color and variance texture @param depthNormalTexture The depth and normal values for the current frame
func (*MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureSourceTexture2DestinationTexture2DepthNormalTexture ¶
func (o *MPSSVGF) EncodeBilateralFilterToCommandBufferStepDistanceSourceTextureDestinationTextureSourceTexture2DestinationTexture2DepthNormalTexture(commandBuffer metal.MTLCommandBuffer, stepDistance uint, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, depthNormalTexture metal.MTLTexture)
@brief Encode bilateral filter into a command buffer @discussion Performs an edge avoiding blur with radius given by the bilateraFilterRadius property with sampling weighted by a Gaussian filter with sigma given by the bilteralFilterSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the blur. These values are weighted by the depthWeight, normalWeight, and luminanceWeight properties. Before the variance values are used for luminance weighting, the variance is prefiltered with a small Gaussian blur with radius given by the variancePrefilterRadius property and sigma given by the variancePrefilterSigma property. This kernel should be run multiple times with a step distance of pow(2, i), starting with i = 0. It is recommended that the output of the first iteration be used as the image to be reprojected in the next frame. Then several more iterations should be run to compute the denoised image for the current frame. 5 total iterations is reasonable. The bilateral filter can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same normal and depth values. The number of channels to filter in the source image(s) are given by the channelCount and channelCount2 properties. Furthermore, the luminance variance is packed into the final channel of the source image(s) to reduce the number of texture sample instructions required. The filtered color and variance values are packed the same way in the destination image(s). Therefore, the source and destination images must have at least channelCount + 1 and channelCount2 + 1 channels. Channels beyond the required number are ignored when reading from source images and set to zero when writing to destination images. The source image should be produced by either the variance estimation kernel or a previous iteration of the bilateral filter. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. @param commandBuffer Command buffer to encode into @param stepDistance Number of pixels to skip between samples @param sourceTexture Source packed color and variance texture @param destinationTexture Destination packed color and variance texture @param sourceTexture2 Second source image @param destinationTexture2 Second destination image @param depthNormalTexture The depth and normal values for the current frame
func (*MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture ¶
func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTexturePreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, previousLuminanceMomentsTexture metal.MTLTexture, destinationLuminanceMomentsTexture metal.MTLTexture, previousFrameCountTexture metal.MTLTexture, destinationFrameCountTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)
@brief Encode reprojection into a command buffer @discussion Normal and depth values from the previous frame will be compared with normal and depth values from the current frame to determine if they are similar enough to reproject into the current frame. These values are weighted by the depthWeight and normalWeight properties. If the combined weight exceeds the reprojectionThreshold property's value, the previous frame will be blended with the current frame according to the temporalWeighting and temporalReprojectionBlendFactor properties. The reprojection kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The number of channels in the source image(s), previous frame's image(s), and destination image(s) are given by the channelCount and channelCount2 properties. These images must have at least as many channels as given by these properties. Channels beyond the required number are ignored when reading from source images and set to zero when writing to the destination images, except the alpha channel which will be set to one if present. The previous frame's image will be ignored on the first frame. The source and destination luminance moments textures must be at least two-channel textures, which will be set to the accumulated first and second moments of luminance. Channels beyond the first two will be ignored when reading from the previous frame's texture and set to zero when writing to the destination texture. The previous frame's luminance moments will be ignored on the first frame. The frame count textures track the number of accumulated frames and must be at least R32Uint textures. The remaining channels will be ignored when reading from the source texture and set to zero when writing to the destination texture, if present. The previous frame count texture must be cleared to zero on the first frame or to reset the accumulated images to the current frame's image. The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. The depth and normal values are not required if the motion vector texture is nil. The destination texture, destination luminance moments texture, and destination frame count texture are used by subsequent stages of the denoising filter. The destination frame count texture is also used as the source frame count texture the reprojection kernel in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param previousLuminanceMomentsTexture Previous accumulated luminance moments image @param destinationLuminanceMomentsTexture Output accumulated luminance moments image @param previousFrameCountTexture The number of frames accumulated in the previous source image @param destinationFrameCountTexture The number of frames accumulated in the destination texture(s) including the current frame @param motionVectorTexture Motion vector texture @param depthNormalTexture The depth and normal values for the current frame @param previousDepthNormalTexture The depth and normal values for the previous frame
func (*MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTextureSourceTexture2PreviousTexture2DestinationTexture2PreviousLuminanceMomentsTexture2DestinationLuminanceMomentsTexture2PreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture ¶
func (o *MPSSVGF) EncodeReprojectionToCommandBufferSourceTexturePreviousTextureDestinationTexturePreviousLuminanceMomentsTextureDestinationLuminanceMomentsTextureSourceTexture2PreviousTexture2DestinationTexture2PreviousLuminanceMomentsTexture2DestinationLuminanceMomentsTexture2PreviousFrameCountTextureDestinationFrameCountTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, previousLuminanceMomentsTexture metal.MTLTexture, destinationLuminanceMomentsTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, previousTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, previousLuminanceMomentsTexture2 metal.MTLTexture, destinationLuminanceMomentsTexture2 metal.MTLTexture, previousFrameCountTexture metal.MTLTexture, destinationFrameCountTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)
@brief Encode reprojection into a command buffer @discussion Normal and depth values from the previous frame will be compared with normal and depth values from the current frame to determine if they are similar enough to reproject into the current frame. These values are weighted by the depthWeight and normalWeight properties. If the combined weight exceeds the reprojectionThreshold property's value, the previous frame will be blended with the current frame according to the temporalWeighting and temporalReprojectionBlendFactor properties. The reprojection kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The number of channels in the source image(s), previous frame's image(s), and destination image(s) are given by the channelCount and channelCount2 properties. These images must have at least as many channels as given by these properties. Channels beyond the required number are ignored when reading from source images and set to zero when writing to the destination images, except the alpha channel which will be set to one if present. The previous frame's image will be ignored on the first frame. The source and destination luminance moments textures must be at least two-channel textures, which will be set to the accumulated first and second moments of luminance. Channels beyond the first two will be ignored when reading from the previous frame's texture and set to zero when writing to the destination texture. The previous frame's luminance moments will be ignored on the first frame. The frame count textures track the number of accumulated frames and must be at least R32Uint textures. The remaining channels will be ignored when reading from the source texture and set to zero when writing to the destination texture, if present. The previous frame count texture must be cleared to zero on the first frame or to reset the accumulated images to the current frame's image. The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. The depth and normal values are not required if the motion vector texture is nil. The destination texture, destination luminance moments texture, and destination frame count texture are used by subsequent stages of the denoising filter. The destination frame count texture is also used as the source frame count texture the reprojection kernel in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param previousLuminanceMomentsTexture Previous accumulated luminance moments image @param destinationLuminanceMomentsTexture Output accumulated luminance moments image @param sourceTexture2 Second source image @param previousTexture2 Second previous image @param destinationTexture2 Second destination image @param previousLuminanceMomentsTexture2 Second previous luminance moments texture @param destinationLuminanceMomentsTexture2 Second destination luminance moments texture @param previousFrameCountTexture The number of frames accumulated in the previous source image @param destinationFrameCountTexture The number of frames accumulated in the destination texture(s) including the current frame @param motionVectorTexture Motion vector texture @param depthNormalTexture The depth and normal values for the current frame @param previousDepthNormalTexture The depth and normal values for the previous frame
func (*MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture ¶
func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureFrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, luminanceMomentsTexture metal.MTLTexture, destinationTexture metal.MTLTexture, frameCountTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)
@brief Encode variance estimation into a command buffer @discussion Variance is computed from the accumulated first and second luminance moments. If the number of accumulated frames is below the minimumFramesForVarianceEstimation property, the luminance variance will be computed using a spatial estimate instead. The spatial estimate is computed using a bilateral filter with radius given by the varianceEstimationRadius property. Neighboring samples will be weighted according to a gaussian function with sigma given by the varianceEstimationSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the spatial blur. These values are weighted by the depthWeight and normalWeight properties. The variance kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The reprojected source texture, luminance moments texture and frame count texture are computed by the reprojection kernel. The computed variance will be stored in the last channel of the destination image, while the source image will be copied into the previous channels, to reduce the number of texture sample instructured required by the bilateral filter in the final stage of the denoising kernel. The number of channels in the source image(s) are given by the channelCount and channelCount2 properties. Therefore, the destination image(s) must have at least channelCount + 1 and channelCount2 + 1 channels and the source image(s) must have at least channelCount and channelCount2 channels. Channels beyond the required number are ignored when reading from source textures and set to zero when writing to destination textures. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. If the minimumFramesForVarianceEstimation property is less than or equal to one, variance will be estimated directly from the accumulated luminance moments so the depth/normal texture may be nil. @param commandBuffer Command buffer to encode into @param sourceTexture Current reprojected frame to denoise @param luminanceMomentsTexture Luminance moments texture @param destinationTexture Output packed color and variance image @param frameCountTexture Number of frames accumulated into the source image @param depthNormalTexture The depth and normal values for the current frame
func (*MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureSourceTexture2LuminanceMomentsTexture2DestinationTexture2FrameCountTextureDepthNormalTexture ¶
func (o *MPSSVGF) EncodeVarianceEstimationToCommandBufferSourceTextureLuminanceMomentsTextureDestinationTextureSourceTexture2LuminanceMomentsTexture2DestinationTexture2FrameCountTextureDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, luminanceMomentsTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, luminanceMomentsTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, frameCountTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture)
@brief Encode variance estimation into a command buffer @discussion Variance is computed from the accumulated first and second luminance moments. If the number of accumulated frames is below the minimumFramesForVarianceEstimation property, the luminance variance will be computed using a spatial estimate instead. The spatial estimate is computed using a bilateral filter with radius given by the varianceEstimationRadius property. Neighboring samples will be weighted according to a gaussian function with sigma given by the varianceEstimationSigma property. Normal and depth values from neighboring pixels will be compared with depth and normal values of the center pixel to determine if they are similar enough to include in the spatial blur. These values are weighted by the depthWeight and normalWeight properties. The variance kernel can operate on two sets of source and destination textures simultaneously to share costs such as loading depth and normal values from memory, computing various weights, etc. The second set of textures may be nil. The two images are assumed to share the same depth and normal values. The reprojected source texture, luminance moments texture and frame count texture are computed by the reprojection kernel. The computed variance will be stored in the last channel of the destination image, while the source image will be copied into the previous channels, to reduce the number of texture sample instructured required by the bilateral filter in the final stage of the denoising kernel. The number of channels in the source image(s) are given by the channelCount and channelCount2 properties. Therefore, the destination image(s) must have at least channelCount + 1 and channelCount2 + 1 channels and the source image(s) must have at least channelCount and channelCount2 channels. Channels beyond the required number are ignored when reading from source textures and set to zero when writing to destination textures. The depth/normal texture must contain the depth and normal values for directly visible geometry for the current frame for each pixel. These values are packed into a four channel texture to reduce the number of texture sampling instructions required to load them. The first channel must store the depth value from zero to infinity. The normals must be stored in the last three channels as the three signed X, Y, and z components each between negative one and one. If the minimumFramesForVarianceEstimation property is less than or equal to one, variance will be estimated directly from the accumulated luminance moments so the depth/normal texture may be nil. @param commandBuffer Command buffer to encode into @param sourceTexture Current reprojected frame to denoise @param luminanceMomentsTexture Luminance moments texture @param destinationTexture Output packed color and variance image @param sourceTexture2 Second source image @param luminanceMomentsTexture2 Second luminance moments image @param destinationTexture2 Second destination image @param frameCountTexture Number of frames accumulated into the source image @param depthNormalTexture The depth and normal values for the current frame
func (*MPSSVGF) EncodeWithCoder ¶
func (o *MPSSVGF) EncodeWithCoder(coder *foundation.NSCoder)
func (*MPSSVGF) InitWithCoderDevice ¶
func (*MPSSVGF) LuminanceWeight ¶
@brief Controls how samples' luminance values are compared during bilateral filtering. The final weight is given by exp(-abs(L1 - L2) / (luminanceWeight * luminanceVariance + EPSILON)). Must be greater than or equal to zero. Defaults to 4.
func (*MPSSVGF) MinimumFramesForVarianceEstimation ¶
@brief The minimum number of frames which must be accumulated before variance can be computed directly from the accumulated luminance moments. If enough frames have not been accumulated, variance will be estimated with a spatial filter instead. Defaults to 4.
func (*MPSSVGF) NormalWeight ¶
@brief Controls how samples' normals are compared during reprojection, variance estimation, and bilateral filtering. The final weight is given by pow(max(dot(N1, N2)), normalWeight). Must be greater than or equal to zero. Defaults to 128.
func (*MPSSVGF) ReprojectionThreshold ¶
@brief During reprojection, minimum combined depth and normal weight needed to consider a pixel from the previous frame consistent with a pixel from the current frame. Must be greater than or equal to zero. Defaults to 0.01.
func (*MPSSVGF) SetBilateralFilterRadius ¶
func (*MPSSVGF) SetBilateralFilterSigma ¶
func (*MPSSVGF) SetChannelCount ¶
func (*MPSSVGF) SetChannelCount2 ¶
func (*MPSSVGF) SetDepthWeight ¶
func (*MPSSVGF) SetLuminanceWeight ¶
func (*MPSSVGF) SetMinimumFramesForVarianceEstimation ¶
func (*MPSSVGF) SetNormalWeight ¶
func (*MPSSVGF) SetReprojectionThreshold ¶
func (*MPSSVGF) SetTemporalReprojectionBlendFactor ¶
func (*MPSSVGF) SetTemporalWeighting ¶
func (o *MPSSVGF) SetTemporalWeighting(temporalWeighting MPSTemporalWeighting)
func (*MPSSVGF) SetVarianceEstimationRadius ¶
func (*MPSSVGF) SetVarianceEstimationSigma ¶
func (*MPSSVGF) SetVariancePrefilterRadius ¶
func (*MPSSVGF) SetVariancePrefilterSigma ¶
func (*MPSSVGF) TemporalReprojectionBlendFactor ¶
@brief When using MPSTemporalWeightingExponentialMovingAverage, how much to blend the current frame with the previous frame during reprojection. The final value is given by current * temporalReprojectionBlendFactor + previous * (1 - temporalReprojectionBlendFactor). Must be between zero and one, inclusive. Defaults to 0.2.
func (*MPSSVGF) TemporalWeighting ¶
func (o *MPSSVGF) TemporalWeighting() MPSTemporalWeighting
@brief How to weight samples during temporal reprojection. Defaults to MPSTemporalWeightingAverage.
func (*MPSSVGF) VarianceEstimationRadius ¶
@brief The radius of the spatial filter used when not enough frames have been accumulated to compute variance from accumulated luminance moments. Defaults to 3 resulting in a 7x7 filter.
func (*MPSSVGF) VarianceEstimationSigma ¶
@brief The sigma value of the Gaussian function used by the spatial filter used when not enough frames have been accumulated to compute variance from accumulated luminance moments. Must be greater than zero. Defaults to 2.0.
func (*MPSSVGF) VariancePrefilterRadius ¶
@brief The radius of the variance pre-filter of the bilateral filter. Defaults to 1 resulting in a 3x3 filter.
func (*MPSSVGF) VariancePrefilterSigma ¶
@brief The sigma value of the Gaussian function used by the variance pre-filter of the bilateral filter. Must be greater than zero. Defaults to 1.33.
type MPSSVGFDefaultTextureAllocator ¶
type MPSSVGFDefaultTextureAllocator struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgfdefaulttextureallocator
func MPSSVGFDefaultTextureAllocatorFromID ¶
func MPSSVGFDefaultTextureAllocatorFromID(id objc.ID) *MPSSVGFDefaultTextureAllocator
func (*MPSSVGFDefaultTextureAllocator) AllocatedTextureCount ¶
func (o *MPSSVGFDefaultTextureAllocator) AllocatedTextureCount() uint
@brief The number of textures which have been allocated from this allocator
func (*MPSSVGFDefaultTextureAllocator) Device ¶
func (o *MPSSVGFDefaultTextureAllocator) Device() metal.MTLDevice
@brief Metal device this object was allocated from
func (*MPSSVGFDefaultTextureAllocator) InitWithDevice ¶
func (o *MPSSVGFDefaultTextureAllocator) InitWithDevice(device metal.MTLDevice) *MPSSVGFDefaultTextureAllocator
@brief Initialize the MPSSVGFDefaultTextureAllocator with a Metal device
func (*MPSSVGFDefaultTextureAllocator) Reset ¶
func (o *MPSSVGFDefaultTextureAllocator) Reset()
@brief Remove all textures from the cache
func (*MPSSVGFDefaultTextureAllocator) ReturnTexture ¶
func (o *MPSSVGFDefaultTextureAllocator) ReturnTexture(texture metal.MTLTexture)
func (*MPSSVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight ¶
func (o *MPSSVGFDefaultTextureAllocator) TextureWithPixelFormatWidthHeight(pixelFormat metal.MTLPixelFormat, width uint, height uint) metal.MTLTexture
type MPSSVGFDenoiser ¶
type MPSSVGFDenoiser struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpssvgfdenoiser
func MPSSVGFDenoiserFromID ¶
func MPSSVGFDenoiserFromID(id objc.ID) *MPSSVGFDenoiser
func (*MPSSVGFDenoiser) BilateralFilterIterations ¶
func (o *MPSSVGFDenoiser) BilateralFilterIterations() uint
@brief The number of bilateral filter iterations to run. More iterations will improve quality at the cost of performance. Defaults to 5. Must be at least 1.
func (*MPSSVGFDenoiser) ClearTemporalHistory ¶
func (o *MPSSVGFDenoiser) ClearTemporalHistory()
@brief Clear the temporal history. Reprojection and temporal accumulation will restart on the next call to encodeToCommandBuffer:
func (*MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureDestinationTextureSourceTexture2DestinationTexture2MotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture ¶
func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureDestinationTextureSourceTexture2DestinationTexture2MotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, destinationTexture metal.MTLTexture, sourceTexture2 metal.MTLTexture, destinationTexture2 metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture)
@brief Encode denoising kernels to a command buffer @discussion Simultaneously removes noise from the source texture and optional second source texture, using the additional data in the motion vector, depth/normal, and previous depth/normal textures. Returns the result through the destination texture pointers. The depth/normal texture should be provided as the previous depth/normal texture for the next call to this method. This method will also update an internally managed temporal history to aid the denoising process. To reset this history, call the clearTemporalHistory method. This method will allocate and return several textures from and to the texture allocator the MPSSVGFDenoiser was initialized with. The number of iterations of the bilateral filter is controlled by the bilateralFilterIterations property. Larger numbers of iterations will improve the quality but reduce performance. To configure other parameters of the denoising process, modify the properties of the MPSSVGF object the MPSSVGFDenoiser was initialized with. @parameter commandBuffer Command buffer to encode into @parameter sourceTexture Source image to denoiser @parameter destinationTexture Denoised output image @parameter sourceTexture2 Optional second source image to denoise @parameter destinationTexture2 Denoised second output image, if there is a second source image @parameter motionVectorTexture Motion vector texture describing how much each texel has moved, in texels, since the previous frame. See the MPSSVGF object for more details. @parameter depthNormalTexture Texture containing linear depth in the X component and signed normals in the YZW components. See the MPSSVGF object for more details. @parameter previousDepthNormalTexture Depth/normal texture from the previous frame. See the MPSSVGF object for more details.
func (*MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture ¶
func (o *MPSSVGFDenoiser) EncodeToCommandBufferSourceTextureMotionVectorTextureDepthNormalTexturePreviousDepthNormalTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthNormalTexture metal.MTLTexture, previousDepthNormalTexture metal.MTLTexture) metal.MTLTexture
@brief Encode denoising kernels to a command buffer @discussion Removes noise from the source texture, using the additional data in the motion vector, depth/normal, and previous depth/normal textures. Returns the resulting texture. The depth/normal texture should be provided as the previous depth/normal texture for the next call to this method. This method will also update an internally managed temporal history to aid the denoising process. To reset this history, call the clearTemporalHistory method. This method will allocate and return several textures from and to the texture allocator the MPSSVGFDenoiser was initialized with. The number of iterations of the bilateral filter is controlled by the bilateralFilterIterations property. Larger numbers of iterations will improve the quality but reduce performance. To configure other parameters of the denoising process, modify the properties of the MPSSVGF object the MPSSVGFDenoiser was initialized with. @parameter commandBuffer Command buffer to encode into @parameter sourceTexture Source image to denoiser @parameter motionVectorTexture Motion vector texture describing how much each texel has moved, in texels, since the previous frame. See the MPSSVGF object for more details. @parameter depthNormalTexture Texture containing linear depth in the X component and signed normals in the YZW components. See the MPSSVGF object for more details. @parameter previousDepthNormalTexture Depth/normal texture from the previous frame. See the MPSSVGF object for more details.
func (*MPSSVGFDenoiser) InitWithDevice ¶
func (o *MPSSVGFDenoiser) InitWithDevice(device metal.MTLDevice) *MPSSVGFDenoiser
@brief Initialize the MPSSVGFDenoiser object @parameter device The Metal device to use for denoising
func (*MPSSVGFDenoiser) InitWithSVGFTextureAllocator ¶
func (o *MPSSVGFDenoiser) InitWithSVGFTextureAllocator(svgf *MPSSVGF, textureAllocator MPSSVGFTextureAllocator) *MPSSVGFDenoiser
@brief Initialize the MPSSVGFDenoiser object @parameter svgf MPSSVGF kernels to use for denoising. This object can be used to configure temporal reprojection, bilateral blur settings, etc. @parameter textureAllocator An object conforming to the MPSSVGFTextureAllocator protocol. This object will be used to allocate temporary intermediate and output textures. This can be a custom object or an instance of the MPSSVGFDefaultTextureAllocator class.
func (*MPSSVGFDenoiser) ReleaseTemporaryTextures ¶
func (o *MPSSVGFDenoiser) ReleaseTemporaryTextures()
@brief Return any temporary textures to the texture allocator. Also clears the temporal history. This should be called before resizing the source texture(s).
func (*MPSSVGFDenoiser) SetBilateralFilterIterations ¶
func (o *MPSSVGFDenoiser) SetBilateralFilterIterations(bilateralFilterIterations uint)
func (*MPSSVGFDenoiser) Svgf ¶
func (o *MPSSVGFDenoiser) Svgf() *MPSSVGF
@brief The underlying MPSSVGF kernels object which will be used for denoising. Use this object to customize the denoising process.
func (*MPSSVGFDenoiser) TextureAllocator ¶
func (o *MPSSVGFDenoiser) TextureAllocator() MPSSVGFTextureAllocator
@brief The object which will be used to allocate intermediate and output textures.
type MPSSVGFTextureAllocator ¶
type MPSSVGFTextureAllocator interface {
TextureWithPixelFormatWidthHeight(pixelFormat metal.MTLPixelFormat, width uint, height uint) metal.MTLTexture
ReturnTexture(texture metal.MTLTexture)
}
MPSSVGFTextureAllocator wraps the ObjC protocol MPSSVGFTextureAllocator.
type MPSTemporalAA ¶
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpstemporalaa
func MPSTemporalAAFromID ¶
func MPSTemporalAAFromID(id objc.ID) *MPSTemporalAA
func (*MPSTemporalAA) BlendFactor ¶
func (o *MPSTemporalAA) BlendFactor() float32
@brief How much to blend the current frame with the previous frame during temporal antialiasing. The final value is given by current * blendFactor + previous * (1 - blendFactor). Must be between zero and one, inclusive. Defaults to 0.1.
func (*MPSTemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture ¶
func (o *MPSTemporalAA) EncodeToCommandBufferSourceTexturePreviousTextureDestinationTextureMotionVectorTextureDepthTexture(commandBuffer metal.MTLCommandBuffer, sourceTexture metal.MTLTexture, previousTexture metal.MTLTexture, destinationTexture metal.MTLTexture, motionVectorTexture metal.MTLTexture, depthTexture metal.MTLTexture)
@brief Encode temporal antialiasing a command buffer @discussion The motion vector texture must be at least a two channel texture representing how many texels each texel in the source image(s) have moved since the previous frame. The remaining channels will be ignored if present. This texture may be nil, in which case the motion vector is assumed to be zero, which is suitable for static images. The depth texture must contain the depth values for directly visible geometry for the current frame for each pixel. The first channel must store the depth value from zero to infinity. The depth texture may be nil, but this will prevent motion vectors from being dilated and may introduce aliasing along silhouette edges. The destination texture should be used as the previous texture in the next frame. @param commandBuffer Command buffer to encode into @param sourceTexture Current frame to denoise @param previousTexture Previous denoised frame to reproject into current frame @param destinationTexture Output blended image @param motionVectorTexture Motion vector texture @param depthTexture The depth values for the current frame
func (*MPSTemporalAA) EncodeWithCoder ¶
func (o *MPSTemporalAA) EncodeWithCoder(coder *foundation.NSCoder)
func (*MPSTemporalAA) InitWithCoderDevice ¶
func (o *MPSTemporalAA) InitWithCoderDevice(aDecoder *foundation.NSCoder, device metal.MTLDevice) *MPSTemporalAA
func (*MPSTemporalAA) InitWithDevice ¶
func (o *MPSTemporalAA) InitWithDevice(device metal.MTLDevice) *MPSTemporalAA
func (*MPSTemporalAA) SetBlendFactor ¶
func (o *MPSTemporalAA) SetBlendFactor(blendFactor float32)
type MPSTemporalWeighting ¶
type MPSTemporalWeighting uint64
@brief Controls how samples are weighted over time
const ( // @brief Compute an average of all samples. This will fully utilize all samples but may lead to excessive ghosting artifacts under motion. Therefore, this is best for static images. MPSTemporalWeightingAverage MPSTemporalWeighting = 0 // @brief Compute an exponential moving average by blending linearly between the previous accumulated samples and the current sample according to the temporalReprojectionBlendFactor property. This will cause older samples to lose their contribution over time, which will prevent ghosting artifacts but will also never converge to a stable value. Therefore, this is best for images with motion. MPSTemporalWeightingExponentialMovingAverage MPSTemporalWeighting = 1 )
func (MPSTemporalWeighting) String ¶
func (e MPSTemporalWeighting) String() string
type MPSTransformType ¶
type MPSTransformType uint64
@brief Instance transformation type options
const ( // @brief Instance transformations are represented by a 4x4 column major matrix of 32 bit floats MPSTransformTypeFloat4x4 MPSTransformType = 0 // @brief All instances have the identity transformation (no transformation). This can be used to compose multiple polygon acceleration structures in an instance acceleration structure without the cost of transforming instances. For example, geometry can be divided into static and dynamic polygon acceleration structures which can be rebuilt and refit independently. MPSTransformTypeIdentity MPSTransformType = 1 )
func (MPSTransformType) String ¶
func (e MPSTransformType) String() string
type MPSTriangleAccelerationStructure ¶
type MPSTriangleAccelerationStructure struct {
MPSPolygonAccelerationStructure
}
Apple documentation: https://developer.apple.com/documentation/mpsrayintersector/mpstriangleaccelerationstructure
func MPSTriangleAccelerationStructureFromID ¶
func MPSTriangleAccelerationStructureFromID(id objc.ID) *MPSTriangleAccelerationStructure
func (*MPSTriangleAccelerationStructure) SetTriangleCount ¶
func (o *MPSTriangleAccelerationStructure) SetTriangleCount(triangleCount uint)
func (*MPSTriangleAccelerationStructure) TriangleCount ¶
func (o *MPSTriangleAccelerationStructure) TriangleCount() uint
@brief Number of triangles. Changes to this property require rebuilding the acceleration structure. Note that this property is an alias for the polygonCount property.
type MPSTriangleIntersectionTestType ¶
type MPSTriangleIntersectionTestType uint64
@brief Options for the MPSRayIntersector triangle intersection test type property
const ( // @brief Use the default ray/triangle intersection test MPSTriangleIntersectionTestTypeDefault MPSTriangleIntersectionTestType = 0 // @brief Use a watertight ray/triangle intersection test which avoids gaps along shared triangle edges. Shared vertices may still have gaps. This intersection test may be slower than MPSTriangleIntersectionTestTypeDefault. MPSTriangleIntersectionTestTypeWatertight MPSTriangleIntersectionTestType = 1 )
func (MPSTriangleIntersectionTestType) String ¶
func (e MPSTriangleIntersectionTestType) String() string
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t int64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t int64
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t int64
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t int64
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type Os_clockid_t ¶
type Os_clockid_t int64
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type Ptrauth_key ¶
type Ptrauth_key int64
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t int64
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t int64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t int64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string
Source Files
¶
- MPSAccelerationStructure.go
- MPSAccelerationStructureGroup.go
- MPSInstanceAccelerationStructure.go
- MPSPolygonAccelerationStructure.go
- MPSPolygonBuffer.go
- MPSQuadrilateralAccelerationStructure.go
- MPSRayIntersector.go
- MPSSVGF.go
- MPSSVGFDefaultTextureAllocator.go
- MPSSVGFDenoiser.go
- MPSTemporalAA.go
- MPSTriangleAccelerationStructure.go
- doc.go
- mpsrayintersector_enums.go
- mpsrayintersector_protocols.go
- mpsrayintersector_runtime.go
- mpsrayintersector_structs.go