From d659013d63635911d769ad86f3b42d5d2cf93f66 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 19 四月 2024 13:22:22 +0800
Subject: [PATCH] #

---
 src/config/setting.js    |    2 +-
 src/components/light.jsx |   14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/components/light.jsx b/src/components/light.jsx
index 977f3f3..28c2bdb 100644
--- a/src/components/light.jsx
+++ b/src/components/light.jsx
@@ -1,13 +1,15 @@
-import React, { useRef } from 'react';
-import { SpotLight, useDepthBuffer, useHelper } from '@react-three/drei';
+import React, { useRef, useEffect } from 'react';
+import { SpotLight, useHelper } from '@react-three/drei';
 import { DEBUG } from '../config/setting';
-import { SpotLightHelper } from 'three';
+import { SpotLightHelper, DirectionalLightHelper } from 'three';
 
 const Lights = () => {
     const spotLightRef = useRef();
+    const directionalLightRef = useRef();
 
     if (DEBUG) {
         useHelper(spotLightRef, SpotLightHelper, 'teal');
+        useHelper(directionalLightRef, DirectionalLightHelper, 'teal');
     }
 
     return (
@@ -15,7 +17,6 @@
             <ambientLight intensity={0.5} />
             <directionalLight color={0xffffff} intensity={3} position={[10, 10, 0]} />
             <SpotLight
-                ref={spotLightRef}
                 intensity={DEBUG ? 10 : 5}
                 color="#ffffff"
                 position={[3, DEBUG ? 5000 : 900, 2]}
@@ -29,6 +30,11 @@
                 shadow-camera-near={200}
                 shadow-camera-far={2000}
             />
+            <directionalLight
+                position={[0, -5, 0]}
+                color="#ffffff"
+                intensity={.6}
+            />
         </>
     );
 };
diff --git a/src/config/setting.js b/src/config/setting.js
index f660253..1e15f04 100644
--- a/src/config/setting.js
+++ b/src/config/setting.js
@@ -4,4 +4,4 @@
 
 export const UN_AUTH_CODE = 403;
 
-export const DEBUG = true;
+export const DEBUG = false;

--
Gitblit v1.9.1