Beispiel #1
0
 /// [setting] テクスチャのブレンドモード設定
 public void SetTexBlendFunc(int idx, TexBlendFunc TexBlendMode)
 {
     if (idx == 0 && idBLENDFUNC00 >= 0)
     {
         this.SetUniformValue(idBLENDFUNC00, (int)TexBlendMode);
     }
     else if (idx == 1 && idBLENDFUNC01 >= 0)
     {
         this.SetUniformValue(idBLENDFUNC01, (int)TexBlendMode);
     }
     else if (idx == 2 && idBLENDFUNC02 >= 0)
     {
         this.SetUniformValue(idBLENDFUNC02, (int)TexBlendMode);
     }
 }
 /// キーとして利用する TexBlendFunc に符号化する
 string toTexBlendFuncCode(TexBlendFunc flg)
 {
     if (flg == TexBlendFunc.kBLEND_REPLACE)
     {
         return("R");
     }
     else if (flg == TexBlendFunc.kBLEND_ADD)
     {
         return("A");
     }
     else if (flg == TexBlendFunc.kBLEND_BLEND)
     {
         return("B");
     }
     else if (flg == TexBlendFunc.kBLEND_DECAL)
     {
         return("D");
     }
     else if (flg == TexBlendFunc.kBLEND_MODULATE)
     {
         return("M");
     }
     return("N");
 }
Beispiel #3
0
 /// [setting] テクスチャのブレンドモード設定
 public void SetTexBlendFunc( int idx, TexBlendFunc TexBlendMode )
 {
     if( idx == 0 && idBLENDFUNC00 >= 0 ){
     this.SetUniformValue( idBLENDFUNC00, (int)TexBlendMode );
     }else if( idx == 1 && idBLENDFUNC01 >= 0 ){
     this.SetUniformValue( idBLENDFUNC01, (int)TexBlendMode );
     }else if( idx == 2 && idBLENDFUNC02 >= 0 ){
     this.SetUniformValue( idBLENDFUNC02, (int)TexBlendMode );
     }
 }
 /// 引数付コンストラクタ
 public BasicShaderName(
                    int MTXPLT_COUNT,
                    bool ENABLE_VERTEX_COLOR,
                    int TEX_COUNT,
                    bool ENABLE_TEXANIM,
                    int LIGHT_COUNT,
                    LightingType LIGHTING_TYPE,
                    NormalMapType NORMALMAP_TYPE,
                    int[] TEXCOORD,
                    TexType[] TEXTYPE,
                    TexBlendFunc[] BLENDFUNC,
                    bool ENABLE_ALPHA_THRESHHOLD
                    )
 {
     this.Set( MTXPLT_COUNT,
           ENABLE_VERTEX_COLOR,
           TEX_COUNT,
           ENABLE_TEXANIM,
           LIGHT_COUNT,
           LIGHTING_TYPE,
           NORMALMAP_TYPE,
           TEXCOORD,
           TEXTYPE,
           BLENDFUNC,
           ENABLE_ALPHA_THRESHHOLD );
 }
 /// キーとして利用する TexBlendFunc に符号化する
 string toTexBlendFuncCode( TexBlendFunc flg )
 {
     if( flg == TexBlendFunc.kBLEND_REPLACE ){
     return "R";
     }else if( flg == TexBlendFunc.kBLEND_ADD ){
     return "A";
     }else if( flg == TexBlendFunc.kBLEND_BLEND ){
     return "B";
     }else if( flg == TexBlendFunc.kBLEND_DECAL ){
     return "D";
     }else if( flg == TexBlendFunc.kBLEND_MODULATE ){
     return "M";
     }
     return "N";
 }
        public void Set(
                    int MTXPLT_COUNT,
                    bool ENABLE_VERTEX_COLOR,
                    int TEX_COUNT,
                    bool ENABLE_TEXANIM,
                    int LIGHT_COUNT,
                    LightingType LIGHTING_TYPE,
                    NormalMapType NORMALMAP_TYPE,
                    int[] TEXCOORD,
                    TexType[] TEXTYPE,
                    TexBlendFunc[] BLENDFUNC,
                    bool ENABLE_ALPHA_THRESHHOLD
                    )
        {
            this.MTXPLT_COUNT        = MTXPLT_COUNT;
            this.ENABLE_VERTEX_COLOR = ENABLE_VERTEX_COLOR;
            this.TEX_COUNT           = TEX_COUNT;
            this.ENABLE_TEXANIM      = ENABLE_TEXANIM;
            this.LIGHT_COUNT         = LIGHT_COUNT;
            this.LIGHTING_TYPE       = LIGHTING_TYPE;

            if( this.LIGHT_COUNT <= 0 ){
            this.LIGHTING_TYPE       = LightingType.kLIGHTING_NONE;
            }
            this.NORMALMAP_TYPE      = NORMALMAP_TYPE;
            for( int i = 0; i < this.TEXCOORD.Length; i++ ){
            if( i < TEX_COUNT ){
                this.TEXCOORD[i]          = TEXCOORD[i];
                this.TEXTYPE[i]           = TEXTYPE[i];
                this.BLENDFUNC[i]         = BLENDFUNC[i];
            }else{
                this.TEXCOORD[i]  = 0;
                this.TEXTYPE[i]   = TexType.kTEXTYPE_NONE;
                this.BLENDFUNC[i] = TexBlendFunc.kBLEND_NONE;
            }
            }
            this.ENABLE_ALPHA_THRESHHOLD = ENABLE_ALPHA_THRESHHOLD;
            makeNames();
        }