init.lua 1.3 KB

123456789101112131415161718192021222324252627
  1. return {
  2. summary = 'A set of properties and textures that define the properties of a surface.',
  3. description = [[
  4. Materials are a set of properties and textures that define the properties of a surface, like
  5. what color it is, how bumpy or shiny it is, etc. `Shader` code can use the data from a material
  6. to compute lighting.
  7. Materials are immutable, and can't be changed after they are created. Instead, a new Material
  8. should be created with the updated properties.
  9. `Pass:setMaterial` changes the active material, causing it to affect rendering until the active
  10. material is changed again.
  11. Using material objects is optional. `Pass:setMaterial` can take a `Texture`, and
  12. `Pass:setColor` can change the color of objects, so basic tinting and texturing of surfaces does
  13. not require a full material to be created. Also, a custom material system could be developed by
  14. sending textures and other data to shaders manually.
  15. `Model` objects will create materials for all of the materials defined in the model file.
  16. In shader code, non-texture material properties can be accessed as `Material.<property>`, and
  17. material textures can be accessed as `<Type>Texture`, e.g. `RoughnessTexture`.
  18. ]],
  19. constructors = {
  20. 'lovr.graphics.newMaterial'
  21. }
  22. }