static const int MAX_BONES = 16; float4x4 World : WORLD; float4x4 ViewProj : VIEWPROJ; float4x4 SkinWorldViewProj : SKINWORLDVIEWPROJ; float4x4 SkinWorld : SKINWORLD; float4x4 WorldViewProj : WORLDVIEWPROJ; float4x4 InvView : INVVIEW; float4x3 Bone[ MAX_BONES ] : BONEMATRIX3; float4 OutLineSize : GLOBAL; float4 Mat_Diffuse : MATERIALDIFFUSE; float4 Mat_Specular : MATERIALSPECULAR; float Shineness : MATERIALPOWER; float LightCount : GLOBAL; float4x4 LastWorld : GLOBAL; float4 BlurEffect : GLOBAL; float3 g_fAddColor : GLOBAL; float3 g_fAddLight : GLOBAL; float g_OutLineWidth : GLOBAL; #include texture BaseMap< string NTM = "base"; int NTMIndex = 0; >; sampler BaseSampler = sampler_state { Texture = < BaseMap >; ADDRESSU = CLAMP; ADDRESSV = CLAMP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; }; //========================================================================================== // // 아웃라인 - 노말값으로 확장해서 뒤집어서 랜더링 // //========================================================================================== struct vsIn_OutLine { float4 Pos : POSITION; float4 BlendWeights : BLENDWEIGHT; float4 BlendIndices : BLENDINDICES; float3 Normal : NORMAL; }; float4 vs_CharOutLine( vsIn_OutLine In ) : POSITION { int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; return mul( float4( normalize( mul( In.Normal, BoneTransform ) )*OutLineSize.x + mul( In.Pos, BoneTransform ) , 1 ), SkinWorldViewProj ); } float4 ps_CharOutLine() : COLOR { return float4( 0.05f, 0.05f, 0.05f, OutLineSize.y ); } float4 vs_OutLine( float4 Pos : POSITION, float3 Normal : NORMAL ) : POSITION { return normalize( mul( Normal, WorldViewProj ) )*OutLineSize.x*1.5f + mul( Pos, WorldViewProj ); } //========================================================================================== // // 일반 랜더링 - 구조체 // //========================================================================================== struct vsIn_Normal { float4 Pos : POSITION; float4 BlendWeights : BLENDWEIGHT; float4 BlendIndices : BLENDINDICES; float2 TexCoords : TEXCOORD0; float3 Normal : NORMAL; }; struct vsOut_Normal { float4 Pos : POSITION; float2 TexCoords : TEXCOORD0; float4 Color : TEXCOORD1; }; struct vsOut_Normal_Spec { float4 Pos : POSITION; float2 TexCoords : TEXCOORD0; float4 Color : TEXCOORD1; float3 Normal : TEXCOORD2; float3 EyePos : TEXCOORD3; }; struct vsIn_Normal_NoAni { float4 Pos : POSITION; float2 TexCoords : TEXCOORD0; float3 Normal : NORMAL; }; //========================================================================================== // // 일반 랜더링 // //========================================================================================== vsOut_Normal vs_CharNormal( vsIn_Normal In ) { vsOut_Normal Out = (vsOut_Normal)0; int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; float4 pos = float4( mul( In.Pos, BoneTransform ), 1 ); float3 WorldNormal = normalize( mul( In.Normal, BoneTransform ) ); Out.Pos = mul( pos, SkinWorldViewProj ); Out.TexCoords = In.TexCoords; if( LightCount == 2 ) Out.Color = CalLight_D2P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, DirL2_Dir, DirL2_Dif, DirL2_Amb, WorldNormal ); else Out.Color = CalLight_D1P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, normalize( mul(In.Normal,World) ) ); return Out; } vsOut_Normal vs_CharNormal_Color( vsIn_Normal In ) { vsOut_Normal Out = (vsOut_Normal)0; int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; float4 pos = float4( mul( In.Pos, BoneTransform ), 1 ); float3 WorldNormal = normalize( mul( In.Normal, BoneTransform ) ); Out.Pos = mul( pos, SkinWorldViewProj ); Out.TexCoords = In.TexCoords; if( LightCount == 2 ) Out.Color = CalLight_D2P0( DirL1_Dir, DirL1_Dif , DirL1_Amb* (1 + g_fAddLight) , DirL2_Dir, DirL2_Dif, DirL2_Amb , WorldNormal ); else Out.Color = CalLight_D1P0( DirL1_Dir, DirL1_Dif , DirL1_Amb* (1 + g_fAddLight) , normalize( mul(In.Normal,World) ) ); return Out; } vsOut_Normal vs_Normal( vsIn_Normal_NoAni In ) { vsOut_Normal Out = (vsOut_Normal)0; Out.Pos = mul( In.Pos, WorldViewProj ); Out.TexCoords = In.TexCoords; if( LightCount == 2 ) Out.Color = CalLight_D2P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, DirL2_Dir, DirL2_Dif, DirL2_Amb, normalize( mul(In.Normal,World) ) ); else Out.Color = CalLight_D1P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, normalize( mul(In.Normal,World) ) ); return Out; } vsOut_Normal_Spec vs_CharNormal_Spec( vsIn_Normal In ) { vsOut_Normal_Spec Out = (vsOut_Normal_Spec)0; int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; float4 pos = float4( mul( In.Pos, BoneTransform ), 1 ); float3 WorldNormal = normalize( mul( In.Normal, BoneTransform ) ); Out.Pos = mul( pos, SkinWorldViewProj ); Out.TexCoords = In.TexCoords; Out.Normal = WorldNormal; Out.EyePos = normalize( InvView[3] - mul( pos, SkinWorld ) ); if( LightCount == 2 ) Out.Color = CalLight_D2P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, DirL2_Dir, DirL2_Dif, DirL2_Amb, WorldNormal ); else Out.Color = CalLight_D1P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, normalize( mul(In.Normal,World) ) ); return Out; } vsOut_Normal_Spec vs_Normal_Spec( vsIn_Normal_NoAni In ) { vsOut_Normal_Spec Out = (vsOut_Normal_Spec)0; float3 WorldNormal = normalize( mul(In.Normal,World) ); Out.Pos = mul( In.Pos, WorldViewProj ); Out.TexCoords = In.TexCoords; Out.Normal = WorldNormal; Out.EyePos = normalize( InvView[3] - mul( In.Pos, World ) ); if( LightCount == 2 ) Out.Color = CalLight_D2P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, DirL2_Dir, DirL2_Dif, DirL2_Amb, WorldNormal ); else Out.Color = CalLight_D1P0( DirL1_Dir, DirL1_Dif, DirL1_Amb, normalize( mul(In.Normal,World) ) ); return Out; } //========================================================================================== // // 일반 랜더링 - 픽셀 쉐이더 // //========================================================================================== float4 ps_Default( vsOut_Normal In ) : COLOR { return tex2D( BaseSampler, In.TexCoords )*In.Color; } float4 ps_CharNormal( vsOut_Normal In ) : COLOR { return float4( ( tex2D( BaseSampler, In.TexCoords )*In.Color ).xyz, OutLineSize.y ); } //---------------------------------------------------// // Character SEffect_Color //---------------------------------------------------// float4 ps_CharNormal_Color( vsOut_Normal In ) : COLOR { In.Color.xyz += g_fAddColor.xyz; return float4( ( tex2D( BaseSampler, In.TexCoords )*In.Color ).xyz, OutLineSize.y ); } //---------------------------------------------------// // Character SEffect_Gray //---------------------------------------------------// float4 ps_CharNormal_Gray( vsOut_Normal In ) : COLOR { float4 color = tex2D( BaseSampler, In.TexCoords )*In.Color;; float fGray = (color.r + color.g + color.b)/3.f; color.rgb = fGray; return color; } float4 ps_CharNormal_TexAlpha( vsOut_Normal In ) : COLOR { float4 tex = ( tex2D( BaseSampler, In.TexCoords )*In.Color ); return float4( (tex*In.Color).rgb, tex.a*Mat_Diffuse.a ); } float4 ps_CharNormal_Spec( vsOut_Normal_Spec In ) : COLOR { float3 color = ( tex2D( BaseSampler, In.TexCoords )*In.Color ).xyz; float3 H = normalize( In.EyePos - DirL1_Dir ); float3 SpecLight = pow( max( 0, dot( In.Normal, H ) ), Shineness )*Mat_Specular*DirL1_Spec; color += SpecLight; return float4( color, OutLineSize.y ); } float4 ps_CharNormal_TexAlpha_Spec( vsOut_Normal_Spec In ) : COLOR { float4 tex = ( tex2D( BaseSampler, In.TexCoords )*In.Color ); float3 color = (tex*In.Color).rgb; float3 H = normalize( In.EyePos - DirL1_Dir ); float3 SpecLight = pow( max( 0, dot( In.Normal, H ) ), Shineness )*Mat_Specular*DirL1_Spec; color += SpecLight; return float4( color, tex.a*Mat_Diffuse.a ); } //---------------------------------------------------// // Character SEffect_Spec_Color //---------------------------------------------------// float4 ps_CharNormal_Spec_Color( vsOut_Normal_Spec In ) : COLOR { float3 color = ( tex2D( BaseSampler, In.TexCoords )*In.Color ).xyz; float3 H = normalize( In.EyePos - DirL1_Dir ); float3 SpecLight = pow( max( 0, dot( In.Normal, H ) ), Shineness )*Mat_Specular*DirL1_Spec; color += SpecLight ; color += g_fAddColor; return float4( color, OutLineSize.y ); } //---------------------------------------------------// // Character SEffect_Spec_Gray //---------------------------------------------------// float4 ps_CharNormal_Spec_Gray( vsOut_Normal_Spec In ) : COLOR { float3 color = ( tex2D( BaseSampler, In.TexCoords )*In.Color ).xyz; float3 H = normalize( In.EyePos - DirL1_Dir ); float3 SpecLight = pow( max( 0, dot( In.Normal, H ) ), Shineness )*Mat_Specular*DirL1_Spec; color += SpecLight; color.xyz = (color.x + color.y + color.z)/3.f; return float4( color, OutLineSize.y ); } //========================================================================================== // // 마우스온 블러 // //========================================================================================== float4 BlurColor : GLOBAL; float4 vs_CharOutLine_Blur( vsIn_OutLine In ) : POSITION { int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; return mul( float4( normalize( mul( In.Normal, BoneTransform ) )*OutLineSize.x*2.5f + mul( In.Pos, BoneTransform ) , 1 ), SkinWorldViewProj ); } float4 ps_CharOutLine_Blur() : COLOR { return BlurColor; } float4 vs_OutLine_Blur( float4 Pos : POSITION, float3 Normal : NORMAL ) : POSITION { return mul( float4( Normal*OutLineSize.x*2.5f, 0 ) + Pos, WorldViewProj ); } //---------------------------------------------------// // Character SEffect_OutLine //---------------------------------------------------// float4 vs_CharOutLine_Blur_Eff( vsIn_OutLine In ) : POSITION { int4 indices = D3DCOLORtoUBYTE4(In.BlendIndices); float4x3 BoneTransform; BoneTransform = In.BlendWeights[0] * Bone[indices[0]]; BoneTransform += In.BlendWeights[1] * Bone[indices[1]]; BoneTransform += In.BlendWeights[2] * Bone[indices[2]]; BoneTransform += (1.0f - In.BlendWeights[0] - In.BlendWeights[1] - In.BlendWeights[2]) * Bone[indices[3]]; return mul( float4( normalize( mul( In.Normal, BoneTransform ) )*OutLineSize.x*(2.5f +g_OutLineWidth) + mul( In.Pos, BoneTransform ) , 1 ), SkinWorldViewProj ); } technique Char_OutLine_Blur < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { AlphaBlendEnable = true; AlphaTestEnable = false; ZEnable = true; ZWriteEnable = true; SrcBlend = SrcAlpha; DestBlend = One; VertexShader = compile vs_2_0 vs_CharOutLine_Blur(); PixelShader = compile ps_2_0 ps_CharOutLine_Blur(); CullMode = CCW; } } technique OutLine_Blur < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { AlphaBlendEnable = true; AlphaTestEnable = false; ZEnable = true; ZWriteEnable = true; SrcBlend = SrcAlpha; DestBlend = One; VertexShader = compile vs_2_0 vs_OutLine_Blur(); PixelShader = compile ps_2_0 ps_CharOutLine_Blur(); CullMode = CCW; } } //---------------------------------------------------// // Tec_Character SEffect_OutLine //---------------------------------------------------// technique Char_OutLine_Blur_Eff < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { AlphaBlendEnable = true; AlphaTestEnable = false; ZEnable = true; ZWriteEnable = true; SrcBlend = SrcAlpha; DestBlend = One; VertexShader = compile vs_2_0 vs_CharOutLine_Blur_Eff(); PixelShader = compile ps_2_0 ps_CharOutLine_Blur(); CullMode = CCW; } } //========================================================================================== // // 테크니큐 - 아웃라인 카툰쉐이딩 // //========================================================================================== technique Char_OutLine_Normal < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Color_OutLine //---------------------------------------------------// technique Char_OutLine_Normal_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal_Color(); PixelShader = compile ps_2_0 ps_CharNormal_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Gray_OutLine //---------------------------------------------------// technique Char_OutLine_Normal_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique OutLine_Normal < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // CharObject Tec_Color_OutLine //---------------------------------------------------// technique OutLine_Normal_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // CharObject Tec_Gray_OutLine //---------------------------------------------------// technique OutLine_Normal_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique Char_OutLine_Normal_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Spec_Color_OutLine //---------------------------------------------------// technique Char_OutLine_Normal_Spec_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Spec_Gray_OutLine //---------------------------------------------------// technique Char_OutLine_Normal_Spec_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique OutLine_Normal_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_Normal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //========================================================================================== // // 테크니큐 - 노 아웃라인 카툰쉐이딩 // //========================================================================================== technique Char_NoOutLine_Normal < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Color_NoOutLine //---------------------------------------------------// technique Char_NoOutLine_Normal_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal_Color(); PixelShader = compile ps_2_0 ps_CharNormal_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Gray_NoOutLine //---------------------------------------------------// technique Char_NoOutLine_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique Char_NoOutLine_Normal_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique NoOutLine_Normal < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique NoOutLine_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // CharObject Tec_Color_NoOutLine //---------------------------------------------------// technique NoOutLine_Normal_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // CharObject Tec_Gray_NoOutLine //---------------------------------------------------// technique NoOutLine_Normal_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique Char_NoOutLine_Normal_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Spec_Color_NoOutLine //---------------------------------------------------// technique Char_NoOutLine_Normal_Spec_Color < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec_Color(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //---------------------------------------------------// // Character Tec_Spec_Gray_NoOutLine //---------------------------------------------------// technique Char_NoOutLine_Normal_Spec_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique NoOutLine_Normal_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_Spec(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //========================================================================================== // // 그레이 쉐이딩 // //========================================================================================== float4 ps_Gray( vsOut_Normal In ) : COLOR { float4 color = tex2D( BaseSampler, In.TexCoords )*In.Color; float r = ( color.r+color.g+color.b )*0.2f; return float4( r, r, r, OutLineSize.y ); } technique Char_OutLine_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharOutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique OutLine_Gray < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P1 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_Gray(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //========================================================================================== // // 알파 텍스쳐에서 가져 오는 쉐이더 // //========================================================================================== technique Char_NoOutLine_Normal_AT < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal(); PixelShader = compile ps_2_0 ps_CharNormal_TexAlpha(); } } technique NoOutLine_Normal_AT < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal_TexAlpha(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } technique Char_NoOutLine_Normal_AT_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; int BonesPerPartition = MAX_BONES; > { pass P0 { VertexShader = compile vs_2_0 vs_CharNormal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_TexAlpha_Spec(); } } technique NoOutLine_Normal_AT_Spec < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 vs_Normal_Spec(); PixelShader = compile ps_2_0 ps_CharNormal_TexAlpha_Spec(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } } //========================================================================================== // // 블러 // //========================================================================================== vsOut_Normal vs_BlurEffect( float4 Pos:POSITION, float3 Normal:NORMAL, float2 TexCoords:TEXCOORD0 ) { vsOut_Normal Out = (vsOut_Normal)0; float4 curPos = mul( Pos, World ); float4 oldPos = mul( Pos, LastWorld ); float4 v = curPos - oldPos; float4 n = mul( Normal, World ); bool bFront = ( 0 { pass P0 { AlphaBlendEnable = true; AlphaTestEnable = false; ZEnable = true; ZWriteEnable = false; SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; VertexShader = compile vs_2_0 vs_BlurEffect(); PixelShader = compile ps_2_0 ps_Default(); CullMode = CW; } pass P1 { VertexShader = compile vs_2_0 vs_OutLine(); PixelShader = compile ps_2_0 ps_CharOutLine(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CCW; } pass P2 { VertexShader = compile vs_2_0 vs_Normal(); PixelShader = compile ps_2_0 ps_CharNormal(); SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; AlphaBlendEnable = true; CullMode = CW; } }