Ejemplo n.º 1
0
 public CheckboxComponent() : base(typeof(CheckboxComponent))
 {
     //Material = defaultMaterial;
     shaderUniform = Material.UniformManager.GetUniform("model");
     colorMask     = Material.UniformManager.GetUniform("color_mask");
     color         = Vector4.One;
 }
Ejemplo n.º 2
0
 public RawImage() : base(typeof(RawImage))
 {
     //Material = defaultMaterial;
     shaderUniform = Material.UniformManager.GetUniform("model");
     colorMask     = Material.UniformManager.GetUniform("color_mask");
     color         = Vector4.One;
     Material.ApplyMaterial();
     colorMask.SetValue(color);
 }
Ejemplo n.º 3
0
 public ScrollBoxComponent() : base(typeof(ScrollBoxComponent))
 {
     //Material = defaultMaterial;
     shaderUniform    = Material.UniformManager.GetUniform("model");
     colorMask        = Material.UniformManager.GetUniform("color_mask");
     color            = Vector4.One;
     ScrollDirection  = ScrollMode.Vertical;
     base.IsAllowDrag = true;
 }
Ejemplo n.º 4
0
 public ButtonComponent() : base(typeof(ButtonComponent))
 {
     //Material = defaultMaterial;
     shaderUniform    = Material.UniformManager.GetUniform("model");
     colorMask        = Material.UniformManager.GetUniform("color_mask");
     color            = Vector4.One;
     Texture          = defaultTexture;
     base.IsAllowDrag = false;
 }
Ejemplo n.º 5
0
 public UIMaskComponent() : base(typeof(UIMaskComponent))
 {
     //Material = defaultMaterial;
     shaderUniform = Material.UniformManager.GetUniform("model");
     colorMask     = Material.UniformManager.GetUniform("color_mask");
     //color = Vector4.One * 0.1f;
     color         = Vector4.Zero;
     AllowMultiple = false;
 }
Ejemplo n.º 6
0
 public TextInputComponent() : base(typeof(CheckboxComponent))
 {
     shaderUniform                   = Material.UniformManager.GetUniform("model");
     colorMask                       = Material.UniformManager.GetUniform("color_mask");
     color                           = Vector4.One;
     Text.textCanvas.colour          = Vector3.Zero;
     Text.textCanvas.alignHorizontal = TextAlignHorizontal.Left;
     Text.textCanvas.alignVertical   = TextAlignVertical.Bottom;
     Texture                         = null;
 }
Ejemplo n.º 7
0
        public ShaderUniform[] CopyUniforms()
        {
            ShaderUniform[] unis = new ShaderUniform[uniforms.Length];
            for (int i = 0; i < uniforms.Length; i++)
            {
                unis[i] = uniforms[i].Clone();
            }

            return(unis);
        }
Ejemplo n.º 8
0
 public SliderCompoent() : base(typeof(SliderCompoent))
 {
     //Material = defaultMaterial;
     shaderUniform    = Material.UniformManager.GetUniform("model");
     colorMask        = Material.UniformManager.GetUniform("color_mask");
     color            = Vector4.One;
     bgTexture        = null;
     fillTexture      = null;
     base.IsAllowDrag = true;
 }
Ejemplo n.º 9
0
 //for deletion
 void VisibilityCheck(string name, ShaderUniform uniformVariable)
 {
     if (name == "diffuse_color")
     {
         if (((Vector4)uniformVariable.GetValue()).W < 0.01f)
         {
             material.RenderDirrectives.IsRendered = false;
         }
         else
         {
             material.RenderDirrectives.IsRendered = true;
         }
     }
 }
Ejemplo n.º 10
0
        public PrimitiveMeshProcessor(DynamicsWorld world)
        {
            World = world;
            ShaderManager.GetInstance.LoadShader("phys");
            shaderProgram = ShaderManager.GetInstance.GetShader("phys");

            //setting shader uniform references
            foreach (var uni in shaderProgram.GetUniforms)
            {
                if (uni.Name == "world")
                {
                    worldS = uni;
                }
                else if (uni.Name == "color")
                {
                    color = uni;
                }
            }

            CreateTri();
        }
Ejemplo n.º 11
0
        internal TextRenderer()
        {
            lib = new Library();

            try
            {
                using (Stream file = File.OpenRead(font))
                {
                    face = new Face(lib, ReadFont(file), 0);
                }
            }
            catch (Exception)
            {
                string defPath  = "Toys.Resourses.Fonts.reddelicious.ttf";
                var    assembly = IntrospectionExtensions.GetTypeInfo(typeof(ShaderManager)).Assembly;
                face = new Face(lib, ReadFont(assembly.GetManifestResourceStream(defPath)), 0);
            }

            face.SetPixelSizes(0, (uint)size);
            //projection = Matrix4.CreateOrthographicOffCenter(0, 800, 0, 600, 0f, -0.01f);
            ShaderManager shdmMgmt = ShaderManager.GetInstance;

            shdmMgmt.LoadShader("text");
            shdr = shdmMgmt.GetShader("text");
            shdr.ApplyShader();
            shdr.SetUniform((int)TextureType.Diffuse, "text");

            foreach (var uniform in shdr.GetUniforms)
            {
                if (uniform.Name == "projection")
                {
                    projUniform = uniform;
                }
                else if (uniform.Name == "textColor")
                {
                    colorUniform = uniform;
                }
            }
            charmap = Texture2D.CreateCharMap(mapSize, mapSize);
        }