i used the specular shader from the workshop
and as light sourec is the sun declared
how can i declare my own light source
which i can adjust by skills

Code:
// Calculate the ambient term: 
  float4 Ambient = AmbientIntensity * vecAmbient; 
// Calculate the diffuse term: 
  InNormal = normalize(InNormal); 
  float4 Diffuse = DiffuseIntensity * SunColor * saturate(dot(-vecSunDir, InNormal)); 
// Fetch the pixel color from the color map: 
  float4 Color = tex2D(ColorMapSampler, InTex); 
// Calculate the reflection vector: 
  float3 R = normalize(2 * dot(InNormal, -[b]vecSunDir[/b]) * InNormal + vecSunDir); 
// Calculate the speculate component: 
  float Specular = pow(saturate(dot(R, normalize(InViewDir))), SpecularPower) * SpecularIntensity; 
// Calculate final color: 
  return (Ambient + Diffuse + Specular) * Color; 
}


Last edited by GameScore; 09/10/12 04:52.