Beispiel #1
0
        public static ProbeWrapper Wrap(VisibleReflectionProbe probe, PlanarReflectionProbe planarProbe)
        {
            if (probe.probe != null)
            {
                return(new VisibleReflectionProbeWrapper(probe));
            }
            if (planarProbe != null)
            {
                return(new PlanarReflectionProbeWrapper(planarProbe));
            }

            throw new ArgumentException();
        }
Beispiel #2
0
        static HDAdditionalReflectionData GetHDAdditionalReflectionData(VisibleReflectionProbe probe)
        {
            var add = probe.probe.GetComponent <HDAdditionalReflectionData>();

            if (add == null)
            {
                add = defaultHDAdditionalReflectionData;
                add.blendDistancePositive = Vector3.one * probe.blendDistance;
                add.blendDistanceNegative = add.blendDistancePositive;
                add.influenceShape        = ShapeType.Box;
            }
            return(add);
        }
Beispiel #3
0
        static HDAdditionalReflectionData GetHDAdditionalReflectionData(VisibleReflectionProbe probe)
        {
            var add = probe.probe.GetComponent <HDAdditionalReflectionData>();

            if (add == null)
            {
                add = HDUtils.s_DefaultHDAdditionalReflectionData;
                if (add.influenceVolume == null)
                {
                    add.Awake(); // We need to init the 'default' data if it isn't
                }
                Vector3 distance = Vector3.one * probe.blendDistance;
                add.influenceVolume.boxBlendDistancePositive = distance;
                add.influenceVolume.boxBlendDistanceNegative = distance;
                add.influenceVolume.shape = InfluenceShape.Box;
            }
            return(add);
        }
Beispiel #4
0
    void InspectCullResults(Camera camera, CullResults cullResults, ScriptableRenderContext renderContext)
    {
        VisibleReflectionProbe[] probes = cullResults.visibleReflectionProbes;

        Assert.AreEqual(1, probes.Length, "Incorrect reflection probe count");

        VisibleReflectionProbe probeA = probes[0];

        Assert.NotNull(probeA.texture, "probe texture");

        VisibleLight[] lights = cullResults.visibleLights;
        Assert.AreEqual(3, lights.Length, "Incorrect light count");

        LightType[] expectedTypes = new LightType[] { LightType.Directional, LightType.Spot, LightType.Point };
        for (int i = 0; i != 2; i++)
        {
            Assert.AreEqual(expectedTypes[i], lights[i].lightType,
                            "Incorrect light type for light " + i.ToString() + " (" + lights[i].light.name + ")");
        }

        // @TODO..
    }
Beispiel #5
0
 public VisibleReflectionProbeWrapper(VisibleReflectionProbe probe)
 {
     this.probe      = probe;
     additional      = GetHDAdditionalReflectionData(probe);
     reflectionProbe = probe.probe;
 }