Exemple #1
0
        public override void Bind()
        {
            life.BindInt("_CurrentStep", () => currentStep);
            life.BindFloat("_PercentageDone", () => percentageDone);

            life.BindMatrix("_Transform", () => transform.localToWorldMatrix);
            life.BindMatrix("_InverseTransform", () => transform.worldToLocalMatrix);

            life.BindForm("_VertBuffer", mesh.verts);
            life.BindForm("_TriBuffer", mesh.triangles);

            life.BindVector3("_Center", () => ((Form3D)form).center);
            life.BindVector3("_Dimensions", () => ((Form3D)form).dimensions);
            life.BindVector3("_Extents", () => ((Form3D)form).extents);


            finalLife.BindPrimaryForm("_VolumeBuffer", form);
            finalLife.BindInt("_CurrentStep", () => currentStep);
            finalLife.BindFloat("_PercentageDone", () => percentageDone);

            finalLife.BindMatrix("_Transform", () => transform.localToWorldMatrix);
            finalLife.BindMatrix("_InverseTransform", () => transform.worldToLocalMatrix);


            finalLife.BindVector3("_Center", () => ((Form3D)form).center);
            finalLife.BindVector3("_Dimensions", () => ((Form3D)form).dimensions);
            finalLife.BindVector3("_Extents", () => ((Form3D)form).extents);
        }
Exemple #2
0
        public override void _Bind()
        {
            transfer.BindPrimaryForm("_VertBuffer", verts);
            transfer.BindForm("_SkeletonBuffer", skeleton);

            data.BindCameraData(transfer);

            transfer.BindFloat("_Radius", () => this.radius);
            transfer.BindMatrix("_Transform", () => transform.localToWorldMatrix);
            transfer.BindMatrix("_InverseTransform", () => transform.worldToLocalMatrix);

            Bind();
        }
Exemple #3
0
        public override void Bind()
        {
            set.BindPrimaryForm("_VertBuffer", Hair);
            set.BindForm("_BaseBuffer", Base);

            collision.BindPrimaryForm("_VertBuffer", Hair);
            collision.BindForm("_BaseBuffer", Base);

            constraint.BindFloat("_HairLength", () => Hair.length);
            constraint.BindPrimaryForm("_VertBuffer", Hair);
            constraint.BindInt("_NumVertsPerHair", () => Hair.numVertsPerHair);

            set.BindFloat("_HairLength", () => Hair.length);
            set.BindFloat("_HairVariance", () => Hair.variance);
            set.BindInt("_NumVertsPerHair", () => Hair.numVertsPerHair);

            // Don't need to bind for all of them ( constraints ) because same shader
            collision.BindFloat("_HairLength", () => Hair.length);
            collision.BindFloat("_HairVariance", () => Hair.variance);
            collision.BindInt("_NumVertsPerHair", () => Hair.numVertsPerHair);
            collision.BindMatrix("_Transform", () => transform.localToWorldMatrix);

            data.BindCameraData(collision);
        }