@@ -130,10 +130,12 @@ internal class LightmapDesc
130130 internal enum IntegratedOutputType
131131 {
132132 Direct ,
133+ DirectBRDF ,
133134 Indirect ,
134135 AO ,
135136 Validity ,
136137 DirectionalityDirect ,
138+ DirectionalityDirectBRDF ,
137139 DirectionalityIndirect ,
138140 ShadowMask
139141 }
@@ -142,6 +144,7 @@ internal class LightmapIntegratorContext : IDisposable
142144 {
143145 internal UVFallbackBufferBuilder UVFallbackBufferBuilder ;
144146 internal LightmapDirectIntegrator LightmapDirectIntegrator ;
147+ internal LightmapDirectBRDFIntegrator LightmapDirectBRDFIntegrator ;
145148 internal LightmapIndirectIntegrator LightmapIndirectIntegrator ;
146149 internal LightmapAOIntegrator LightmapAOIntegrator ;
147150 internal LightmapValidityIntegrator LightmapValidityIntegrator ;
@@ -171,6 +174,8 @@ public void Dispose()
171174 UVFallbackBufferBuilder = null ;
172175 LightmapDirectIntegrator ? . Dispose ( ) ;
173176 LightmapDirectIntegrator = null ;
177+ LightmapDirectBRDFIntegrator ? . Dispose ( ) ;
178+ LightmapDirectBRDFIntegrator = null ;
174179 LightmapIndirectIntegrator ? . Dispose ( ) ;
175180 LightmapIndirectIntegrator = null ;
176181 LightmapAOIntegrator ? . Dispose ( ) ;
@@ -200,6 +205,8 @@ internal void Initialize(SamplingResources samplingResources, LightmapResourceLi
200205 UVFallbackBufferBuilder . Prepare ( lightmapResourceLib . UVFallbackBufferGenerationMaterial ) ;
201206 LightmapDirectIntegrator = new LightmapDirectIntegrator ( ) ;
202207 LightmapDirectIntegrator . Prepare ( lightmapResourceLib . DirectAccumulationShader , lightmapResourceLib . NormalizationShader , lightmapResourceLib . ExpansionHelpers , SamplingResources , _emptyExposureTexture ) ;
208+ LightmapDirectBRDFIntegrator = new LightmapDirectBRDFIntegrator ( ) ;
209+ LightmapDirectBRDFIntegrator . Prepare ( lightmapResourceLib . DirectBRDFAccumulationShader , lightmapResourceLib . NormalizationShader , lightmapResourceLib . ExpansionHelpers , SamplingResources , _emptyExposureTexture ) ;
203210 LightmapIndirectIntegrator = new LightmapIndirectIntegrator ( ) ;
204211 LightmapIndirectIntegrator . Prepare ( lightmapResourceLib . IndirectAccumulationShader , lightmapResourceLib . NormalizationShader , lightmapResourceLib . ExpansionHelpers , SamplingResources , _emptyExposureTexture ) ;
205212 LightmapAOIntegrator = new LightmapAOIntegrator ( ) ;
@@ -236,6 +243,7 @@ internal class LightmapResourceLibrary
236243 internal IRayTracingShader GBufferShader ;
237244 internal ComputeShader NormalizationShader ;
238245 internal IRayTracingShader DirectAccumulationShader ;
246+ internal IRayTracingShader DirectBRDFAccumulationShader ;
239247 internal IRayTracingShader AOAccumulationShader ;
240248 internal IRayTracingShader ValidityAccumulationShader ;
241249 internal IRayTracingShader IndirectAccumulationShader ;
@@ -261,6 +269,7 @@ public void Load(RayTracingContext context)
261269
262270 NormalizationShader = AssetDatabase . LoadAssetAtPath < ComputeShader > ( packageFolder + "Shaders/ResolveAccumulation.compute" ) ;
263271 DirectAccumulationShader = context . LoadRayTracingShader ( packageFolder + "Shaders/LightmapDirectIntegration.urtshader" ) ;
272+ DirectBRDFAccumulationShader = context . LoadRayTracingShader ( packageFolder + "Shaders/LightmapDirectBRDFIntegration.urtshader" ) ;
264273 AOAccumulationShader = context . LoadRayTracingShader ( packageFolder + "Shaders/LightmapAOIntegration.urtshader" ) ;
265274 ValidityAccumulationShader = context . LoadRayTracingShader ( packageFolder + "Shaders/LightmapValidityIntegration.urtshader" ) ;
266275 IndirectAccumulationShader = context . LoadRayTracingShader ( packageFolder + "Shaders/LightmapIndirectIntegration.urtshader" ) ;
0 commit comments