Config.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright (C) 2009-2019, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <anki/core/Config.h>
  6. #include <anki/util/System.h>
  7. #include <anki/Math.h>
  8. #include <shaders/glsl_cpp_common/ClusteredShading.h>
  9. namespace anki
  10. {
  11. Config::Config()
  12. {
  13. // Renderer
  14. newOption("r.renderingQuality", 1.0, "Rendering quality factor");
  15. newOption("r.lodDistance0", 20.0, "Distance that will be used to calculate the LOD 0");
  16. newOption("r.lodDistance1", 40.0, "Distance that will be used to calculate the LOD 1");
  17. newOption("r.clusterSizeX", 32);
  18. newOption("r.clusterSizeY", 26);
  19. newOption("r.clusterSizeZ", 32);
  20. newOption("r.avgObjectsPerCluster", 16);
  21. newOption("r.textureAnisotropy", 8);
  22. newOption("r.volumetricLightingAccumulation.clusterFractionXY", 4);
  23. newOption("r.volumetricLightingAccumulation.clusterFractionZ", 4);
  24. newOption("r.volumetricLightingAccumulation.finalClusterInZ", 26);
  25. newOption("r.shadowMapping.enabled", true);
  26. newOption("r.shadowMapping.tileResolution", 128);
  27. newOption("r.shadowMapping.tileCountPerRowOrColumn", 16);
  28. newOption("r.shadowMapping.scratchTileCountX", 4 * (MAX_SHADOW_CASCADES + 2));
  29. newOption("r.shadowMapping.scratchTileCountY", 4);
  30. newOption("r.shadowMapping.lightLodDistance0", 10.0);
  31. newOption("r.shadowMapping.lightLodDistance1", 20.0);
  32. newOption("r.lensFlare.maxSpritesPerFlare", 8);
  33. newOption("r.lensFlare.maxFlares", 16);
  34. newOption("r.bloom.threshold", 2.5);
  35. newOption("r.bloom.scale", 2.5);
  36. newOption("r.indirect.reflectionResolution", 128);
  37. newOption("r.indirect.irradianceResolution", 16);
  38. newOption("r.indirect.maxSimultaneousProbeCount", 32);
  39. newOption("r.indirect.shadowMapResolution", 64);
  40. newOption("r.gi.tileResolution", 32);
  41. newOption("r.gi.shadowMapResolution", 128);
  42. newOption("r.gi.maxCachedProbes", 16);
  43. newOption("r.gi.maxVisibleProbes", 8);
  44. newOption("r.gi.firstClipmapLevelCellSize", 1.0);
  45. newOption("r.gi.secondClipmapLevelCellSize", 8.0);
  46. newOption("r.gi.firstClipmapMaxDistance", 20.0);
  47. newOption("r.motionBlur.maxSamples", 32);
  48. newOption("r.ssr.maxSteps", 64);
  49. newOption("r.ssr.historyBlendFactor", 0.3);
  50. newOption("r.dbg.enabled", false);
  51. newOption("r.final.motionBlurSamples", 32);
  52. // Scene
  53. newOption("scene.earlyZDistance", 10.0, "Objects with distance lower than that will be used in early Z");
  54. newOption("scene.reflectionProbeEffectiveDistance", 256.0, "How far reflection probes can look");
  55. newOption("scene.reflectionProbeShadowEffectiveDistance", 32.0, "How far to render shadows for reflection probes");
  56. // Globals
  57. newOption("width", 1280);
  58. newOption("height", 768);
  59. // Resource
  60. newOption("rsrc.maxTextureSize", 1024 * 1024);
  61. newOption("rsrc.dumpShaderSources", false);
  62. newOption("rsrc.dataPaths", ".", "The engine loads assets only in from these paths. Separate them with :");
  63. newOption("rsrc.transferScratchMemorySize", 256_MB);
  64. // Window
  65. newOption("window.fullscreen", false);
  66. newOption("window.debugContext", false);
  67. newOption("window.vsync", false);
  68. newOption("window.debugMarkers", false);
  69. // GR
  70. newOption("gr.diskShaderCacheMaxSize", 10_MB);
  71. newOption("gr.vkminor", 1);
  72. newOption("gr.vkmajor", 1);
  73. newOption("gr.glmajor", 4);
  74. newOption("gr.glminor", 5);
  75. // Core
  76. newOption("core.uniformPerFrameMemorySize", 16_MB);
  77. newOption("core.storagePerFrameMemorySize", 16_MB);
  78. newOption("core.vertexPerFrameMemorySize", 10_MB);
  79. newOption("core.textureBufferPerFrameMemorySize", 1_MB);
  80. newOption("core.mainThreadCount", max(2u, getCpuCoresCount() / 2u - 1u));
  81. newOption("core.displayStats", false);
  82. newOption("core.clearCaches", false);
  83. }
  84. Config::~Config()
  85. {
  86. }
  87. } // end namespace anki