Renderer.pkg 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. $#include "Renderer.h"
  2. static const int SHADOW_MIN_PIXELS;
  3. static const int INSTANCING_BUFFER_DEFAULT_SIZE;
  4. enum LightVSVariation
  5. {
  6. LVS_DIR = 0,
  7. LVS_SPOT,
  8. LVS_POINT,
  9. LVS_SPEC,
  10. LVS_SPOTSPEC,
  11. LVS_POINTSPEC,
  12. LVS_SHADOW,
  13. LVS_SPOTSHADOW,
  14. LVS_POINTSHADOW,
  15. LVS_DIRSPECSHADOW,
  16. LVS_SPOTSPECSHADOW,
  17. LVS_POINTSPECSHADOW,
  18. MAX_LIGHT_VS_VARIATIONS
  19. };
  20. enum VertexLightVSVariation
  21. {
  22. VLVS_NOLIGHTS = 0,
  23. VLVS_1LIGHT,
  24. VLVS_2LIGHTS,
  25. VLVS_3LIGHTS,
  26. VLVS_4LIGHTS,
  27. MAX_VERTEXLIGHT_VS_VARIATIONS
  28. };
  29. enum LightPSVariation
  30. {
  31. LPS_NONE = 0,
  32. LPS_SPOT,
  33. LPS_POINT,
  34. LPS_POINTMASK,
  35. LPS_SPEC,
  36. LPS_SPOTSPEC,
  37. LPS_POINTSPEC,
  38. LPS_POINTMASKSPEC,
  39. LPS_SHADOW,
  40. LPS_SPOTSHADOW,
  41. LPS_POINTSHADOW,
  42. LPS_POINTMASKSHADOW,
  43. LPS_SHADOWSPEC,
  44. LPS_SPOTSHADOWSPEC,
  45. LPS_POINTSHADOWSPEC,
  46. LPS_POINTMASKSHADOWSPEC,
  47. MAX_LIGHT_PS_VARIATIONS
  48. };
  49. enum DeferredLightVSVariation
  50. {
  51. DLVS_NONE = 0,
  52. DLVS_DIR,
  53. DLVS_ORTHO,
  54. DLVS_ORTHODIR,
  55. MAX_DEFERRED_LIGHT_VS_VARIATIONS
  56. };
  57. enum DeferredLightPSVariation
  58. {
  59. DLPS_NONE = 0,
  60. DLPS_SPOT,
  61. DLPS_POINT,
  62. DLPS_POINTMASK,
  63. DLPS_SPEC,
  64. DLPS_SPOTSPEC,
  65. DLPS_POINTSPEC,
  66. DLPS_POINTMASKSPEC,
  67. DLPS_SHADOW,
  68. DLPS_SPOTSHADOW,
  69. DLPS_POINTSHADOW,
  70. DLPS_POINTMASKSHADOW,
  71. DLPS_SHADOWSPEC,
  72. DLPS_SPOTSHADOWSPEC,
  73. DLPS_POINTSHADOWSPEC,
  74. DLPS_POINTMASKSHADOWSPEC,
  75. DLPS_ORTHO,
  76. DLPS_ORTHOSPOT,
  77. DLPS_ORTHOPOINT,
  78. DLPS_ORTHOPOINTMASK,
  79. DLPS_ORTHOSPEC,
  80. DLPS_ORTHOSPOTSPEC,
  81. DLPS_ORTHOPOINTSPEC,
  82. DLPS_ORTHOPOINTMASKSPEC,
  83. DLPS_ORTHOSHADOW,
  84. DLPS_ORTHOSPOTSHADOW,
  85. DLPS_ORTHOPOINTSHADOW,
  86. DLPS_ORTHOPOINTMASKSHADOW,
  87. DLPS_ORTHOSHADOWSPEC,
  88. DLPS_ORTHOSPOTSHADOWSPEC,
  89. DLPS_ORTHOPOINTSHADOWSPEC,
  90. DLPS_ORTHOPOINTMASKSHADOWSPEC,
  91. MAX_DEFERRED_LIGHT_PS_VARIATIONS
  92. };
  93. class Renderer
  94. {
  95. void SetNumViewports(unsigned num);
  96. void SetViewport(unsigned index, Viewport* viewport);
  97. void SetDefaultRenderPath(RenderPath* renderPath);
  98. void SetDefaultRenderPath(XMLFile* file);
  99. void SetHDRRendering(bool enable);
  100. void SetSpecularLighting(bool enable);
  101. void SetTextureAnisotropy(int level);
  102. void SetTextureFilterMode(TextureFilterMode mode);
  103. void SetTextureQuality(int quality);
  104. void SetMaterialQuality(int quality);
  105. void SetDrawShadows(bool enable);
  106. void SetShadowMapSize(int size);
  107. void SetShadowQuality(int quality);
  108. void SetReuseShadowMaps(bool enable);
  109. void SetMaxShadowMaps(int shadowMaps);
  110. void SetMaxShadowCascades(int cascades);
  111. void SetDynamicInstancing(bool enable);
  112. void SetMinInstances(int instances);
  113. void SetMaxInstanceTriangles(int triangles);
  114. void SetMaxSortedInstances(int instances);
  115. void SetMaxOccluderTriangles(int triangles);
  116. void SetOcclusionBufferSize(int size);
  117. void SetOccluderSizeThreshold(float screenSize);
  118. void ReloadShaders();
  119. unsigned GetNumViewports() const;
  120. Viewport* GetViewport(unsigned index) const;
  121. RenderPath* GetDefaultRenderPath() const;
  122. bool GetHDRRendering() const;
  123. bool GetSpecularLighting() const;
  124. bool GetDrawShadows() const;
  125. int GetTextureAnisotropy() const;
  126. TextureFilterMode GetTextureFilterMode() const;
  127. int GetTextureQuality() const;
  128. int GetMaterialQuality() const;
  129. int GetShadowMapSize() const;
  130. int GetShadowQuality() const;
  131. bool GetReuseShadowMaps() const;
  132. int GetMaxShadowMaps() const;
  133. int GetMaxShadowCascades() const;
  134. bool GetDynamicInstancing() const;
  135. int GetMinInstances() const;
  136. int GetMaxInstanceTriangles() const;
  137. int GetMaxSortedInstances() const;
  138. int GetMaxOccluderTriangles() const;
  139. int GetOcclusionBufferSize() const;
  140. float GetOccluderSizeThreshold() const;
  141. unsigned GetNumViews() const;
  142. unsigned GetNumPrimitives() const;
  143. unsigned GetNumBatches() const;
  144. unsigned GetNumGeometries(bool allViews = false) const;
  145. unsigned GetNumLights(bool allViews = false) const;
  146. unsigned GetNumShadowMaps(bool allViews = false) const;
  147. unsigned GetNumOccluders(bool allViews = false) const;
  148. Zone* GetDefaultZone() const;
  149. Light* GetQuadDirLight() const;
  150. Material* GetDefaultMaterial() const;
  151. Texture2D* GetDefaultLightRamp() const;
  152. Texture2D* GetDefaultLightSpot() const;
  153. TextureCube* GetFaceSelectCubeMap() const;
  154. TextureCube* GetIndirectionCubeMap() const;
  155. VertexBuffer* GetInstancingBuffer() const;
  156. const FrameInfo& GetFrameInfo();
  157. void DrawDebugGeometry(bool depthTest);
  158. tolua_property__get_set unsigned numViewports;
  159. tolua_property__get_set RenderPath* defaultRenderPath;
  160. tolua_property__get_set bool HDRRendering;
  161. tolua_property__get_set bool specularLighting;
  162. tolua_property__get_set bool drawShadows;
  163. tolua_property__get_set int textureAnisotropy;
  164. tolua_property__get_set TextureFilterMode textureFilterMode;
  165. tolua_property__get_set int textureQuality;
  166. tolua_property__get_set int materialQuality;
  167. tolua_property__get_set int shadowMapSize;
  168. tolua_property__get_set int shadowQuality;
  169. tolua_property__get_set bool reuseShadowMaps;
  170. tolua_property__get_set int maxShadowMaps;
  171. tolua_property__get_set int maxShadowCascades;
  172. tolua_property__get_set bool dynamicInstancing;
  173. tolua_property__get_set int minInstances;
  174. tolua_property__get_set int maxInstanceTriangles;
  175. tolua_property__get_set int maxSortedInstances;
  176. tolua_property__get_set int maxOccluderTriangles;
  177. tolua_property__get_set int occlusionBufferSize;
  178. tolua_property__get_set float occluderSizeThreshold;
  179. tolua_readonly tolua_property__get_set unsigned numViews;
  180. tolua_readonly tolua_property__get_set unsigned numPrimitives;
  181. tolua_readonly tolua_property__get_set unsigned numBatches;
  182. tolua_readonly tolua_property__get_set Zone* defaultZone;
  183. tolua_readonly tolua_property__get_set Material* defaultMaterial;
  184. tolua_readonly tolua_property__get_set Texture2D* defaultLightRamp;
  185. tolua_readonly tolua_property__get_set Texture2D* defaultLightSpot;
  186. };
  187. Renderer* GetRenderer();
  188. tolua_readonly tolua_property__get_set Renderer* renderer;
  189. ${
  190. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_GetRenderer00
  191. static int tolua_GraphicsLuaAPI_GetRenderer00(lua_State* tolua_S)
  192. {
  193. return ToluaGetSubsystem<Renderer>(tolua_S);
  194. }
  195. #define TOLUA_DISABLE_tolua_get_renderer_ptr
  196. #define tolua_get_renderer_ptr tolua_GraphicsLuaAPI_GetRenderer00
  197. $}