示例#1
0
 internal static void IniatializeMMEEffectManager(IDeviceManager deviceManager)
 {
     //エフェクトへの変数登録クラスの登録
     EffectSubscriber = new EffectSubscriberDictionary
     {
         new WorldMatrixSubscriber(),
         new ProjectionMatrixSubscriber(),
         new ViewMatrixSubscriber(),
         new WorldInverseMatrixSubscriber(),
         new WorldTransposeMatrixSubscriber(),
         new WorldInverseTransposeMatrixSubscriber(),
         new ViewInverseMatrixSubscriber(),
         new ViewTransposeMatrixSubscriber(),
         new ViewInverseTransposeMatrixSubsriber(),
         new ProjectionInverseMatrixSubscriber(),
         new ProjectionTransposeMatrixSubscriber(),
         new ProjectionInverseTransposeMatrixSubscriber(),
         new WorldViewMatrixSubscriber(),
         new WorldViewInverseMatrixSubscriber(),
         new WorldViewTransposeMatrixSubscriber(),
         new ViewProjectionMatrixSubscriber(),
         new ViewProjectionInverseMatrixSubscriber(),
         new ViewProjectionTransposeMatrixSubscriber(),
         new ViewProjectionInverseTransposeMatrixSubscriber(),
         new WorldViewProjectionMatrixSubscriber(),
         new WorldViewProjectionInverseMatrixSubscriber(),
         new WorldViewProjectionTransposeMatrixSubscriber(),
         new WorldViewProjectionInverseTransposeMatrixSubscriber(),
         //マテリアル
         new DiffuseVectorSubscriber(),
         new AmbientVectorSubscriber(),
         new SpecularVectorSubscriber(),
         new SpecularPowerSubscriber(),
         new ToonVectorSubscriber(),
         new EdgeVectorSubscriber(),
         new GroundShadowColorVectorSubscriber(),
         new MaterialTextureSubscriber(),
         new MaterialSphereMapSubscriber(),
         new MaterialToonTextureSubscriber(),
         new AddingTextureSubscriber(),
         new MultiplyingTextureSubscriber(),
         new AddingSphereTextureSubscriber(),
         new MultiplyingSphereTextureSubscriber(),
         new EdgeThicknessSubscriber(),
         //位置/方向
         new PositionSubscriber(),
         new DirectionSubscriber(),
         //時間
         new TimeSubScriber(),
         new ElapsedTimeSubScriber(),
         //マウス
         new MousePositionSubscriber(),
         new LeftMouseDownSubscriber(),
         new MiddleMouseDownSubscriber(),
         new RightMouseDownSubscriber(),
         //スクリーン情報
         new ViewPortPixelSizeScriber(),
         //定数バッファ
         new BasicMaterialConstantSubscriber(),
         new FullMaterialConstantSubscriber(),
         //コントロールオブジェクト
         new ControlObjectSubscriber(),
         new RenderColorTargetSubscriber(),
         new RenderDepthStencilTargetSubscriber(),
     };
     PeculiarEffectSubscriber = new PeculiarEffectSubscriberDictionary
     {
         new OpAddSubscriber(),
         new ParthfSubscriber(),
         new SpAddSubscriber(),
         new SubsetCountSubscriber(),
         new TranspSubscriber(),
         new Use_SpheremapSubscriber(),
         new Use_TextureSubscriber(),
         new Use_ToonSubscriber(),
         new VertexCountSubscriber()
     };
     //エフェクトのコンパイル用マクロの初期化
     EffectMacros = new List <ShaderMacro>();
     EffectMacros.Add(new ShaderMacro(MMFDefinition));         //定数MMFを定義
     EffectMacros.Add(new ShaderMacro(ApplicationDefinition)); //アプリケーションの定数を定義
     EffectMacros.Add(new ShaderMacro("MMM_LightCount", "3"));
     if (deviceManager.DeviceFeatureLevel == FeatureLevel.Level_11_0)
     {
         EffectMacros.Add(new ShaderMacro("DX_LEVEL_11_0"));
     }
     else
     {
         EffectMacros.Add(new ShaderMacro("DX_LEVEL_10_1"));
     }
     EffectInclude = new BasicEffectIncluder();
 }
示例#2
0
 internal static void IniatializeMMEEffectManager(IDeviceManager deviceManager)
 {
     //Effects of variable registration class registration
     EffectSubscriber = new EffectSubscriberDictionary
     {
         new WorldMatrixSubscriber(),
         new ProjectionMatrixSubscriber(),
         new ViewMatrixSubscriber(),
         new WorldInverseMatrixSubscriber(),
         new WorldTransposeMatrixSubscriber(),
         new WorldInverseTransposeMatrixSubscriber(),
         new ViewInverseMatrixSubscriber(),
         new ViewTransposeMatrixSubscriber(),
         new ViewInverseTransposeMatrixSubsriber(),
         new ProjectionInverseMatrixSubscriber(),
         new ProjectionTransposeMatrixSubscriber(),
         new ProjectionInverseTransposeMatrixSubscriber(),
         new WorldViewMatrixSubscriber(),
         new WorldViewInverseMatrixSubscriber(),
         new WorldViewTransposeMatrixSubscriber(),
         new ViewProjectionMatrixSubscriber(),
         new ViewProjectionInverseMatrixSubscriber(),
         new ViewProjectionTransposeMatrixSubscriber(),
         new ViewProjectionInverseTransposeMatrixSubscriber(),
         new WorldViewProjectionMatrixSubscriber(),
         new WorldViewProjectionInverseMatrixSubscriber(),
         new WorldViewProjectionTransposeMatrixSubscriber(),
         new WorldViewProjectionInverseTransposeMatrixSubscriber(),
         //Material
         new DiffuseVectorSubscriber(),
         new AmbientVectorSubscriber(),
         new SpecularVectorSubscriber(),
         new SpecularPowerSubscriber(),
         new ToonVectorSubscriber(),
         new EdgeVectorSubscriber(),
         new GroundShadowColorVectorSubscriber(),
         new MaterialTextureSubscriber(),
         new MaterialSphereMapSubscriber(),
         new MaterialToonTextureSubscriber(),
         new AddingTextureSubscriber(),
         new MultiplyingTextureSubscriber(),
         new AddingSphereTextureSubscriber(),
         new MultiplyingSphereTextureSubscriber(),
         new EdgeThicknessSubscriber(),
         //Position/方向
         new PositionSubscriber(),
         new DirectionSubscriber(),
         //Time
         new TimeSubScriber(),
         new ElapsedTimeSubScriber(),
         //Mouse
         new MousePositionSubscriber(),
         new LeftMouseDownSubscriber(),
         new MiddleMouseDownSubscriber(),
         new RightMouseDownSubscriber(),
         //Screen information
         new ViewPortPixelSizeScriber(),
         //Constant buffer
         new BasicMaterialConstantSubscriber(),
         new FullMaterialConstantSubscriber(),
         //Control object
         new ControlObjectSubscriber(),
         new RenderColorTargetSubscriber(),
         new RenderDepthStencilTargetSubscriber(),
     };
     PeculiarEffectSubscriber = new PeculiarEffectSubscriberDictionary
     {
         new OpAddSubscriber(),
         new ParthfSubscriber(),
         new SpAddSubscriber(),
         new SubsetCountSubscriber(),
         new TranspSubscriber(),
         new Use_SpheremapSubscriber(),
         new Use_TextureSubscriber(),
         new Use_ToonSubscriber(),
         new VertexCountSubscriber()
     };
     //Initialize the effect compile-time macros
     EffectMacros = new List <ShaderMacro>();
     EffectMacros.Add(new ShaderMacro(MMFDefinition));         //Define constant MMF
     EffectMacros.Add(new ShaderMacro(ApplicationDefinition)); //Application of constant definition
     EffectMacros.Add(new ShaderMacro("MMM_LightCount", "3"));
     if (deviceManager.DeviceFeatureLevel == FeatureLevel.Level_11_0)
     {
         EffectMacros.Add(new ShaderMacro("DX_LEVEL_11_0"));
     }
     else
     {
         EffectMacros.Add(new ShaderMacro("DX_LEVEL_10_1"));
     }
     EffectInclude = new BasicEffectIncluder();
 }