Skip to content

Commit e5046d8

Browse files
committed
Update getting-started.en.md
1 parent 261df5a commit e5046d8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

manual/content/getting-started.en.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ pipeline.add(
5959

6060
function onResize(): void {
6161

62-
const width = container.clientWidth, height = container.clientHeight;
62+
const width = container.clientWidth;
63+
const height = container.clientHeight;
6364
camera.aspect = width / height;
6465
camera.updateProjectionMatrix();
6566
pipeline.setSize(width, height);
@@ -69,20 +70,22 @@ function onResize(): void {
6970
window.addEventListener("resize", onResize);
7071
onResize();
7172

72-
renderer.setAnimationLoop((timestamp: number) => pipeline.render(timestamp));
73+
renderer.setAnimationLoop((timestamp) => pipeline.render(timestamp));
7374
```
7475

7576
## Color Space Considerations
7677

77-
New applications should follow a [linear workflow](https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html) for color management and postprocessing supports this automatically. Simply set `WebGLRenderer.outputColorSpace` to `SRGBColorSpace` and postprocessing will follow suit. Built-in passes automatically convert colors when they render to screen and internal render operations are always performed in the correct color space.
78+
New applications should follow a [linear workflow](https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html) for color management and postprocessing supports this automatically. In most cases, `WebGLRenderer.outputColorSpace` can be left at default and postprocessing will follow suit. Built-in passes automatically convert colors when they render to screen and internal render operations are always performed in the correct color space.
7879

79-
Postprocessing uses `UnsignedByteType` sRGB frame buffers to store intermediate results due to good hardware support and resource efficiency. This is a compromise because linear results normally require at least 12 bits per color channel to prevent [color degradation and banding](https://blog.demofox.org/2018/03/10/dont-convert-srgb-u8-to-linear-u8/). With low precision sRGB buffers, colors will be clamped to [0.0, 1.0] and information loss will shift to the darker spectrum which leads to noticable banding in dark scenes. Linear, high precision `HalfFloatType` buffers don't have these issues and are the preferred option for HDR-like workflows on desktop devices. You can enable high precision frame buffers like so:
80+
Postprocessing uses `HalfFloatType` frame buffers by default to store intermediate results with minimal information loss. Linear colors normally require at least 12 bits per color channel to prevent [color degradation and banding](https://blog.demofox.org/2018/03/10/dont-convert-srgb-u8-to-linear-u8/). The default buffer type supports HDR-like workflows with correct tone mapping.
81+
82+
If hardware support and resource efficiency is a concern, postprocessing can be configured to use `UnsignedByteType` sRGB frame buffers as shown below. With low precision sRGB buffers, colors will be clamped to [0.0, 1.0] and information loss will shift to the darker spectrum which still leads to noticable banding in dark scenes. Linear, high precision `HalfFloatType` buffers don't have these issues and are generally the preferred option.
8083

8184
```ts
82-
import { HalfFloatType } from "three";
85+
import { UnsignedByteType } from "three";
8386

8487
const geoPass = new GeometryPass(scene, camera, {
85-
frameBufferType: HalfFloatType
88+
frameBufferType: UnsignedByteType // enables low precision buffers
8689
});
8790
```
8891

0 commit comments

Comments
 (0)