@@ -368,30 +368,25 @@ __kernel void ShadeSurface(
368
368
#elif (CMJ == 1 )
369
369
Rng rng ;
370
370
InitRng (rngseed + (globalid << 2 ) * 157 + 13 , & rng );
371
- float2 sample0 = UniformSampler_Sample2D (& rng );
372
- float2 sample1 = UniformSampler_Sample2D (& rng );
373
- float2 sample2 = UniformSampler_Sample2D (& rng );
374
- float2 sample3 = UniformSampler_Sample2D (& rng );
375
- float sample4 = UniformSampler_Sample2D (& rng ).x ;
376
371
377
372
int pass = frame / (CMJ_DIM * CMJ_DIM );
378
- int subsample0 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pixelidx + bounce ) * 0xc517e953 );
379
- int subsample1 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pixelidx + bounce + 1 ) * 0xc517e953 );
380
- int subsample2 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pixelidx + bounce + 2 ) * 0xc517e953 );
381
- int subsample3 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pixelidx + bounce + 3 ) * 0xc517e953 );
382
- int subsample4 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pixelidx + bounce + 4 ) * 0xc517e953 );
373
+ int subsample0 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pass + pixelidx + bounce ) * 0xc517e953 );
374
+ int subsample1 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pass + pixelidx + bounce + 1 ) * 0xc517e953 );
375
+ int subsample2 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pass + pixelidx + bounce + 2 ) * 0xc517e953 );
376
+ int subsample3 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pass + pixelidx + bounce + 3 ) * 0xc517e953 );
377
+ int subsample4 = permute (frame % (CMJ_DIM * CMJ_DIM ), CMJ_DIM * CMJ_DIM , (pass + pixelidx + bounce + 4 ) * 0xc517e953 );
383
378
384
379
int pattern0 = (pass + bounce + pixelidx ) % 13331 ;
385
380
int pattern1 = (pass + bounce + pixelidx + 1 ) % 13331 ;
386
381
int pattern2 = (pass + bounce + pixelidx + 2 ) % 13331 ;
387
382
int pattern3 = (pass + bounce + pixelidx + 3 ) % 13331 ;
388
383
int pattern4 = (pass + bounce + pixelidx + 4 ) % 13331 ;
389
384
390
- sample0 = cmj (subsample0 , CMJ_DIM , pattern0 );
391
- sample1 = cmj (subsample1 , CMJ_DIM , pattern1 );
392
- sample2 = cmj (subsample2 , CMJ_DIM , pattern2 );
393
- sample3 = cmj (subsample3 , CMJ_DIM , pattern2 );
394
- sample4 = cmj (subsample4 , CMJ_DIM , pattern2 ).x ;
385
+ float2 sample0 = cmj (subsample0 , CMJ_DIM , pattern0 );
386
+ float2 sample1 = cmj (subsample1 , CMJ_DIM , pattern1 );
387
+ float2 sample2 = cmj (subsample2 , CMJ_DIM , pattern2 );
388
+ float2 sample3 = cmj (subsample3 , CMJ_DIM , pattern3 );
389
+ float sample4 = cmj (subsample4 , CMJ_DIM , pattern4 ).x ;
395
390
#else
396
391
397
392
#endif
0 commit comments