17 float(m3hash << 8) /
float(0xFFFFFFFFu),
18 float(m3hash << 16) /
float(0xFFFFFFFFu),
33 void store(
int2 texel,
float material_hash, uint resource_id)
49 for (
int i = 0; i < layer_len; i++) {
57 int cryptomatte_layer_id,
58 int cryptomatte_samples_len,
62 if (crypto_sample.
y == 0.0f) {
66 for (
int i = 0; i < cryptomatte_samples_len / 2; i++) {
67 int3 img_co =
int3(dst.texel, cryptomatte_layer_id + i);
69 if (can_merge_sample(sample_pair.xy, crypto_sample)) {
70 sample_pair.xy = merge_sample(dst, sample_pair.xy, crypto_sample);
74 if (cryptomatte_layer_id + i == 0) {
78 else if (can_merge_sample(sample_pair.zw, crypto_sample)) {
79 sample_pair.zw = merge_sample(dst, sample_pair.zw, crypto_sample);
81 else if (i == ((cryptomatte_samples_len / 2) - 1)) {
102 if (dst.
x == src.
x) {
110 float coverage = (dst.
y * film_sample.weight + src.
y) * film_sample.weight_sum_inv;
112 if (coverage > 0.9999f) {
115 return float2(src.
x, coverage);
#define RBUFS_CRYPTOMATTE_SLOT
#define CRYPTOMATTE_BUF_SLOT
#define storage(slot, qualifiers)
#define image(slot, qualifiers, format)
VecBase< uint, D > floatBitsToUint(VecOp< float, D >) RET
bool all(VecOp< bool, D >) RET
VecBase< bool, D > equal(VecOp< T, D >, VecOp< T, D >) RET
IMG_TEMPLATE DataVec imageLoad(const T &, IntCoord) RET
ImageBase< float, 2, true > image2DArray
ImageBase< float, 2 > image2D
IMG_TEMPLATE void imageFence(T &)
IMG_TEMPLATE SizeVec imageSize(const T &) RET
VecBase< float, 2 > float2
float4 false_color(float hash)
image2D rp_cryptomatte_img
const float2(& cryptomatte_object_buf)[]
void store(int2 texel, float material_hash, uint resource_id)
void clear_samples(FilmSample dst)
image2DArray cryptomatte_img
void store_film_sample(FilmSample dst, int cryptomatte_layer_id, int cryptomatte_samples_len, float2 crypto_sample, float4 &out_color)