mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: more lighting
This commit is contained in:
1 parent
5d397de766
commit
5c2e49453e
4 files changed
+17
-8
No files matched your search
@@ -1,10 +1,17 @@
|
||||
import type { SpotLightProps } from '@react-three/fiber';
|
||||
import { memo } from 'react';
|
||||
import { Color } from 'three';
|
||||
import { isHalloween } from '../core/blitzkit/isHalloween';
|
||||
|
||||
interface Props extends SpotLightProps {
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export function HelpingSpotLight({ debug, ...props }: Props) {
|
||||
export const HelpingSpotLight = memo<Props>(({ debug, ...props }) => {
|
||||
const color = new Color();
|
||||
|
||||
if (isHalloween()) color.set(1, 0.25, 0.25);
|
||||
|
||||
return (
|
||||
<>
|
||||
{debug && (
|
||||
@@ -14,7 +21,7 @@ export function HelpingSpotLight({ debug, ...props }: Props) {
|
||||
</mesh>
|
||||
)}
|
||||
|
||||
<spotLight {...props} />
|
||||
<spotLight color={color} {...props} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user