Пример #1
0
        public override void PostRender(RenderingContext rc)
        {
            base.PostRender(rc);

            CurrentShader.Deactivate();

            this.DecendantsByType <ImageTexture>().ForEach(TeXtUrE => TeXtUrE.Deactivate());

            if (typeof(Text).IsInstanceOfType(geometry))
            {
                Text txt = (Text)geometry;
                txt.UnbindTextures(rc);
            }

            rc.PopMatricies();
        }
Пример #2
0
        private void ApplyAppearance(RenderingContext rc)
        {
            if (appearance == null)
            {
                appearance = (X3DAppearanceNode)this.Children.FirstOrDefault(n => (typeof(X3DAppearanceNode)).IsInstanceOfType(n));
            }

            Appearance ap = (Appearance)appearance;


            ApplyMaterials(CurrentShader); // apply materials should really be done once at load but havent figured it out fully


            this.DecendantsByType <ImageTexture>().ForEach(TeXtUrE => TeXtUrE.Bind());

            if (typeof(Text).IsInstanceOfType(geometry))
            {
                Text txt = (Text)geometry;
                txt.BindTextures(rc);
                //CurrentShader.SetFieldValue("threshold", new Vector4(0.1f, 0.1f, 0.1f, 1.0f));
            }
        }