public override void Bake() { if (bakedRenderers == null) { bakedRenderers = new List <Renderer>(); } bakedRenderers.Clear(); AVolumeSettings settings = new AVolumeSettings(bounds, dimensions); //first check if any objects are parented to this object //if anything is found, try to use renderers from those instead of volume overlap if (!GetChildRenderersAndEncapsulate(ref settings, ref bakedRenderers, transform)) { //otherwise try to get renderers intersecting the volume //get mesh renderers within volume if (!GetMeshRenderersIntersectingVolume(settings, transform, ref bakedRenderers)) { //TODO display error? return; } } SDFVolume sdfVolume = AVolume <SDFVolume> .CreateVolume(transform, settings); // sdfVolume.Bake( raySamples, bakedRenderers, BakeComplete ); Debug.Log($"settings: {settings.BoundsLocal} {settings.Dimensions} {settings.CellCount} "); sdfVolume.Dispose(); }
public override void Bake() { if (bakedRenderers == null) { bakedRenderers = new List <Renderer>(); } bakedRenderers.Clear(); AVolumeSettings settings = new AVolumeSettings(bounds, dimensions, useStandardBorder); //first check if any objects are parented to this object //if anything is found, try to use renderers from those instead of volume overlap if (!SDFBaker.GetMeshRenderersInChildren(ref settings, ref bakedRenderers, transform, fitToVertices)) { //otherwise try to get renderers intersecting the volume //get mesh renderers within volume if (!SDFBaker.GetMeshRenderersIntersectingVolume(settings, transform, ref bakedRenderers)) { //TODO display error? return; } } SDFVolume sdfVolume = AVolume <SDFVolume> .CreateVolume(transform, settings); sdfVolume.Bake(raySamples, bakedRenderers, BakeComplete); sdfVolume.Dispose(); }
public virtual void EditorCreateAVolume() { EditorDestroyAVolume(); AVolumeSettings settings = new AVolumeSettings { Bounds = bounds, Dimensions = dimensions }; //create new aVolume = AVolume <T> .CreateVolume(transform, settings); }