Beauty Salon α-BET (alphabet)

space001
Blender3d Collada dae modeling Use Papervision3d on Progression3 and 4 http://a-bet.secret.jp/#/access
more whaison works.
whaison space
space002
http://whaison.jugem.jp/ https://jp.pinterest.com/whaison/ https://www.instagram.com/whaison/ https://whaison.amebaownd.com/
https://suzuri.jp/whaison
http://whaison.blogspot.com/
http://whaison.tumblr.com/ http://qiita.com/users/whaison http://www.behance.net/whaison https://github.com/whaison/ https://bitbucket.org/whaison http://serato.com/user/whaison http://whaison.hatenablog.jp/

typo memo
http://d.hatena.ne.jp/whaison/


dayNote
http://www.myspace.com/whaison http://ameblo.jp/whaison/ http://blog.crooz.jp/whaison/ http://blog.crooz.jp/whaisoncafe/ http://nenpyo.org/whaison

fulldisk
http://full.shin-gen.jp/
http://whaison.client.jp/
http://www.dclog.jp/whaison/
featured forums.
space004
forum.unity3d.com/

forums.unrealengine.com.

Progression Forum.

FlashDevelop Forum.

Papervision3D Forum.

FlexUserGroup Forum.

SparkProjectForum.





Twitter







Mobile
qrcode
Calendar
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      
<< March 2024 >>
New Entries
Archives
Categories
Recent comment
  • FlashDevelopでフォント埋め込み
    感謝!! (12/24)
  • cocos2d-x-3.0rc0 ,c++ ,cpp でTexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例
    whaison (04/17)
  • Blender2.67にbvh(web上に2500個以上ころがってる)入れてそのBoneオブジェクトをUnity4.0のmecanimで使う
    whaison (08/19)
  • Apple Dev Center 「Certificates, Identifiers & Profiles」で Adhoc をつくってXCode4.6.1でArchiveしてipaを書き出し
    whaison (04/30)
  • Flash CS6でプロパティーパネルで物理演算のジャンプの高さを設定できるCitrus Engine
    whaison (03/01)
  • 「Flash以外、例えばKinectとか」ON TOKYO (会場:高田馬場4-11-8 Floor 6階 ) 短縮URL http://bit.ly/dI0Bfx
    uka (03/02)
  • App Store Review Guidelines アップル社のアプリ審査基準ガイドライン和訳 Apple が 開発者を悩ませ ユーザーをハッピーにしたいガイドライン。w
    whaison (01/25)
  • Unity3d では ADOBE JAPAN OSAKIで行われたFITC 2010 TOKYOでは、 「iOS用にパブリッシュするためには、フリー版ではなくて、有料版を買ってください。さらに追加のパッケージである、"iOS Package (for Development)"を買ってください」とのことだった。
    whaison (01/25)
  • enjoy Adidas-Futsal-Park
    whaison (01/16)
  • MacBookAir にFlashPlayer入れたらなった。Mac Flash Player 10.1/10.2でUstream などでカメラが認識されないバグそんなときはUstreamProducer!でもなくiPhoneだと直ぐにライブ配信できた
    whaison (01/14)
simple sintax high lighter2.0
space003
SyntaxHighlighter2.0用 の貼り付けコード作成する!
ブログパーツ-BLOG PARTS.
Profile
Links
Recommend
Sponsored Links
Admin
無料ブログ作成サービス JUGEM
Seach this site
            
2022.03.28 Monday
スポンサーサイト

一定期間更新がないため広告を表示しています

| スポンサードリンク | - | | - | - | pookmark |
            
2015.07.08 Wednesday
メタセコイア4.4で4枚の板ポリにマテリアルを張って合成したFBXをUnity5.0.2にインポートした際に表示上の重なり順が逆転してしまう件に関して
メタセコイア4.4で4枚の板ポリにマテリアルを張って合成したFBXをUnity5.0.2にインポートした際に表示上の重なり順が逆転してしまう件に関して

困っています。

FBX Review ではうまく表示されているようです。

Unity5.0.2f
では
左が合成したもの 表示順がおかしいです。
右が合成してないものです。表示順が正常です。


合成して使わないとバッチ数が減らなくて付加がかかってしまうため合成しようとしています。
今回はMetasequoia4.4で合成しましたがうまくいきませんでした。

小林 信行 先生いわく

トランスペアレンシー系シェーダーとZソートでのエラーの典型例ですね。


この現象を起こさないためには、オブジェクトを合成しないか、以下のページを参考に独自のシェーダーを描く必要があります。


http://tips.hecomi.com/entry/2014/03/07/005743
http://unityshader.hatenablog.com/entry/2013/12/30/040056

正直言いましてトランスペアレンシー系のシェーダーの重ね描きは、3D系のエンジンでは元々重い処理ですので、バッチ数は気にせずに、扱いやすい方法でやったほうがいいと思います。

ということで
シェーダーを
デフォルトの中のUnit/Transparent Cutoutのシェーダーに変更したらうまく表示されました!!!




Unit/Transparent Cutoutだとちょっとジャギーがきたない
こんなのがありました!
http://docs.unity3d.com/Manual/SL-AlphaTest.html
Vegetation.shader
 

sorce.

Shader "Vegetation" {
    Properties {
        _Color ("Main Color", Color) = (.5, .5, .5, .5)
        _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
        _Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5
    }
    SubShader {
        // Set up basic lighting
        Material {
            Diffuse [_Color]
            Ambient [_Color]
        }
        Lighting On

        // Render both front and back facing polygons.
        Cull Off

        // first pass:
        // render any pixels that are more than [_Cutoff] opaque
        Pass {
            AlphaTest Greater [_Cutoff]
            SetTexture [_MainTex] {
                combine texture * primary, texture
            }
        }

        // Second pass:
        // render in the semitransparent details.
        Pass {
            // Dont write to the depth buffer
            ZWrite off
            // Don't write pixels we have already written.
            ZTest Less
            // Only render pixels less or equal to the value
            AlphaTest LEqual [_Cutoff]

            // Set up alpha blending
            Blend SrcAlpha OneMinusSrcAlpha

            SetTexture [_MainTex] {
                combine texture * primary, texture
            }
        }
    }
}

Note 


おしまい
上だと2回書いてしまうので

やっぱりUnlit/Transparent Cutoutに戻しました。
デフォルトのシェーダーのソースはこちら。
http://japan.unity3d.com/unity/download/archive
Unlit-AlphaTest.shader
 

sorce.

// Unlit alpha-cutout shader.
// - no lighting
// - no lightmap support
// - no per-material color

Shader "Unlit/Transparent Cutout" {
Properties {
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
    Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
    LOD 100

    Lighting Off

    Pass {  
        CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma multi_compile_fog
            
            #include "UnityCG.cginc"

            struct appdata_t {
                float4 vertex : POSITION;
                float2 texcoord : TEXCOORD0;
            };

            struct v2f {
                float4 vertex : SV_POSITION;
                half2 texcoord : TEXCOORD0;
                UNITY_FOG_COORDS(1)
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;
            fixed _Cutoff;

            v2f vert (appdata_t v)
            {
                v2f o;
                o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
                o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
                UNITY_TRANSFER_FOG(o,o.vertex);
                return o;
            }
            
            fixed4 frag (v2f i) : SV_Target
            {
                fixed4 col = tex2D(_MainTex, i.texcoord);
                clip(col.a - _Cutoff);
                UNITY_APPLY_FOG(i.fogCoord, col);
                return col;
            }
        ENDCG
    }
}

}

Note 

Directional light とかライトををつけていたが 重かったので 消した
暗かったので発光させた。

Shader "Unlit/Transparent VegetationGradation" {
    Properties {
        _Color ("Main Color"Color) = (.5, .5, .5, .5)
        _MainTex ("Base (RGB) Alpha (A)"2D) = "white" {}
        _Cutoff ("Base Alpha cutoff"Range (0,.9)) = .7
    }
    SubShader {
        // Set up basic lighting
        Material {
            Diffuse [_Color]
            Ambient [_Color]
            Emission[_Color]
        }
        Lighting On

        // Render both front and back facing polygons.
        Cull Off

        // first pass:
        // render any pixels that are more than [_Cutoff] opaque
        Pass {
            AlphaTest Greater [_Cutoff]
            SetTexture [_MainTex] {
                combine texture * primary, texture
            }
        }

        // Second pass:
        // render in the semitransparent details.
        Pass {
            // Dont write to the depth buffer
            ZWrite off
            // Don't write pixels we have already written.
            ZTest Less
            // Only render pixels less or equal to the value
            AlphaTest LEqual [_Cutoff]

            // Set up alpha blending
            Blend SrcAlpha OneMinusSrcAlpha

            SetTexture [_MainTex] {
                combine texture * primary, texture
            }
        }
    }
}


。。
さらにライトの設定を完全に消したら
Shader "Unlit/Transparent VegetationGradation" {
    Properties {
        _Color ("Main Color"Color) = (.5, .5, .5, .5)
        _MainTex ("Base (RGB) Alpha (A)"2D) = "white" {}
        _Cutoff ("Base Alpha cutoff"Range (0,.9)) = .7
    }
    SubShader {
        // Set up basic lighting
        //Material {
        //    Diffuse [_Color]
        //    Ambient [_Color]
        //    Emission[_Color]    
        //}
        Lighting Off
        //Lighting Off

        // Render both front and back facing polygons.
        Cull Off

        // first pass:
        // render any pixels that are more than [_Cutoff] opaque
        Pass {
            AlphaTest Greater [_Cutoff]
            SetTexture [_MainTex] {
                //combine texture * primary, texture
                combine texturetexture
            }
        }

        // Second pass:
        // render in the semitransparent details.
        Pass {
            // Dont write to the depth buffer
            ZWrite off
            // Don't write pixels we have already written.
            ZTest Less
            // Only render pixels less or equal to the value
            AlphaTest LEqual [_Cutoff]

            // Set up alpha blending
            Blend SrcAlpha OneMinusSrcAlpha

            SetTexture [_MainTex] {
                //combine texture * primary, texture
                combine texturetexture
            }
        }
    }
}


.......
| whaison | Metasequoia | 15:30 | comments(0) | - | pookmark |
            
2015.05.20 Wednesday
Metasequoia4.4.3 から Maya2015へのOBJエクスポートの設定
Metasequoia4.4.3 から Maya2015へのOBJエクスポートの設定
UVマッピング
V方向を反転にチェックをいれる
| whaison | Metasequoia | 12:53 | comments(0) | - | pookmark |