Placeholder Image

字幕列表 影片播放

  • The Mesh Renderer.

    本章介紹網格著色器

  • To render a mesh we need 2 components.

    要對網格上色需要兩個元件

  • The Mesh Filter

    網格過濾器(Mesh Filter) 和網格著色器(Mesh Renderer)

  • and the Mesh Renderer.

    當你匯入模型時 Unity會自動建立一個預製物件

  • When importing a mesh model

    並產生網格過濾器元件 用來存放模型的網格資料

  • Unity will automatically create a

    以及網格著色器元件 用來著色場景的模型

  • prefab asset that includes a mesh filter

    網格著色器不會對設定為皮膚的網格上色

  • component to hold the mesh data for the model

    皮膚網格主要用在有骨架與動作的角色上 每根骨架都會影響著部份網格

  • and a mesh renderer component

    如果模型披了一層皮,Unity會自動 建立一個皮膚網格著色器取代原著色器

  • to render this mesh data in our scene.

    皮膚網格著色器(Skinned mesh renderer)的介紹 可以參考其他章節

  • The mesh renderer does not

    每個網格資源都有它自己的過濾器和著色器

  • render skinned meshes.

    如果模型由數個網格組成,那預製物件裡 所有網格物件都會有過濾器和著色器成對

  • Skinned meshes are used for rendering characters.

    網格過濾器保存模型的網格資料 並傳給網格著色器來著色在畫面上

  • Characters are animated using bones

    網格過濾器只有一個參照網格資料的屬性

  • and every bone effects part of the mesh.

    著色器從過濾器取得資料後

  • If the model is skinned,

    依照Transform的屬性像是座標、旋轉 和縮放並把網格畫在場景上

  • Unity will create a skinned mesh renderer

    網格著色器有幾項屬性 用來定義模型在場景裡的著色方式

  • for the imported model instead.

    基本可分為三大類 陰影、材質和光源探測

  • Information on skinned mesh renderers

    有了陰影,如果有一盞燈打在物體上 我們可設定網格著色器是否要投射或接收陰影

  • can be found in another lesson.

    接下來是用來著色物件的材質列表

  • Each mesh asset needs it's own mesh filter

    在Unity裡,網格著色器最少要指定 一個材質才能對場景裡的物件著色

  • and mesh renderer.

    更多關於材質的介紹,可參考相關章節

  • If the model is made of several

    如果模型在建模軟體已經指定了複數材質 那輸入到Unity也會使用複數材質

  • separate meshes each will have it's own

    材質在網格著色器裡就叫材質(Materials) 管理模型使用的所有材質

  • prefab game object with it's own

    正常情況下,這個列表只會包含一種材質

  • mesh filter - mesh renderer pair.

    材質列表裡每個子項都會對應材質格

  • The mesh filter holds the mesh data of the model

    如果沒有任何格子指定材質 那麼模型就會變成粉紅色塊

  • and passes it to the mesh renderer

    提醒你材質遺失了

  • for rendering on screen.

    最後是光源探測

  • The mesh filter component

    網格可以被光源探測照亮

  • has only one property and this is

    光源探測會對場景裡的點取樣光源 然後投射回已著色的網格物件

  • a reference to the mesh asset itself.

    通常會和光照貼圖(Light mapping)一起使用

  • The mesh renderer takes the mesh model

    光源探測針對動態物件打光,尤其像 角色這種無法用光照貼圖呈現光源的物件

  • data from the mesh filter and renders

    要使用光源探測 Use Light Probes這個選項必須啟用

  • it in our scene at the position,

    更多關於光源探測的功能

  • rotation and scale defined by

    包含錨點複寫(Anchor Override)屬性

  • the object's transform component.

    請參閱其他章節或官網的官方文件

  • The mesh renderer has properties that

  • define how the model will be rendered

  • or drawn in our scene.

  • These fall in to 3 broad categories.

  • Shadows, materials and light probes.

  • With shadows, if there is a shadow

  • casting light on the object we can

  • set whether the mesh renderer will

  • cast and or receive shadows.

  • Next there is a list of materials

  • to render the object with.

  • Unity needs at least one material assigned

  • to the mesh renderer to be able to draw

  • that object in our scene.

  • For more information on materials themselves

  • see the appropriate lesson.

  • Meshes imported in to Unity can

  • use multiple materials, if the mesh

  • model has been setup to do so

  • in the original modelling application.

  • The mesh renderer maintains a list

  • simply called Materials for all materials

  • used by the mesh model.

  • Often this list only contains one material.

  • This materials list should have one slot

  • in the list for each sub mesh

  • on the mesh model.

  • If any given slot has no material assigned

  • the associated mesh will show pink

  • indicating that the material is missing.

  • Lastly, there are light probes.

  • A mesh can be lit by light probes.

  • Light probes sample the lighting of a scene

  • at a point and cast that light on

  • on to the rendered mesh.

  • This is often used in conjunction

  • with light mapping.

  • Light probes light dynamic objects

  • such as characters that would not receive

  • baked lighting information from a light map.

  • To use light probes,

  • the Use Light Probes option must be enabled.

  • For more information on light probes,

  • including the Anchor Override property,

  • please see the appropriate lesson

  • and documentation link below.

The Mesh Renderer.

本章介紹網格著色器

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋