public sealed override void UpdateNodeAfterDeserialization()
        {
            var addedSlots = new List <int>();

            dotInputSlot        = null;
            f0InputSlot         = null;
            iorSourceInputSlot  = null;
            iorMediumInputSlot  = null;
            iorMediumKInputSlot = null;
            fresnelOutputSlot   = null;

            dotInputSlot = new Vector1MaterialSlot((int)FresnelSlots.kDotVectorsInputSlotId, kDotVectorsInputSlotName, kDotVectorsInputSlotName, SlotType.Input, 0.0f);
            AddSlot(dotInputSlot);
            addedSlots.Add(dotInputSlot.id);

            if (m_FresnelEquationMode == FresnelEquationMode.Schlick)
            {
                f0InputSlot = new Vector1MaterialSlot((int)FresnelSlots.kF0InputSlotId, kF0InputSlotName, kF0InputSlotName, SlotType.Input, 0.04f);
                AddSlot(f0InputSlot);
                addedSlots.Add(f0InputSlot.id);
            }
            else if (m_FresnelEquationMode == FresnelEquationMode.Dielectric)
            {
                iorSourceInputSlot = new Vector1MaterialSlot((int)FresnelSlots.kIORSourceInputSlotId, kIORSourceInputSlotName, kIORSourceInputSlotName, SlotType.Input, 1.0f);
                iorMediumInputSlot = new Vector1MaterialSlot((int)FresnelSlots.kIORMediumInputSlotId, kIORMediumInputSlotName, kIORMediumInputSlotName, SlotType.Input, 1.5f);
                AddSlot(iorSourceInputSlot);
                addedSlots.Add(iorSourceInputSlot.id);

                AddSlot(iorMediumInputSlot);
                addedSlots.Add(iorMediumInputSlot.id);
            }
            else if (m_FresnelEquationMode == FresnelEquationMode.DielectricGeneric)
            {
                iorSourceInputSlot  = new Vector1MaterialSlot((int)FresnelSlots.kIORSourceInputSlotId, kIORSourceInputSlotName, kIORSourceInputSlotName, SlotType.Input, 1.0f);
                iorMediumInputSlot  = new Vector1MaterialSlot((int)FresnelSlots.kIORMediumInputSlotId, kIORMediumInputSlotName, kIORMediumInputSlotName, SlotType.Input, 1.5f);
                iorMediumKInputSlot = new Vector1MaterialSlot((int)FresnelSlots.kIORMediumKInputSlotId, kIORMediumImInputSlotName, kIORMediumImInputSlotName, SlotType.Input, 2.0f);
                AddSlot(iorSourceInputSlot);
                addedSlots.Add(iorSourceInputSlot.id);

                AddSlot(iorMediumInputSlot);
                addedSlots.Add(iorMediumInputSlot.id);

                AddSlot(iorMediumKInputSlot);
                addedSlots.Add(iorMediumKInputSlot.id);
            }

            fresnelOutputSlot = new Vector1MaterialSlot((int)FresnelSlots.kFresnelOutputSlotId, kFresnelOutputSlotName, kFresnelOutputSlotName, SlotType.Output, 0.5f);
            AddSlot(fresnelOutputSlot);
            addedSlots.Add(fresnelOutputSlot.id);

            RemoveSlotsNameNotMatching(addedSlots, supressWarnings: true);
        }
            public TestNode()
            {
                slot1 = new Vector1MaterialSlot(V1In, "V1In", "V1In", SlotType.Input, 1);
                AddSlot(slot1);

                slot2 = new Vector2MaterialSlot(V2In, "V2In", "V2In", SlotType.Input, Vector2.one);
                AddSlot(slot2);

                slot3 = new Vector3MaterialSlot(V3In, "V3In", "V3In", SlotType.Input, Vector3.one);
                AddSlot(slot3);

                slot4 = new Vector4MaterialSlot(V4In, "V4In", "V4In", SlotType.Input, Vector4.one);
                AddSlot(slot4);
            }
Exemple #3
0
        public sealed override void UpdateNodeAfterDeserialization()
        {
            // Input slots:
            ldrColorSlot  = new ColorRGBMaterialSlot(kEmissionColorInputSlotId, kEmissionColorInputSlotName, kEmissionColorInputSlotName, SlotType.Input, Color.black, ColorMode.Default);
            intensitySlot = new Vector1MaterialSlot(kEmissionIntensityInputSlotId, kEmissionIntensityInputSlotName, kEmissionIntensityInputSlotName, SlotType.Input, 1);
            AddSlot(ldrColorSlot);
            AddSlot(intensitySlot);
            AddSlot(new Vector1MaterialSlot(kEmissionExposureWeightInputSlotId, kEmissionExpositionWeightInputSlotName, kEmissionExpositionWeightInputSlotName, SlotType.Input, 1));

            // Output slot:kEmissionOutputSlotName
            AddSlot(new ColorRGBMaterialSlot(kEmissionOutputSlotId, kEmissionOutputSlotName, kEmissionOutputSlotName, SlotType.Output, Color.black, ColorMode.HDR));

            RemoveSlotsNameNotMatching(new[] {
                kEmissionOutputSlotId, kEmissionColorInputSlotId,
                kEmissionIntensityInputSlotId, kEmissionExposureWeightInputSlotId
            });
        }