# 材質

材質決定物體的顏色。基礎顏色通常由配置的顏色或從紋理文件中採樣決定。除了顏色之外，材質還會給人以光線從表面反射的印象，以及當光線被其他物體遮擋時產生陰影的效果。

## 創建材質

材質被創建為資產，以便可以重複使用。在資產瀏覽器中，您可以點擊"新增/Add new"，然後選擇"材質/Material"來創建新材質。

<figure><img src="/files/GPaZD7NCCRmf2vQqgHz5" alt=""><figcaption></figcaption></figure>

### 命名材質

創建新的材質資產時，系統會提示您提供一個名稱。理想情況下，這個名稱應該以一種方式描述材質，使您以後可以為想要使用它的物體找到適當的材質。例如，如果材質應該代表木頭，而您知道將會有不同類型的木材材質，您可以將其命名為"木頭橡木"，這樣以後就可以輕鬆搜索到它。

### 材質類型

創建材質後，您可以選擇材質的類型。標準材質可能足以滿足大多數使用情況。

* **標準 -** 一種具有多種選項的材質，可以顯示顏色、紋理，並具有基於物理的渲染（PBR），能夠以高質量渲染光照。這將在內部創建渲染庫Three.js中的 [MeshStandardMaterial](https://threejs.org/docs/#api/en/materials/MeshStandardMaterial) 材質。點擊鏈接可閱讀更多關於其選項的信息。
* **Lambert -** 類似於標準材質，但使用更簡單的光照計算，可能會導致外觀較差，但使用較少的GPU資源。一些物體，特別是小物體和平面物體，使用Lambert材質可能看起來同樣好，在這種情況下，與標準材質相比，使用它可能會更加高效。這將在Three.js中創建 [MeshLambertMaterial ](https://threejs.org/docs/#api/en/materials/MeshLambertMaterial)in Three.js。
* **自定義著色器 -** 使用自定義著色器類型，您可以選擇自己創建的著色器。這對於創建各種特殊效果很有用。 閱讀更多關於創建著色器的信息，請參考[著色器介紹](/zh-tw/shaders/zhu-se-qi-jie-shao.md)&#x20;

### 複製材質

如果您想創建材質的變體，最簡單的方法可能是複製現有的材質，然後添加更改。通過右鍵點擊材質，您會得到一個菜單，其中可以點擊"複製/Duplicate"來創建資產的副本。

<figure><img src="/files/JOdfYINlFUx0r89YuTyw" alt=""><figcaption></figcaption></figure>

## 使用材質

材質可以添加到導入的3D模型、形狀、角色和天空球體中。


---

# Agent Instructions: 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:

```
GET https://docs.hology.app/zh-tw/assets/cai-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
