File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 123123
124124 const gridXZ = Fn ( ( [ gridSize = float ( 1.0 ) , dotWidth = float ( 0.1 ) , lineWidth = float ( 0.02 ) ] ) => {
125125
126- const worldPos = positionWorld ;
127- const coord = worldPos . xz . div ( gridSize ) ;
126+ const coord = positionWorld . xz . div ( gridSize ) ;
128127 const grid = fract ( coord ) ;
129128
130129 // Screen-space derivative for automatic antialiasing
135134 const squareDist = max ( abs ( grid . x . sub ( 0.5 ) ) , abs ( grid . y . sub ( 0.5 ) ) ) ;
136135 const dots = smoothstep ( dotWidth . add ( smoothing ) , dotWidth . sub ( smoothing ) , squareDist ) ;
137136
138- // Create grid lines with derivative-based antialiasing
137+ // Create grid lines
139138 const lineX = smoothstep ( lineWidth . add ( smoothing ) , lineWidth . sub ( smoothing ) , abs ( grid . x . sub ( 0.5 ) ) ) ;
140139 const lineZ = smoothstep ( lineWidth . add ( smoothing ) , lineWidth . sub ( smoothing ) , abs ( grid . y . sub ( 0.5 ) ) ) ;
141140 const lines = max ( lineX , lineZ ) ;
You can’t perform that action at this time.
0 commit comments