mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
Eight more environment variables become props, each variable now only an override on every camera:
- <AntiAliasing steady={{ still, moving, px }}>: steady's rates (systems/post Steady's fields), over RAEA_STEADY_*.
RAEA_STEADY stays the every-camera form of mode="steady".
- <MotionBlur kind="shutter"|"bevy">, over RAEA_MOTION_BLUR.
- <Pathtracer samples media>, over RAEA_LIGHT_SPP and RAEA_PT_MEDIA=0. They live in raea_sys_frame::pathtracer
(PathtracerSettings), so the fog's volumes can read media. A render draws each frame as many times as the most any
camera asks for.
- <SolariLighting dynamic>, over RAEA_SOLARI_DYNAMIC. This was read once when the plugin was built. It is now a
SolariSettings field, and the skin-twin and hidden-part systems run while any traced camera asks for it.
tools/nobuild.sh props gains a column for the composition the variables go on (RAEA_STEADY needs a scene without
steady), and a "traced" light path for a scene that asks for Solari or the path tracer itself. Settings with no trace
record of their own are checked by pixels alone. Three fixtures join fog.tsx: steady.tsx, blur.tsx and traced.tsx
(Pathtracer and Solari, with a slab there on the first frame only). All 15 rows pass:
- steady, its rates and the blur's kind are pixel-identical to their variables;
- the path tracer is deterministic, so samples and media compare exactly too: 21 and 27 levels from the default's;
- dynamic is as near its variable as two runs are (0.013 against 0.014), and the hidden slab's shadow is gone (5.8
levels).
docs/nobuild.feature NB1a.
45 lines
2.3 KiB
TypeScript
45 lines
2.3 KiB
TypeScript
import { Composition, registerRoot, useCurrentFrame } from "raea";
|
|
import { Camera3d } from "raea/camera";
|
|
import { LinearRgba, Srgba } from "raea/color";
|
|
import { DirectionalLight, Pathtracer, type PathtracerProps, SolariLighting, type SolariLightingProps } from "raea/light";
|
|
import { Cuboid, Mesh3d } from "raea/mesh";
|
|
import { FogVolume, StandardMaterial } from "raea/pbr";
|
|
import { Transform } from "raea/transform";
|
|
|
|
// docs/nobuild.feature NB1a: <Pathtracer samples media> against RAEA_LIGHT_SPP and RAEA_PT_MEDIA, and <SolariLighting
|
|
// dynamic> against RAEA_SOLARI_DYNAMIC (tools/nobuild.sh props). A floor, a glowing panel, a volume of air, and a slab
|
|
// over the floor that is there on the first frame only: hidden after, it still shadows the floor unless the traced scene
|
|
// follows what moves (dynamic).
|
|
const TRACED: Record<string, { pt?: PathtracerProps; solari?: SolariLightingProps }> = {
|
|
trace: { pt: {} },
|
|
spp: { pt: { samples: 4 } },
|
|
nomedia: { pt: { media: false } },
|
|
solari: { solari: {} },
|
|
dynamic: { solari: { dynamic: true } },
|
|
};
|
|
|
|
function Scene({ pt, solari }: { pt?: PathtracerProps; solari?: SolariLightingProps }) {
|
|
const f = useCurrentFrame();
|
|
return (
|
|
<>
|
|
<Camera3d transform={Transform.fromXyz(0, 2.4, 5.5).lookingAt([0, 0.4, 0])}>
|
|
{pt && <Pathtracer {...pt} />}
|
|
{solari && <SolariLighting {...solari} />}
|
|
</Camera3d>
|
|
<DirectionalLight illuminance={8000} transform={Transform.fromXyz(1, 6, 1).lookingAt([0, 0, 0])} />
|
|
<Mesh3d><Cuboid half_size={[4, 0.05, 4]} /><StandardMaterial base_color="#b0aaa0" /></Mesh3d>
|
|
<Mesh3d transform={Transform.fromXyz(-1.8, 1.2, -1.5)}><Cuboid half_size={[0.6, 0.6, 0.05]} /><StandardMaterial base_color="#000000" emissive={LinearRgba.from(Srgba.hex("#8ac4ff")).mul(4000)} /></Mesh3d>
|
|
{f < 1 && <Mesh3d transform={Transform.fromXyz(0.4, 1.6, 0.4)}><Cuboid half_size={[1.2, 0.05, 1.2]} /><StandardMaterial base_color="#202020" /></Mesh3d>}
|
|
<FogVolume name="air" position={[0, 1.5, 0]} scale={[8, 3, 8]} density={0.08} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
registerRoot(() => (
|
|
<>
|
|
{Object.entries(TRACED).map(([id, t]) => (
|
|
<Composition key={id} id={id} component={() => <Scene {...t} />} width={240} height={135} fps={30} durationInFrames={id === "solari" || id === "dynamic" ? 12 : 3} />
|
|
))}
|
|
</>
|
|
));
|