Skip to content

Commit

Permalink
fix: merge main conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKou47 committed Jan 9, 2025
2 parents 8c5f216 + 340197c commit 64ccb02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/custom-material/src/grid/GridControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export class GridControl extends Script {
material.nearClipPlane = camera.nearClipPlane;
material.farClipPlane = camera.farClipPlane;

const logDistance = Math.log2(this.distance);
const upperDistance = Math.pow(2, Math.floor(logDistance) + 1);
const lowerDistance = Math.pow(2, Math.floor(logDistance));
const logDistance = Math.log10(this.distance);
const upperDistance = Math.pow(10, Math.floor(logDistance) + 1);
const lowerDistance = Math.pow(10, Math.floor(logDistance));
material.fade = (this.distance - lowerDistance) / (upperDistance - lowerDistance);

const level = -Math.floor(logDistance);
material.primaryScale = Math.pow(2, level);
material.secondaryScale = Math.pow(2, level + 1);
material.primaryScale = Math.pow(10, level);
material.secondaryScale = Math.pow(10, level + 1);
material.axisIntensity = 0.3 / material.primaryScale;

if (this._flipGrid) {
Expand Down

0 comments on commit 64ccb02

Please sign in to comment.