Пример #1
0
        public override void Bind()
        {
            set.BindPrimaryForm("_VertBuffer", Hair);
            set.BindForm("_BaseBuffer", Base);

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

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

            constraint1.BindInt("_Pass", 1);
            constraint1.BindFloat("_HairLength", () => Hair.length);
            constraint1.BindPrimaryForm("_VertBuffer", Hair);
            constraint1.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.BindFloats("_Transform", () => this.transformArray);

            data.BindCameraData(collision);
        }
Пример #2
0
        public override void _Bind()
        {
            transfer.BindPrimaryForm("_VertBuffer", verts);
            transfer.BindForm("_SkeletonBuffer", skeleton);

            data.BindCameraData(transfer);

            transfer.BindFloat("_Radius", () => this.radius);
            transfer.BindFloats("_TransformBase", () => this.transformArray);

            Bind();
        }