Material.pkg 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. $#include "Material.h"
  2. enum CullMode{};
  3. class Material : public Resource
  4. {
  5. Material();
  6. ~Material();
  7. void SetNumTechniques(unsigned num);
  8. void SetTechnique(unsigned index, Technique* tech, unsigned qualityLevel = 0, float lodDistance = 0.0f);
  9. void SetShaderParameter(const String name, const Variant& value);
  10. void SetTexture(TextureUnit unit, Texture* texture);
  11. void SetUVTransform(const Vector2& offset, float rotation, const Vector2& repeat);
  12. void SetUVTransform(const Vector2& offset, float rotation, float repeat);
  13. void SetCullMode(CullMode mode);
  14. void SetShadowCullMode(CullMode mode);
  15. void SetDepthBias(const BiasParameters& parameters);
  16. void RemoveShaderParameter(const String name);
  17. void ReleaseShaders();
  18. // SharedPtr<Material> Clone(const String cloneName = String::EMPTY) const;
  19. tolua_outside Material* MaterialClone @ Clone(const String cloneName = String::EMPTY) const;
  20. void SortTechniques();
  21. void MarkForAuxView(unsigned frameNumber);
  22. unsigned GetNumTechniques() const;
  23. Technique* GetTechnique(unsigned index) const;
  24. Pass* GetPass(unsigned index, StringHash passType) const;
  25. Pass* GetPass(unsigned index, const String passType) const;
  26. Texture* GetTexture(TextureUnit unit) const;
  27. CullMode GetCullMode() const;
  28. CullMode GetShadowCullMode() const;
  29. const BiasParameters& GetDepthBias() const;
  30. unsigned GetAuxViewFrameNumber() const;
  31. bool GetOcclusion() const;
  32. bool GetSpecular() const;
  33. tolua_readonly tolua_property__get_set CullMode cullMode;
  34. tolua_readonly tolua_property__get_set CullMode shadowCullMode;
  35. tolua_readonly tolua_property__get_set unsigned auxViewFrameNumber;
  36. tolua_readonly tolua_property__get_set bool occlusion;
  37. tolua_readonly tolua_property__get_set bool specular;
  38. };
  39. ${
  40. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Material_new00
  41. static int tolua_GraphicsLuaAPI_Material_new00(lua_State* tolua_S)
  42. {
  43. return ToluaNewObject<Material>(tolua_S);
  44. }
  45. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Material_new00_local
  46. static int tolua_GraphicsLuaAPI_Material_new00_local(lua_State* tolua_S)
  47. {
  48. return ToluaNewObjectGC<Material>(tolua_S);
  49. }
  50. static Material* MaterialClone(const Material* material, const String& cloneName = String::EMPTY)
  51. {
  52. if (!material)
  53. return 0;
  54. SharedPtr<Material> clonedMaterialPtr = material->Clone(cloneName);
  55. Material* clonedMaterial = clonedMaterialPtr.Get();
  56. clonedMaterialPtr.Detach();
  57. return clonedMaterial;
  58. }
  59. $}