private void OnDrawGizmos() { if (vpls == null) { if (sampleMode == SampleMode.UniformCircle) { vpls = UniformCircle.calculatePoint(radius, samples, true, true); } else if (sampleMode == SampleMode.UniformCircleWithoutOffset) { vpls = UniformCircle.calculatePoint(radius, samples, false, true); } else if (sampleMode == SampleMode.Halton) { vpls = UniformCircle.HaltonGenerator(radius, samples, true); } else if (sampleMode == SampleMode.HaltonWithoutOffset) { vpls = UniformCircle.HaltonGenerator(radius, samples, false); } } foreach (Vector2 p in vpls) { Gizmos.DrawSphere(p, gizmosRadius); } }
public void Initialize() { if (preLight) { realPointPos = new List <LightPath>(); if (pointLightObjects != null) { foreach (GameObject obj in pointLightObjects) { Destroy(obj); } pointLightObjects = new List <GameObject>(); } pointLights = new Dictionary <GameObject, Light>(); Vector3 normal = transform.forward; //List<Vector2> localSp = UniformCircle.calculatePoint(radius, vplSzie, doOffset, true); // 已經offset List <Vector2> localSp = UniformCircle.HaltonGenerator(radius, vplSzie, doOffset); for (int i = 0; i < vplSzie; i++) { generateNewLight(localSp[i]); } } isInit = true; }
private void OnValidate() { if (sampleMode == SampleMode.UniformCircle) { vpls = UniformCircle.calculatePoint(radius, samples, true, true); } else if (sampleMode == SampleMode.UniformCircleWithoutOffset) { vpls = UniformCircle.calculatePoint(radius, samples, false, true); } else if (sampleMode == SampleMode.Halton) { vpls = UniformCircle.HaltonGenerator(radius, samples, true); } else if (sampleMode == SampleMode.HaltonWithoutOffset) { vpls = UniformCircle.HaltonGenerator(radius, samples, false); } }
private void Start() { localSps = UniformCircle.calculatePoint(radius, sampleSize, doOffset, isUniform); }