魔王撒旦
float4 LSDSPS(const PS_INPUTDS Input):COLOR0 { const float Pi = 3.14159265; float Depth = tex2D(DepthSampler,Input.vTexCoord.xy).x; float4 L0 = tex2D(DiffuseSampler,Input.vTexCoord.xy); float3 normal = tex2D(NormalSampler,Input.vTexCoord.xy).xyz; normal = normal.xyz*2.0-float3(1.0,1.0,1.0); L0.xyz *= saturate(mul(SunDir.xyz,normal)); float3 View = float3(Depth*Input.vTexCoord.wz,Depth); float3 Eext = SunColor.xyz*TerrainReflect; float dist = length(View.xyz); float costheta = mul(SunDir.xyz,normalize(View.xyz).xyz); float3 pindex = NegBetaPlus.xyz*dist; float3 Fex = exp(pindex.xyz); L0.xyz *= Eext; L0.xyz *= Fex; float3 BetaRTheta = (3.0/(16.0*Pi))*BetaRay.xyz*(1.0+costheta*costheta); float3 BetaMTheta = BetaMie.xyz*(1.0/(4.0*Pi))*Hcg.x/pow(Hcg.y-Hcg.z*costheta,1.5); float3 Lin = SunColor.xyz*(BetaMTheta+BetaRTheta).xyz*InvBetaPlus.xyz*(float3(1.0,1.0,1.0)-Fex.xyz).xyz; return float4(L0.xyz+Lin.xyz*ExtInMulti.y,L0.w); }
BeginTiling(..); ....... EndTiling();
查看详细资料
TOP
原帖由 xbgbmpsp 于 2007-3-15 12:02 发表 因为裤子!裤子!:D
int main(int argc,char* argv[]) { return 0; }
原帖由 Shin 于 2007-3-15 12:27 发表 为什么系列 教你做什么系列 TG就是一个传道授业解惑的地方呀!
原帖由 Jonsoncao 于 2007-3-15 12:36 发表 no header file no namespace
原帖由 Jonsoncao 于 2007-3-15 12:40 发表 既然爱他们为什么还要发这种帖子,令我很失望
原帖由 RacingPHT 于 2007-3-15 19:37 发表 h兄我也看不懂
原帖由 RacingPHT 于 2007-3-15 21:09 发表 :D 补课补课.. 这个还是比动态光源难一点的... ps: 俺当初刚学OGL的时候(2002?)竟然还在菜鸟论坛上和你战过, 世界果然是小啊...