Lighting
Volver a la referencia

Lighting

Directional, point, spot and ambient lights, and the two kinds of shadow the era affords.

24 símbolos

useAmbientLightfunctionhooknacatamalon

useAmbientLight(options: { color, intensity, ground }) => TAmbientLight

The level everything is lit to before any lamp reaches it.

It has no place and no direction, so it shades nothing: it only decides how dark the dark side is. A scene with one of these and nothing else is lit flat, which is a look and not a mistake.

One level for the whole scene: whichever object asks for it, it does not move with it. A scene that asks for more than one keeps the last made, and says so: a cave can set its own on the way in.

In a view (createSpriteTexture with sees: 'world') it sets the level in all the view shows, and the scene's lamps still light it unless the view brings lamps of its own: a minimap at intensity: 1 reads in full while the game around it is dark. In a picture that sees '3d', it sets the level of the room it shows.

With a ground it is two colours: color comes down from above and ground up from below, and a surface takes them by which way it faces, the light of a photographer's studio (a bright sky over a warm floor). A model lit only at its corners shares it out at its corners, as it does its other light.

Parámetros

options{ color, intensity, ground }

Its colour, how strong it is, and the colour from below.

Ejemplo

const Level = () => {
    useCamera3d({ projection: 'perspective', transform: { z: 5 } });
    useAmbientLight({ intensity: 1.2 });
    // Or two colours, a sky above and a floor below:
    // useAmbientLight({ color: '#dce6ff', ground: '#4a3328', intensity: 0.5 });
    createMesh({ geometry: useSphereGeometry() });

    return createScene();
};
Ver el código · hooks/light/use_ambient_light.ts:47

useAmbientLight2dfunctionhooknacatamalon

useAmbientLight2d(options: { color, intensity }) => TAmbientLight2d

How bright a 2D world is where no lamp reaches, and in what colour, apart from any 3D light. White at 0.2 by default. A scene says it once: with more than one, the last is the one used, and that is said once.

Parámetros

options{ color, intensity }
Ver el código · hooks/light/use_light_2d.ts:90

useBlobShadowfunctionhooknacatamalon

useBlobShadow(options: TBlobShadowOptions) => TMesh

Puts a soft dark disc on the ground under something and keeps it there.

This is the cheap shadow, the one the consoles this engine is aimed at actually used: not a shadow of the shape, a smudge under it. A game can afford fifty on hardware that could not afford one real one, because it is not a feature of the renderer at all. It is a disc wearing a shader that fades from the middle, drawn down the ordinary path with everything else: no extra pass, no texture, nothing reserved.

It takes nothing from the lamps in the scene, on purpose. A shadow that took the light would brighten as a lamp moved towards it, which is the opposite of what a shadow does.

It does not cast a real shadow of its own either, which matters the moment a scene has a light that casts one: a flat disc lying on the floor would otherwise be drawn into the shadow map and come back as a shadow of a shadow, a dark ring that nothing in the scene explains.

Call it in the scene body, next to the thing it goes under, and then forget it: it follows on its own. It reads that thing's own placement, so the two belong together (either both loose in the scene, or both inside the same group), which is what writing them next to each other already gives you.

Parámetros

optionsTBlobShadowOptions

What it goes under, and how it looks.

Ejemplo

const Level = () => {
    useCamera3d({ projection: 'perspective', transform: { y: 3, z: 6, rotationX: -0.5 } });
    createMesh({ geometry: usePlaneGeometry({ width: 12, depth: 12 }) });

    const hero = createMesh({ geometry: useCubeGeometry(), transform: { y: 0.5 } });
    useBlobShadow({ target: hero, radius: 0.75, followHeight: true });

    return createScene();
};
Ver el código · hooks/light/use_blob_shadow.ts:120

useDirectionalLightfunctionhooknacatamalon

useDirectionalLight(options: TLightOptionsBase & { shadowArea, shadowDistance }) => TDirectionalLight

A light from far away, like the sun.

It has a direction and no place: everything is lit by it the same, however far away it is. This is the one a scene should start with, because it is the one that shows the shape of things.

It shines along its own facing, so it is aimed by turning it, the way a camera is.

The light belongs to this object, so putting it inside something that moves means it moves with it: a lamp carried by a character, headlights on a car. An object gives off as many as it asks for, each placed by its own transform: a car's two headlights are two calls in the car, and the lamps of a room two calls in the scene. An object of its own (useSpawn) is for a lamp that is a thing of its own, one that breaks, swings or is switched off by itself.

A scene holds thirty-two at a time, and each model is lit by the eight of them that reach it most, so a corridor of torches is lit all along. Past thirty-two they are dropped in the order they were made, with a warning.

Parámetros

optionsTLightOptionsBase & { shadowArea, shadowDistance }

Its colour, how strong it is, and where it points.

Ejemplo

const Level = () => {
    useCamera3d({ projection: 'perspective', transform: { z: 5 } });
    useDirectionalLight({ intensity: 1.2 });
    createMesh({ geometry: useSphereGeometry() });

    return createScene();
};
Ver el código · hooks/light/use_directional_light.ts:43

useLight2dfunctionhooknacatamalon

useLight2d(options: TLight2dOptions) => TLight2d

A lamp for a 2D world: it lights the sprites, texts, nine-slices, maps and particles around it, with no normal map. It goes where the box holding it goes, so one made in the player's component is a lantern the player carries.

A world with lamps starts dark, and useAmbientLight2d says how dark; once lit, it stays lit until its scene ends, even with every lamp gone. A world can have as many lamps as it likes: what the camera shows is lit by the eight nearest its middle that reach it, so a long level can have a torch every few steps. The HUD (useScreenSpace) and what is left out with useUnlit2d are never lit. It casts no shadow. Change what it gives back to move it, recolour it or dim it, from the next frame.

Parámetros

Ejemplo

useAmbientLight2d({ intensity: 0.15 });
useLight2d({ transform: { x: 160, y: 90 }, radius: 100, color: '#ffbb66' });
Ver el código · hooks/light/use_light_2d.ts:62

usePointLightfunctionhooknacatamalon

usePointLight(options: TLightOptionsBase & { range }) => TPointLight

A lamp: it has a place, shines every way, and fades out with distance.

range is how far it reaches; past that it lights nothing. A torch on a wall, a fire, a bulb.

The light belongs to this object, so putting it inside something that moves means it moves with it: a lamp carried by a character, headlights on a car. An object gives off as many as it asks for, each placed by its own transform: a car's two headlights are two calls in the car, and the lamps of a room two calls in the scene. An object of its own (useSpawn) is for a lamp that is a thing of its own, one that breaks, swings or is switched off by itself.

A scene holds thirty-two at a time, and each model is lit by the eight of them that reach it most, so a corridor of torches is lit all along. Past thirty-two they are dropped in the order they were made, with a warning.

Parámetros

optionsTLightOptionsBase & { range }

Its colour, how strong it is, and where it points.

Ejemplo

const Level = () => {
    useCamera3d({ projection: 'perspective', transform: { z: 5 } });
    usePointLight({ intensity: 1.2 });
    createMesh({ geometry: useSphereGeometry() });

    return createScene();
};
Ver el código · hooks/light/use_point_light.ts:41

useRectLightfunctionhooknacatamalon

useRectLight(options: TLightOptionsBase & { range, width, height }) => TRectLight

A panel: a lamp shaped like a rectangle, which shines from its front only.

width and height are its size along its own X and Y, and range is how far it reaches from the nearest point of the panel. It faces down unless turned, like a light in the ceiling, and is aimed by turning it like a torch. A strip light, a window, a screen, a sign.

It does not cast shadows: a panel has no single point to look from.

The light belongs to this object, so putting it inside something that moves means it moves with it: a lamp carried by a character, headlights on a car. An object gives off as many as it asks for, each placed by its own transform: a car's two headlights are two calls in the car, and the lamps of a room two calls in the scene. An object of its own (useSpawn) is for a lamp that is a thing of its own, one that breaks, swings or is switched off by itself.

It is one of the thirty-two a scene holds, and one of the eight that light a model when it reaches it.

Parámetros

optionsTLightOptionsBase & { range, width, height }

Its colour, how strong it is, its size, and where it points.

Ejemplo

const Room = () => {
    useCamera3d({ projection: 'perspective', transform: { y: 2, z: 6 } });
    useRectLight({ width: 3, height: 0.4, range: 6, transform: { y: 3 } });
    createMesh({ geometry: usePlaneGeometry({ width: 10, depth: 10, widthSegments: 20, depthSegments: 20 }) });

    return createScene();
};
Ver el código · hooks/light/use_rect_light.ts:43

useSpotLightfunctionhooknacatamalon

useSpotLight(options: TLightOptionsBase & { range, angle, penumbra }) => TSpotLight

A torch: a lamp that only shines inside a cone.

angle is half the width of the cone and penumbra is how soft its edge is, from a hard rim at 0 to a beam that fades all the way in at 1. Like a sun it is aimed by turning it.

The light belongs to this object, so putting it inside something that moves means it moves with it: a lamp carried by a character, headlights on a car. An object gives off as many as it asks for, each placed by its own transform: a car's two headlights are two calls in the car, and the lamps of a room two calls in the scene. An object of its own (useSpawn) is for a lamp that is a thing of its own, one that breaks, swings or is switched off by itself.

A scene holds thirty-two at a time, and each model is lit by the eight of them that reach it most, so a corridor of torches is lit all along. Past thirty-two they are dropped in the order they were made, with a warning.

Parámetros

optionsTLightOptionsBase & { range, angle, penumbra }

Its colour, how strong it is, and where it points.

Ejemplo

const Level = () => {
    useCamera3d({ projection: 'perspective', transform: { z: 5 } });
    useSpotLight({ intensity: 1.2 });
    createMesh({ geometry: useSphereGeometry() });

    return createScene();
};
Ver el código · hooks/light/use_spot_light.ts:41

useStudiofunctionhooknacatamalon

useStudio(options: TStudioOptions) => TStudio

Lights the scene like a photographer's studio in one line, the lighting of the glossy product shots and toys of the era's computer graphics: a warm key light up to the right that casts the shadows, a cool panel filling from the left, a panel behind that draws a bright rim, and the light from all around in two colours, a sky above and a floor below. It also paints the studio as the round picture a reflection reads, the same sky, floor and softboxes, so a model reflects a studio like the one lighting it. The picture is what is behind the camera, so it turns with the camera while the lamps stay where they are: the softboxes a model reflects are not the lamps themselves.

Every piece comes back, to change like any other light: studio.key.intensity = 1.6. The lamps stand round the middle of the scene, at distance; they belong to the box the hook is called in, and move with it.

Parámetros

optionsTStudioOptions

The sky, the floor, the softboxes, how far the lamps stand and whether the key casts.

Ejemplo

const Showroom = () => {
    useCamera3d({ projection: 'perspective', fov: 40, transform: { y: 1.2, z: 6 } });
    useRenderStyle(RENDER.STYLES.cgi);
    const studio = useStudio({ ground: '#3a2a22' });

    createMesh({ geometry: useSphereGeometry(), material: createMaterial(chrome({ environment: studio.environment })) });
    studio.fill.intensity = 0.4;

    return createScene();
};
Ver el código · hooks/light/use_studio.ts:121

useUnlit2dfunctionhooknacatamalon

useUnlit2d(on: boolean) => void

Leaves what is created here out of the scene's 2D lights: it keeps its own colours however dark the world is, and still moves with the camera, unlike the HUD. For what gives off its own light: a fire, a neon sign, the glass of a lamp, the eyes of something in the dark, the sparks of a torch (particles are lit like the rest, so dust in a cave stays dark).

It covers everything this part of the scene creates and everything created under it, however deep. In a scene with no 2D lights it changes nothing. Each lit scene that has something left out draws it through one view more, of the fifteen a frame has for scenes; with none left, it is drawn lit, with the rest of the scene. Set it with this hook, not by writing the box's unlit2d: the hook is what tells the scene to keep a view for it.

Parámetros

onboolean

false undoes it. Default true.

Ejemplo

const Torch = () => {
    useLight2d({ radius: 90, color: '#ff9c3a' });
    useSpawn(() => {
        useUnlit2d();
        createSprite({ width: 6, height: 6, tint: '#ffcf6b' });
    })();
};
Ver el código · hooks/light/use_unlit_2d.ts:35

TAmbientLighttypenacatamalon

Light with no source: the level everything is lit to before any lamp reaches it.

It has no place and no direction, so it never shades anything: it only decides how dark the dark side is. A scene with one of these and nothing else is flat, which is a look and not a mistake.

Propiedades

type'ambient'
idstring
colorTColor

Its colour, which is the colour that comes down from above when it has a ground.

intensitynumber
groundopcionalTColor | null

The colour that comes up from below, for a light from all around in two colours: a bright sky above and a warm floor below, as in a photographer's studio. A surface facing up takes color, one facing down takes this, and one facing sideways half of each, at the same intensity. null or left out, it is one colour everywhere. It can change while the game runs.

Ver el código · light/types/t_light.ts:125

TAmbientLight2dtypenacatamalon

How bright a scene's 2D world is where no lamp reaches, as useAmbientLight2d makes it. With more than one, the last is the one used. A world with lamps and none of these is black where they do not reach; one with neither keeps its own colours, until it has had one: then it stays lit until its scene ends. The HUD (useScreenSpace) and what is left out (useUnlit2d) are never lit, and the scene's 3D ambient light has nothing to do with it.

Propiedades

type'ambient-2d'
idstring
colorTColor
intensitynumber
Ver el código · light/types/t_light.ts:184

TBlobShadowOptionstypenacatamalon

What useBlobShadow can be asked for. Only the thing it goes under is needed.

Propiedades

targetTMesh

What it goes under. Every frame it moves to wherever that is.

groundYopcionalnumber

The height of the ground it lies on. Default 0.

radiusopcionalnumber

How wide it is, in the same units as everything else in the scene. Default 0.5.

coloropcionalTColorOption

What colour it is. Default black: a shadow is darkness, faded by opacity and not tinted.

opacityopcionalnumber

How dark it is in the middle, 0 to 1. Default 0.5.

softnessopcionalnumber

How soft the rim is, from a cut edge at 0 to a fade that starts at the centre at 1. Default 0.4.

followHeightopcionalboolean

Whether it grows and fades as the thing above it rises. Default false, which is a shadow of a fixed size.

It is the oldest way of telling a player that a character has left the ground, and it works because the two readings of a sprite going up (jumping, or walking away from the camera) are told apart by what happens underneath.

zIndexopcionalnumber

Draw order within the scene. Default 0.

Ver el código · hooks/light/use_blob_shadow.ts:39

TDirectionalLighttypenacatamalon

TDirectionalLight: TLightBase & { type, shadowArea, shadowDistance }

A light from far away, like the sun: it has a direction and no position, and it reaches everything with the same strength.

Propiedades

type'directional'
shadowAreaopcionalnumber

How far, in world units, the shadows reach. Default 12.

The square the shadow map covers is this wide, and it follows the camera: it starts at the camera and reaches this far in front of it, so what you are looking at is what has shadows. Smaller is crisper over less ground, because the map is always the same number of steps across however much world it is spread over.

It has to be big enough to reach your scene. A camera five hundred units back from what it is watching wants about a thousand here; leave it at the default and every shadow is simply missing, with nothing said, because a scene where nothing stands in the light's way looks exactly the same from the inside.

Only a directional light has this. A spot's frustum comes from its own angle and range, so giving it a square as well would be two ways to say one thing.

shadowDistanceopcionalnumber

How far back along its own beam it sits when it looks at the scene. Default 20.

idstring
colorTColor
intensitynumber
ambientnumber
transformTTransform3d

Where it is and which way it faces. Lights shine along their own -Z.

castShadowopcionalboolean

Whether this is the light that casts shadows. Default false.

One light casts, and it is the first one that asks. That is not a budget picked at random: a shadow map is a whole extra pass over everything that casts, and the hardware this engine is aimed at had one of them. A second light asking is warned about rather than ignored, because being quietly overruled is the sort of thing you lose an afternoon to.

shadowBiasopcionalnumber

How far the shadow test is pushed away from the surface, towards the light, in the world's units, so a surface does not shadow itself. Default 0.002.

The same distance for a sun and a torch, near the light or far from it. Too little and a lit surface stripes itself. Too much and the shadow detaches from whatever cast it, which reads as the thing hovering, and what stands that close behind a thin wall is lit through it.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1. Lower leaves the caster's light partly on.

Ver el código · light/types/t_light.ts:56

TLight2dtypenacatamalon

A lamp of a 2D world, as useLight2d makes it: a circle of light over the sprites, texts, maps and particles around it, with no normal map. It goes where its box goes, and its box's scale does not change how far it reaches. What a camera shows is lit by the eight nearest its middle.

radius is in pixels of the world. falloff is how it fades towards the edge: 1 evenly, 2 dimmer sooner, 0 not at all, a circle with a hard edge.

Propiedades

type'point-2d'
idstring
colorTColor
intensitynumber
transformTTransform3d
radiusnumber
falloffnumber
Ver el código · light/types/t_light.ts:163

TLight2dOptionstypenacatamalon

What a 2D lamp is: its colour, how strong, where, how far it reaches and how it fades.

Propiedades

coloropcionalTColorOption

The colour of its light, white by default.

intensityopcionalnumber

How strong it is. 1 by default; 0 switches it off.

transformopcional{ x, y }

Where it is from the box holding it, in pixels.

radiusopcionalnumber

How far it reaches, in pixels of the world. 128 by default; 0 or less lights nothing.

falloffopcionalnumber

How it fades towards the edge: 1 evenly, 2 dimmer sooner, 0 not at all, a circle with a hard edge. 1 by default.

Ver el código · hooks/light/use_light_2d.ts:17

TLightBasetypenacatamalon

What every light has: a colour, how strong it is, and how much of it reaches the parts it does not shine on directly.

ambient is that last one: light bounces off everything in a real room, so a surface facing away from the lamp is dim and not black. Without it a scene looks like it is in space.

Propiedades

idstring
colorTColor
intensitynumber
ambientnumber
transformTTransform3d

Where it is and which way it faces. Lights shine along their own -Z.

castShadowopcionalboolean

Whether this is the light that casts shadows. Default false.

One light casts, and it is the first one that asks. That is not a budget picked at random: a shadow map is a whole extra pass over everything that casts, and the hardware this engine is aimed at had one of them. A second light asking is warned about rather than ignored, because being quietly overruled is the sort of thing you lose an afternoon to.

shadowBiasopcionalnumber

How far the shadow test is pushed away from the surface, towards the light, in the world's units, so a surface does not shadow itself. Default 0.002.

The same distance for a sun and a torch, near the light or far from it. Too little and a lit surface stripes itself. Too much and the shadow detaches from whatever cast it, which reads as the thing hovering, and what stands that close behind a thin wall is lit through it.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1. Lower leaves the caster's light partly on.

Ver el código · light/types/t_light.ts:15

TLightOptionsBasetypenacatamalon

Options every light with a place in the world shares.

Propiedades

coloropcionalTColorOption
intensityopcionalnumber

How strong it is. Default 1.

ambientopcionalnumber

How much of it reaches what it does not shine on. Default 0.35.

transformopcionalPartial<Pick<TTransform3d, 'x' | 'y' | 'z' | 'rotationX' | 'rotationY'>>

Where it is and which way it faces, as it is read afterwards (light.transform): x, y, z, and rotationX and rotationY in radians. A light shines along its own -Z. Left out, it is where its object is.

castShadowopcionalboolean

Whether this is the one light that casts shadows. Default false. See TLight.

shadowBiasopcionalnumber

How far the shadow test is pushed off the surface, towards the light, in the world's units. Default 0.002.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1.

Ver el código · light/create_light.ts:13

TPointLighttypenacatamalon

TPointLight: TLightBase & { type, range }

A lamp: it has a place, shines every way, and fades out by range.

Propiedades

type'point'
rangenumber
idstring
colorTColor
intensitynumber
ambientnumber
transformTTransform3d

Where it is and which way it faces. Lights shine along their own -Z.

castShadowopcionalboolean

Whether this is the light that casts shadows. Default false.

One light casts, and it is the first one that asks. That is not a budget picked at random: a shadow map is a whole extra pass over everything that casts, and the hardware this engine is aimed at had one of them. A second light asking is warned about rather than ignored, because being quietly overruled is the sort of thing you lose an afternoon to.

shadowBiasopcionalnumber

How far the shadow test is pushed away from the surface, towards the light, in the world's units, so a surface does not shadow itself. Default 0.002.

The same distance for a sun and a torch, near the light or far from it. Too little and a lit surface stripes itself. Too much and the shadow detaches from whatever cast it, which reads as the thing hovering, and what stands that close behind a thin wall is lit through it.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1. Lower leaves the caster's light partly on.

Ver el código · light/types/t_light.ts:88

TRectLighttypenacatamalon

TRectLight: TLightBase & { type, range, width, height }

A panel: a lamp shaped like a rectangle, which shines from its front only.

width and height are its size, along its own X and Y. It shines along its own -Z, like a sun and a torch, and fades out by range, measured from the nearest point of the panel. A ceiling light, a window, a screen, a sign.

Propiedades

type'rect'
rangenumber
widthnumber
heightnumber
idstring
colorTColor
intensitynumber
ambientnumber
transformTTransform3d

Where it is and which way it faces. Lights shine along their own -Z.

castShadowopcionalboolean

Whether this is the light that casts shadows. Default false.

One light casts, and it is the first one that asks. That is not a budget picked at random: a shadow map is a whole extra pass over everything that casts, and the hardware this engine is aimed at had one of them. A second light asking is warned about rather than ignored, because being quietly overruled is the sort of thing you lose an afternoon to.

shadowBiasopcionalnumber

How far the shadow test is pushed away from the surface, towards the light, in the world's units, so a surface does not shadow itself. Default 0.002.

The same distance for a sun and a torch, near the light or far from it. Too little and a lit surface stripes itself. Too much and the shadow detaches from whatever cast it, which reads as the thing hovering, and what stands that close behind a thin wall is lit through it.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1. Lower leaves the caster's light partly on.

Ver el código · light/types/t_light.ts:113

TSpotLighttypenacatamalon

TSpotLight: TLightBase & { type, range, angle, penumbra }

A torch: a lamp that only shines inside a cone.

angle is half the width of that cone and penumbra is how soft its edge is, from a hard rim at 0 to a beam that fades all the way to the middle at 1.

Propiedades

type'spot'
rangenumber
anglenumber
penumbranumber
idstring
colorTColor
intensitynumber
ambientnumber
transformTTransform3d

Where it is and which way it faces. Lights shine along their own -Z.

castShadowopcionalboolean

Whether this is the light that casts shadows. Default false.

One light casts, and it is the first one that asks. That is not a budget picked at random: a shadow map is a whole extra pass over everything that casts, and the hardware this engine is aimed at had one of them. A second light asking is warned about rather than ignored, because being quietly overruled is the sort of thing you lose an afternoon to.

shadowBiasopcionalnumber

How far the shadow test is pushed away from the surface, towards the light, in the world's units, so a surface does not shadow itself. Default 0.002.

The same distance for a sun and a torch, near the light or far from it. Too little and a lit surface stripes itself. Too much and the shadow detaches from whatever cast it, which reads as the thing hovering, and what stands that close behind a thin wall is lit through it.

shadowStrengthopcionalnumber

How dark it goes, 0 to 1. Default 1. Lower leaves the caster's light partly on.

Ver el código · light/types/t_light.ts:100

TStudiotypenacatamalon

The lights of a studio, each one to read and to change, and the picture of it a reflection reads.

Propiedades

ambientTAmbientLight

The light from all around, in two colours: the sky above and the floor below.

keyTDirectionalLight

The key light: warm, up to the right, the brightest, and the one that casts. Its shadowBias is bigger than a light's usual, to suit the few-faced, smoothly lit models of a product shot.

fillTRectLight

The fill light: a cool panel to the left, so the side the key misses is not black.

backTRectLight

The back light: a panel behind and above, which draws a bright rim round what it lights.

environmentTTexture

The studio as a round picture, for a material's reflection or the recipes' environment.

Ver el código · hooks/light/use_studio.ts:62

TStudioOptionstypenacatamalon

What useStudio is asked for. Everything has a default.

Propiedades

topopcionalTColorOption

The colour of the sky, which comes down from above in the light from all around and fills the top of the reflection. Default '#dce6ff'.

groundopcionalTColorOption

The colour of the floor, which comes up from below and fills the bottom of the reflection. Default '#4a3328'.

panelsopcionalnumber

How many softboxes the reflection shows, from 0 to 4 (see studioEnvironment). Default 2.

environmentopcionalTTexture

The surroundings to reflect, in place of the painted studio: a round picture of your own, a matcap, or a panorama or photo made round with sphereFromPanorama. Left out, the studio is painted (see studioEnvironment), and panels and size say how.

sizeopcionalnumber

How many pixels across the painted studio is (see studioEnvironment). Default 64, the era's chrome at a console's resolution; 256 for a smooth one in a game drawn at a render's.

distanceopcionalnumber

How far from the middle of the scene the lamps stand, in the world's units: as big as what is being shown, or a little bigger. Default 5.

castShadowopcionalboolean

Whether the key light casts the scene's shadows. Default true.

Ver el código · hooks/light/use_studio.ts:18