I am trying to sample a texture inside a Metal vertex shader.
Receiving the following error: "AGX: AGX: Texture read/write assertion failed: depth > 0"
Setup for rendering:
` MTLSamplerDescriptor *samplerDesc = [MTLSamplerDescriptor new];
samplerDesc.normalizedCoordinates = YES;
samplerDesc.rAddressMode = MTLSamplerAddressModeClampToEdge;
samplerDesc.sAddressMode = MTLSamplerAddressModeClampToEdge;
samplerDesc.tAddressMode = MTLSamplerAddressModeClampToEdge;
samplerDesc.minFilter = MTLSamplerMinMagFilterNearest;
samplerDesc.magFilter = MTLSamplerMinMagFilterNearest;
samplerDesc.mipFilter = MTLSamplerMipFilterNotMipmapped;
id ss = [device newSamplerStateWithDescriptor:samplerDesc];
[ commandEncoder setVertexSamplerState : ss atIndex : 0 ];
[ commandEncoder setVertexTexture : l_Texture_Height_Field
atIndex : CTI_Gradient ];
Vertex` Shader:
`vertex PVertex vertexShader_mkali ( uint vertexID [ [ vertex_id ] ],
constant Vertex3D *vertexArray [ [ buffer ( CVI_Vertices ) ] ],
constant vector_uint2 *viewportSizePointer [ [ buffer ( CVI_ViewportSize ) ] ],
constant shader_Data_mkali &vertex_Shader_Data [ [ buffer ( CVI_ShaderData ) ] ],
texture2d < float > heightTexture [ [ texture ( CTI_Gradient ) ] ],
sampler smp [ [ sampler ( 0 ) ] ]
)
{
PVertex outVertex;
float2 l_Point = vertexArray [ vertexID ].position.xy;
l_Point.x = mkali_noxstep( -1.0, 1.0, l_Point.x );
l_Point.y = mkali_noxstep( -1.0, 1.0, l_Point.y );
float4 l_Texture_Heightfield = heightTexture.sample ( smp, l_Point );
outVertex.position = float4 ( vertexArray [ vertexID ].position + float3 ( l_Texture_Heightfield.x, 0.0, 0.0 ), 1.0 );
outVertex.color = float4 ( 1.0, 0.5, 0.0, 1.0 );
outVertex.size = 30;
return outVertex;
}`
Anybody have any ideas?
thank you, Nikki
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
FxPlug 4 How do I force a render in the active project?
Thank you,
David Patrick Farmer
Why do Motion keyframed values do not call parameterChanged even thought the value changed?
The work around was painful.
Please let me know if it can be done with parameterChanged.
thank you,
David Patrick Farmer
How do I get the 3D transform of a layer from an Image Well parameter?
matrix_float4x4 l_Transform_Mask_Texture;
FxMatrix44 *l_Pixel_Transform_Temporary = sourceImages [ ki_Mask ].pixelTransform;
Matrix44Data *l_Pixel_Transform = [ l_Pixel_Transform_Temporary matrix ];
Always returns identity matrix.
If I retrieve the pixelTransform on the destinationImage I get something but it must be relating to the tile and that layer's transform.
Could use some help here.
thank you,
David Patrick Farmer