> For the complete documentation index, see [llms.txt](https://docs.hology.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hology.app/zh-tw/shaders/typescript-shaders/lighting.md).

# Lighting

Lighting is an important and non trivial part of creating shaders.

### Built in

The library comes with some built in implementations of materials.

#### Lambert

The Lambert material implementation is highly efficient as it only calculated the light at each vertex. It can take a diffuse color and returns an RgbaNode.

```ts
import { lambertMaterial, RgbaNode, rgb } from "@hology/core/shader-nodes"

const color: RgbaNode = lambertMaterial(rgb(0x00ff00))
```

#### Standard

The standard material is based on a physically based rendering approach and looks just like [THREE.MeshStandardMaterial](https://threejs.org/docs/#api/en/materials/MeshStandardMaterial) except it that it does not have features like metalness or refraction.

```ts
import { standardMaterial, RgbaNode, rgb } from "@hology/core/shader-nodes"

const color: RgbaNode = standardMaterial({ 
    color: rgb(0x00ff00), 
    emissive: rgb(0x9f7070), 
    emissiveIntensity: float(0),
    roughness: float(1)
})
```

### Creating your own

Light and shadow information is passed in by ThreeJS based on what exists in the scene and you can access them with uniforms. Check out the / for what predefined uniforms exist and for how to create new ones if some you need are missing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hology.app/zh-tw/shaders/typescript-shaders/lighting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
