Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
remcoder committed Jan 13, 2025
1 parent 9aab873 commit 4781862
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/dev-gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class DevGUI {
render.add(this.webglPreview.renderer.info.memory, 'textures').listen();
render.add(this.webglPreview, '_lastRenderTime').listen();

render.add(this.webglPreview, 'ambientLight', 0, 1, 0.01 );
render.add(this.webglPreview, 'directionalLight', 0, 2, 0.1 );
render.add(this.webglPreview, 'brightness', 0, 2, 0.1 );
render.add(this.webglPreview, 'ambientLight', 0, 1, 0.01);
render.add(this.webglPreview, 'directionalLight', 0, 2, 0.1);
render.add(this.webglPreview, 'brightness', 0, 2, 0.1);
}

private setupCameraFolder(): void {
Expand Down
14 changes: 9 additions & 5 deletions src/helpers/colorMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ShaderMaterial } from "three/src/materials/ShaderMaterial.js";
import { Color } from "three/src/math/Color.js";
import { ShaderMaterial } from 'three/src/materials/ShaderMaterial.js';
import { Color } from 'three/src/math/Color.js';

/*
This file contains a custom ShaderMaterial that calculates the lighting of a mesh based on the normal of the mesh and a fixed light direction.
Expand Down Expand Up @@ -48,8 +48,13 @@ const fragmentShader = `
`;

// ShaderMaterial
export function createColorMaterial(color: number, ambient: number, directional: number, brightness: number): ShaderMaterial {
console.log(color, ambient, directional);
export function createColorMaterial(
color: number,
ambient: number,
directional: number,
brightness: number
): ShaderMaterial {
console.log(color, ambient, directional);
const material = new ShaderMaterial({
vertexShader,
fragmentShader,
Expand All @@ -63,4 +68,3 @@ export function createColorMaterial(color: number, ambient: number, directional:

return material;
}

4 changes: 1 addition & 3 deletions src/webgl-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
Euler,
Group,
Material,
MeshLambertMaterial,
PerspectiveCamera,
Plane,
PointLight,
Expand Down Expand Up @@ -101,7 +100,7 @@ export class WebGLPreview {
private prevStartLayer = 0;

// shader material
private materials: ShaderMaterial[] =[];
private materials: ShaderMaterial[] = [];
private _ambientLight = 0.4;
private _directionalLight = 1.3;
private _brightness = 1.3;
Expand All @@ -121,7 +120,6 @@ export class WebGLPreview {
private statsContainer?: HTMLElement;
private devGui?: DevGUI;
private preserveDrawingBuffer = false;


constructor(opts: GCodePreviewOptions) {
this.minLayerThreshold = opts.minLayerThreshold ?? this.minLayerThreshold;
Expand Down

0 comments on commit 4781862

Please sign in to comment.