meta4d-me / CatDogEngine

A cross-platform game engine/editor written in modern C++ (WIP)
GNU General Public License v2.0
160 stars 17 forks source link

[Component] Refact material component #333

Open T-rvw opened 1 year ago

T-rvw commented 1 year ago
  1. Present different instanced data from material type.
  2. No need to write something like SkyType inside MaterialComponent, it is a generic class.
roeas commented 1 year ago

If the material determines the way the model is lighted by the environment (IBL/ATM) and the uber shader used, does it make sense to write SkyType here?

T-rvw commented 1 year ago

If the material determines the way the model is lighted by the environment (IBL/ATM) and the uber shader used, does it make sense to write SkyType here?

Not every material needs to be lighted by environment. And some materials even don't need lighting. For example, we often use an unlit material for ingame UI.

image

https://dev.epicgames.com/community/learning/tutorials/6GjP/unreal-engine-ui-useful-materials