mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
shadow focus and res
This commit is contained in:
1 parent
72de42a9ab
commit
486171f4db
2 files changed
+8
-2
No files matched your search
+7
@@ -23,14 +23,19 @@ const TRANSITION_ANIMATION_TIME = 0.5;
|
|||||||
|
|
||||||
const LIGHTS_COUNT = 3;
|
const LIGHTS_COUNT = 3;
|
||||||
const THETA_OFFSET = degToRad(180 - 45);
|
const THETA_OFFSET = degToRad(180 - 45);
|
||||||
|
|
||||||
const LIGHT_DISTANCE = 20;
|
const LIGHT_DISTANCE = 20;
|
||||||
const LIGHT_HEIGHT_0 = 7;
|
const LIGHT_HEIGHT_0 = 7;
|
||||||
const LIGHT_HEIGHT_1 = 10;
|
const LIGHT_HEIGHT_1 = 10;
|
||||||
|
|
||||||
const INTENSITY_0 = 2 ** 6;
|
const INTENSITY_0 = 2 ** 6;
|
||||||
const INTENSITY_1 = 2 ** 3;
|
const INTENSITY_1 = 2 ** 3;
|
||||||
const HEMISPHERE_INTENSITY = 2 ** 0.7;
|
const HEMISPHERE_INTENSITY = 2 ** 0.7;
|
||||||
const NON_PBR_FACTOR = 2;
|
const NON_PBR_FACTOR = 2;
|
||||||
|
|
||||||
|
const SHADOW_RESOLUTION = 2 ** 9;
|
||||||
|
const SHADOW_FOCUS = 2 ** 0;
|
||||||
|
|
||||||
export const transitionEvent = new Quicklime<number>(0);
|
export const transitionEvent = new Quicklime<number>(0);
|
||||||
|
|
||||||
export function Lighting() {
|
export function Lighting() {
|
||||||
@@ -107,6 +112,8 @@ export function Lighting() {
|
|||||||
color="#ffffff"
|
color="#ffffff"
|
||||||
angle={0}
|
angle={0}
|
||||||
target-position={[0, 1.5, 0]}
|
target-position={[0, 1.5, 0]}
|
||||||
|
shadow-mapSize={[SHADOW_RESOLUTION, SHADOW_RESOLUTION]}
|
||||||
|
shadow-focus={SHADOW_FOCUS}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
+1
-2
@@ -2,7 +2,7 @@ import { mauveDark } from "@radix-ui/colors";
|
|||||||
import { invalidate } from "@react-three/fiber";
|
import { invalidate } from "@react-three/fiber";
|
||||||
import { Quicklime, type QuicklimeEvent } from "quicklime";
|
import { Quicklime, type QuicklimeEvent } from "quicklime";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { Color, Mesh, MeshStandardMaterial } from "three";
|
import { Color, Mesh } from "three";
|
||||||
import fragmentShader from "./shaders/fragment.glsl?raw";
|
import fragmentShader from "./shaders/fragment.glsl?raw";
|
||||||
import vertexShader from "./shaders/vertex.glsl?raw";
|
import vertexShader from "./shaders/vertex.glsl?raw";
|
||||||
|
|
||||||
@@ -12,7 +12,6 @@ export const screenshotReadyEvent = new Quicklime(false);
|
|||||||
|
|
||||||
export function SceneProps() {
|
export function SceneProps() {
|
||||||
const mesh = useRef<Mesh>(null!);
|
const mesh = useRef<Mesh>(null!);
|
||||||
const material = useRef<MeshStandardMaterial>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleScreenshotReady(event: QuicklimeEvent<boolean>) {
|
function handleScreenshotReady(event: QuicklimeEvent<boolean>) {
|
||||||
|
|||||||
Reference in new issue
Block a user