|
|
|
|
|
|
|
|
|
|
static void LightmappingOnBakeReflectionProbeRequest(BakeReflectionProbeRequest request) |
|
|
|
{ |
|
|
|
if (request.completed) |
|
|
|
if (request.IsCompleted) |
|
|
|
return; |
|
|
|
|
|
|
|
// Custom probe hashes should be handled here by the user
|
|
|
|
|
|
|
s_CurrentBakeJob.Dispose(); |
|
|
|
s_CurrentBakeJob = null; |
|
|
|
} |
|
|
|
Debug.Log(request.requestHash.ToString()); |
|
|
|
|
|
|
|
var job = new ReflectionBakeJob(request); |
|
|
|
ReflectionSystem.QueryReflectionProbes(job.reflectionProbesToBake, mode: ReflectionProbeMode.Baked); |
|
|
|
|
|
|
|
|
|
|
static void LightmappingOnBakeReflectionProbeRequestCancelled(BakeReflectionProbeRequest request) |
|
|
|
{ |
|
|
|
Debug.Log("Cancel: " + request.requestHash); |
|
|
|
Debug.Log("Cancel: " + request.RequestHash); |
|
|
|
request.Cancelled -= LightmappingOnBakeReflectionProbeRequestCancelled; |
|
|
|
if (s_CurrentBakeJob != null && s_CurrentBakeJob.request == request) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
if (m_CurrentStage == Stage.Completed) |
|
|
|
{ |
|
|
|
request.progress = 1; |
|
|
|
request.Progress = 1; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
request.progress = 1; |
|
|
|
request.Progress = 1; |
|
|
|
m_CurrentStage = Stage.Completed; |
|
|
|
m_StageIndex = 0; |
|
|
|
} |
|
|
|
|
|
|
? 1f - job.m_StageIndex / (float)job.reflectionProbesToBake.Count |
|
|
|
: 1f; |
|
|
|
|
|
|
|
job.request.progress = ((float)Stage.BakeReflectionProbe + stageProgress) / (float)Stage.Completed; |
|
|
|
job.request.progressMessage = string.Format("Reflection Probes ({0}/{1})", job.m_StageIndex + 1, job.reflectionProbesToBake.Count); |
|
|
|
job.request.Progress = ((float)Stage.BakeReflectionProbe + stageProgress) / (float)Stage.Completed; |
|
|
|
job.request.ProgressMessage = string.Format("Reflection Probes ({0}/{1})", job.m_StageIndex + 1, job.reflectionProbesToBake.Count); |
|
|
|
|
|
|
|
var probe = job.reflectionProbesToBake[job.m_StageIndex]; |
|
|
|
|
|
|
|
|
|
|
? 1f - job.m_StageIndex / (float)job.planarReflectionProbesToBake.Count |
|
|
|
: 1f; |
|
|
|
|
|
|
|
job.request.progress = ((float)Stage.BakePlanarProbe + stageProgress) / (float)Stage.Completed; |
|
|
|
job.request.progressMessage = string.Format("Reflection Probes ({0}/{1})", job.m_StageIndex + 1, job.planarReflectionProbesToBake.Count); |
|
|
|
job.request.Progress = ((float)Stage.BakePlanarProbe + stageProgress) / (float)Stage.Completed; |
|
|
|
job.request.ProgressMessage = string.Format("Reflection Probes ({0}/{1})", job.m_StageIndex + 1, job.planarReflectionProbesToBake.Count); |
|
|
|
|
|
|
|
var probe = job.planarReflectionProbesToBake[job.m_StageIndex]; |
|
|
|
var target = s_PlanarReflectionProbeBaker.NewRenderTarget( |
|
|
|