30 void registerProgram(
const std::string& name,
const std::vector<std::string>& chunkOrder);
31 bool hasProgram(
const std::string& name)
const;
34 bool dynamicBatch =
false);
37 void bindMaterial(
const std::shared_ptr<GraphicsDevice>& device,
const Material* material,
bool transparentPass,
38 bool dynamicBatch =
false);
75 struct ShaderVariantOptions
78 bool transparentPass =
false;
79 bool alphaTest =
false;
80 bool doubleSided =
false;
82 bool baseColorMap =
false;
83 bool normalMap =
false;
84 bool metallicRoughnessMap =
false;
85 bool occlusionMap =
false;
86 bool emissiveMap =
false;
90 bool shadowMapping =
false;
92 bool parallax =
false;
93 bool clearcoat =
false;
94 bool anisotropy =
false;
96 bool iridescence =
false;
97 bool transmission =
false;
98 bool lightClustering =
false;
100 bool lightProbes =
false;
101 bool vertexColors =
false;
102 bool skinning =
false;
103 bool morphing =
false;
104 bool specGloss =
false;
105 bool orenNayar =
false;
106 bool detailNormals =
false;
107 bool displacement =
false;
108 bool atmosphere =
false;
109 bool pointSpotAttenuation =
false;
110 bool multiLight =
false;
111 bool shadowCatcher =
false;
112 bool skyCubemap =
false;
113 bool surfaceLIC =
false;
114 bool instancing =
false;
115 bool planarReflection =
false;
116 bool planarReflectionDepthPass =
false;
117 bool localShadows =
false;
118 bool omniShadows =
false;
119 bool dynamicBatch =
false;
120 bool pointSize =
false;
121 bool areaLights =
false;
125 ShaderVariantOptions buildForwardVariantOptions(
const Material* material,
bool transparentPass,
126 bool dynamicBatch =
false)
const;
127 static std::string resolveProgramName(
const ShaderVariantOptions& options);
128 uint64_t makeVariantKey(
const std::string& programName,
const ShaderVariantOptions& options,
const Material* material)
const;
129 std::shared_ptr<Shader> buildForwardShaderVariant(
const std::string& programName,
const ShaderVariantOptions& options, uint64_t variantKey);
131 std::string composeProgramVariantMetalSource(
const std::string& programName,
const ShaderVariantOptions& options,
132 const std::string& vertexEntry,
const std::string& fragmentEntry);
134 std::shared_ptr<GraphicsDevice> _device;
135 std::unordered_map<uint64_t, std::shared_ptr<Shader>> _forwardShaderCache;
136 std::unordered_set<std::string> _warnedFeatureFlags;
137 std::unordered_map<std::string, std::vector<std::string>> _registeredPrograms;
138 bool _skyCubemapAvailable =
false;
139 bool _planarReflectionDepthPass =
false;
140 bool _localShadowsEnabled =
false;
141 bool _omniShadowsEnabled =
false;
142 bool _clusteredLightingEnabled =
false;
143 bool _areaLightsEnabled =
false;
144 bool _ssaoEnabled =
false;
145 bool _atmosphereEnabled =
false;