Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nodes/utils/PostProcessingUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const interleavedGradientNoise = Fn( ( [ position ] ) => {
export const vogelDiskSample = Fn( ( [ sampleIndex, samplesCount, phi ] ) => {

const goldenAngle = float( 2.399963229728653 ); // 2π * (2 - φ) where φ is golden ratio
const r = sqrt( float( sampleIndex ).add( 0.5 ) ).div( sqrt( float( samplesCount ) ) );
const r = sqrt( float( sampleIndex ).add( 0.5 ).div( float( samplesCount ) ) );
const theta = float( sampleIndex ).mul( goldenAngle ).add( phi );
return vec2( cos( theta ), sin( theta ) ).mul( r );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default /* glsl */`
vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {

const float goldenAngle = 2.399963229728653;
float r = sqrt( float( sampleIndex ) + 0.5 ) / sqrt( float( samplesCount ) );
float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
float theta = float( sampleIndex ) * goldenAngle + phi;
return vec2( cos( theta ), sin( theta ) ) * r;

Expand Down