Ejemplo n.º 1
0
 public void Load(ResUGX2.TexSampler texSampler)
 {
     BorderType          = texSampler.BorderType;
     ClampX              = texSampler.ClampX;
     ClampY              = texSampler.ClampY;
     ClampZ              = texSampler.ClampZ;
     DepthCompareEnabled = texSampler.DepthCompareEnabled;
     DepthCompareFunc    = texSampler.DepthCompareFunc;
     MinFilter           = texSampler.MinFilter;
     MipFilter           = texSampler.MipFilter;
     ZFilter             = texSampler.ZFilter;
 }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("NOTE! Texture maps are adjusted by shader options which link by shaders. These are not possible to edit yet, do you want to continue?", "Material Editor", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);

            if (result == DialogResult.OK)
            {
                var tex = new MatTexture();
                tex.SamplerName       = GetSamplerName("_a0");
                tex.FragShaderSampler = "_a0";
                tex.Name      = "Untitled";
                tex.Type      = Toolbox.Library.STGenericMatTexture.TextureType.Unknown;
                tex.WrapModeS = STTextureWrapMode.Repeat;
                tex.WrapModeT = STTextureWrapMode.Repeat;
                tex.WrapModeW = STTextureWrapMode.Clamp;

                if (material.GetResFileU() != null)
                {
                    var texSampler = new ResUGX2.TexSampler();
                    texSampler.BorderType          = ResUGX2.GX2TexBorderType.ClearBlack;
                    texSampler.ClampX              = ResUGX2.GX2TexClamp.Wrap;
                    texSampler.ClampY              = ResUGX2.GX2TexClamp.Wrap;
                    texSampler.ClampZ              = ResUGX2.GX2TexClamp.Clamp;
                    texSampler.DepthCompareEnabled = false;
                    texSampler.DepthCompareFunc    = ResUGX2.GX2CompareFunction.Never;
                    texSampler.MagFilter           = ResUGX2.GX2TexXYFilterType.Point;
                    texSampler.MaxAnisotropicRatio = ResUGX2.GX2TexAnisoRatio.Ratio_1_1;
                    texSampler.MinFilter           = ResUGX2.GX2TexXYFilterType.Point;
                    texSampler.MipFilter           = ResUGX2.GX2TexMipFilterType.Linear;
                    texSampler.ZFilter             = 0;
                    texSampler.MaxLod              = 13;
                    texSampler.MinLod              = 0;
                    texSampler.LodBias             = 0;
                    tex.wiiUSampler = texSampler;
                }
                else
                {
                    var texSampler = new ResNX.Sampler();
                    tex.switchSampler = texSampler;
                }
                material.TextureMaps.Add(tex);

                var item = new ListViewItem();
                item.Text = "Untitled";
                item.SubItems.Add(tex.SamplerName);
                item.SubItems.Add(tex.FragShaderSampler);
                textureRefListView.Items.Add(item);
            }
        }
Ejemplo n.º 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var tex = new MatTexture();

            tex.SamplerName       = GetSamplerName("_a0");
            tex.FragShaderSampler = "_a0";
            tex.Name      = "Untitled";
            tex.Type      = Switch_Toolbox.Library.STGenericMatTexture.TextureType.Unknown;
            tex.wrapModeS = 0;
            tex.wrapModeT = 0;
            tex.wrapModeW = 2;

            if (material.GetResFileU() != null)
            {
                var texSampler = new ResUGX2.TexSampler();
                texSampler.BorderType          = ResUGX2.GX2TexBorderType.ClearBlack;
                texSampler.ClampX              = ResUGX2.GX2TexClamp.Wrap;
                texSampler.ClampY              = ResUGX2.GX2TexClamp.Wrap;
                texSampler.ClampZ              = ResUGX2.GX2TexClamp.Clamp;
                texSampler.DepthCompareEnabled = false;
                texSampler.DepthCompareFunc    = ResUGX2.GX2CompareFunction.Never;
                texSampler.MagFilter           = ResUGX2.GX2TexXYFilterType.Point;
                texSampler.MaxAnisotropicRatio = ResUGX2.GX2TexAnisoRatio.TwoToOne;
                texSampler.MinFilter           = ResUGX2.GX2TexXYFilterType.Point;
                texSampler.MipFilter           = ResUGX2.GX2TexMipFilterType.Linear;
                texSampler.ZFilter             = 0;
                texSampler.MaxLod              = 13;
                texSampler.MinLod              = 0;
                texSampler.LodBias             = 0;
                tex.wiiUSampler = texSampler;
            }
            else
            {
                var texSampler = new ResNX.Sampler();
                tex.switchSampler = texSampler;
            }
            material.TextureMaps.Add(tex);

            var item = new ListViewItem();

            item.Text = "Untitled";
            item.SubItems.Add(tex.SamplerName);
            item.SubItems.Add(tex.FragShaderSampler);
            textureRefListView.Items.Add(item);
        }
Ejemplo n.º 4
0
        public ResUGX2.TexSampler Save(MatTexture matTex)
        {
            var texSampler = new ResUGX2.TexSampler();

            texSampler.BorderType          = BorderType;
            texSampler.ClampX              = ClampX;
            texSampler.ClampY              = ClampY;
            texSampler.ClampZ              = ClampZ;
            texSampler.DepthCompareEnabled = DepthCompareEnabled;
            texSampler.DepthCompareFunc    = DepthCompareFunc;
            texSampler.MinFilter           = MinFilter;
            texSampler.MipFilter           = MipFilter;
            texSampler.ZFilter             = ZFilter;

            texSampler.LodBias = matTex.BiasLod;
            texSampler.MaxLod  = matTex.MaxLod;
            texSampler.MinLod  = matTex.minFilter;

            return(texSampler);
        }