/// ****************************************************************************
/// @file   
/// @author Dr.Neeton
/// @date   200X/X/X - 2014/04/05
/// 
/// @brief  シェーダー共通フラグメント（基底ヘッダー）
/// 
/// ****************************************************************************

#include "CPL_DX_Shader_CSF_Base.h"


namespace CPL {
namespace DX {
namespace Shader {
/// @brief
/// CommonShaderFragment
namespace CSF {
  
// global parameter name
CodeStrings::css16 KW_G_Material        ::kw_g_material         ("g_material");
CodeStrings::css16 KW_G_Texture         ::kw_g_texture          ("g_texture");
CodeStrings::css16 KW_G_Sampler         ::kw_g_sampler          ("g_sampler");
CodeStrings::css16 KW_G_PixelColor      ::kw_g_pixel_color      ("g_pixel_color");
CodeStrings::css16 KW_G_AmbientLight    ::kw_g_ambient_light    ("g_ambient_light");
CodeStrings::css32 KW_G_DirectionalLight::kw_g_directional_light("g_directional_light");
CodeStrings::css16 KW_G_PointLight      ::kw_g_point_light      ("g_point_light");
CodeStrings::css16 KW_G_SpotLight       ::kw_g_spot_light       ("g_spot_light");
CodeStrings::css16 KW_G_EyePosition     ::kw_g_eye_position     ("g_eye_position");
CodeStrings::css16 KW_G_Matrix          ::kw_g_matrix           ("g_matrix");
CodeStrings::css16 KW_G_MtxViewProj     ::kw_g_mtx_view_proj    ("g_mtx_view_proj");
CodeStrings::css16 KW_G_MtxProj         ::kw_g_mtx_proj         ("g_mtx_proj");
CodeStrings::css16 KW_G_MtxView         ::kw_g_mtx_view         ("g_mtx_view");
CodeStrings::css16 KW_G_MtxWorld        ::kw_g_mtx_world        ("g_mtx_world");
CodeStrings::css16 KW_G_MtxBillboard    ::kw_g_mtx_billboard    ("g_mtx_billboard");

// input parameter name
CodeStrings::css16 KW_InPosition   ::kw_in_position   ("in_position");
CodeStrings::css16 KW_InPositionT  ::kw_in_positiont  ("in_positiont");
CodeStrings::css16 KW_InBWeight    ::kw_in_bweight    ("in_bweight");
CodeStrings::css16 KW_InBIndex     ::kw_in_bindex     ("in_bindex");
CodeStrings::css16 KW_InNormal     ::kw_in_normal     ("in_normal");
CodeStrings::css16 KW_InPSize      ::kw_in_psize      ("in_psize");
CodeStrings::css16 KW_InColor      ::kw_in_color      ("in_color");
CodeStrings::css16 KW_InTexCoord   ::kw_in_texcoord   ("in_texcoord");
CodeStrings::css16 KW_InTangent    ::kw_in_tangent    ("in_tangent");
CodeStrings::css16 KW_InBiNormal   ::kw_in_binormal   ("in_binormal");
CodeStrings::css16 KW_InSV_Position::kw_in_svposition ("in_svposition");
CodeStrings::css16 KW_InVFace      ::kw_in_vface      ("in_vface");
//CodeStrings::css16 KW_InTarget    ::kw_in_target     ("in_target");

// output parameter name
CodeStrings::css16 KW_OutPosition  ::kw_out_position   ("out_position");
CodeStrings::css16 KW_OutPSize     ::kw_out_psize      ("out_psize");
CodeStrings::css16 KW_OutFog       ::kw_out_fog        ("out_fog");
CodeStrings::css16 KW_OutColor     ::kw_out_color      ("out_color");
CodeStrings::css16 KW_OutTexCoord  ::kw_out_texcoord   ("out_texcoord");
CodeStrings::css16 KW_OutTessFactor::kw_out_tess_factor("out_tess_factor");
CodeStrings::css16 KW_OutTarget    ::kw_out_target     ("out_target");
CodeStrings::css16 KW_OutDepth     ::kw_out_depth      ("out_depth");

// local parameter name
CodeStrings::css16 KW_L_Position::kw_l_position("l_position");
CodeStrings::css16 KW_L_Normal  ::kw_l_normal  ("l_normal");
CodeStrings::css16 KW_L_Matrix  ::kw_l_matrix  ("l_matrix");
CodeStrings::css16 KW_L_Color   ::kw_l_color   ("l_color");

// other parameter name
CodeStrings::css16 KW_Diffuse ::kw_diffuse ("diffuse");
CodeStrings::css16 KW_Specular::kw_specular("specular");
CodeStrings::css16 KW_Emissive::kw_emissive("emissive");
CodeStrings::css16 KW_Position::kw_position("position");
CodeStrings::css16 KW_Normal  ::kw_normal  ("normal");
CodeStrings::css16 KW_Power   ::kw_power   ("power");
CodeStrings::css16 KW_Theta   ::kw_theta   ("theta");
CodeStrings::css16 KW_Phi     ::kw_phi     ("phi");




/// @cond
namespace zzz_ {
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  // ライトオブジェクト用基底クラス　カラーモード判定
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  int BaseLight::CheckColorMode( CIV_Global const& in_global_param ) const
  {
    auto sp_g_material =
      in_global_param.FindItem<CIVariable>(
        CPName( CSF::KW_G_Material::kw_g_material ) );

    if( sp_g_material )
    {
      return true;
    }
    else
    {
      return false;
    }
  }

} // namespace zzz_
/// @endcond






} // namespace CSF
} // namespace Shader
} // namespace DX
} // namespace CPL

