@@ -205,9 +205,14 @@ const spaceWarp = TSL.Fn( ( [ p, warpStrength, xyScale, zScale ] ) => {
205205
206206const woodRings = TSL . Fn ( ( [ w , ringCount , ringBias , ringSizeVariance , ringVarianceScale , barkThickness ] ) => {
207207
208- const rings = noiseFbm ( w . mul ( ringVarianceScale ) , TSL . float ( 1 ) , TSL . float ( 0.5 ) , TSL . float ( 2 ) , TSL . int ( 1 ) ) . mul ( ringSizeVariance ) . add ( w ) . mul ( ringCount ) . fract ( ) . mul ( barkThickness ) ;
208+ const rings = noiseFbm ( w . mul ( ringVarianceScale ) , TSL . float ( 1 ) , TSL . float ( 0.5 ) , TSL . float ( 1 ) , TSL . int ( 1 ) ) . mul ( ringSizeVariance ) . add ( w ) . mul ( ringCount ) . fract ( ) . mul ( barkThickness ) ;
209209
210- return TSL . min ( mapRange ( rings , 0 , ringBias , 0 , 1 , TSL . bool ( true ) ) , mapRange ( rings , ringBias , 1 , 1 , 0 , TSL . bool ( true ) ) ) ;
210+ const sharpRings = TSL . min ( mapRange ( rings , 0 , ringBias , 0 , 1 , TSL . bool ( true ) ) , mapRange ( rings , ringBias , 1 , 1 , 0 , TSL . bool ( true ) ) ) ;
211+
212+ const blurAmount = TSL . max ( TSL . positionView . length ( ) . div ( 10 ) , 1 ) ;
213+ const blurredRings = TSL . smoothstep ( blurAmount . negate ( ) , blurAmount , sharpRings . sub ( 0.5 ) ) . mul ( 0.5 ) . add ( 0.5 ) ;
214+
215+ return blurredRings ;
211216
212217} ) ;
213218
@@ -257,7 +262,7 @@ const wood = TSL.Fn( ( [
257262 const detailWarp = spaceWarp ( mainWarp , fineWarpStrength , fineWarpScale , 0.17 ) ;
258263 const rings = woodRings ( detailWarp . length ( ) , ringCount , ringBias , ringSizeVariance , ringVarianceScale , barkThickness ) ;
259264 const detail = woodDetail ( detailWarp , p , detailWarp . length ( ) , splotchScale ) ;
260- const cells = cellStructure ( mainWarp , cellScale , cellSize ) ;
265+ const cells = cellStructure ( mainWarp , cellScale , cellSize . div ( TSL . max ( TSL . positionView . length ( ) . mul ( 10 ) , 1 ) ) ) ;
261266 const baseColor = TSL . mix ( darkGrainColor , lightGrainColor , rings ) ;
262267
263268 return softLightMix ( splotchIntensity , softLightMix ( 0.407 , baseColor , cells ) , detail ) ;
0 commit comments