Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#Actuallipsryme

Posted 29 December 2012 - 12:41 PM

I think what you want to do is something like this

 

// Incoming radiance (this would be the color and intensity of the light energy
// that is coming towards your surface/shaded pixel)
float3 Li = LightColor * LightIntensity;  

// This would correspond to your LightIntensity (the cosine factor)
float NdotL = saturate(dot(Normal, LightDirection)); 

// Your final diffuse light output (or composition) 
float3 Diffuse = NdotL * Li;

// Your ambient light term
float3 AmbientLight = AmbientLight;

// Now "add" the ambient light to your diffuse composition
Diffuse += AmbientColor * AmbientIntensity;

// And at last multiply the result of your light computation by your material's
// diffuse color (albedo) -> basically the regular texture color
float3 output = Diffuse * Albedo;

 

 


#3lipsryme

Posted 29 December 2012 - 12:39 PM

I think what you want to do is something like this:
// Incoming radiance (this would be the color and intensity of the light energy// that is coming towards your surface/shaded pixel)float3 Li = LightColor * LightIntensity;  // This would correspond to your LightIntensity (the cosine factor)float NdotL = saturate(dot(Normal, LightDirection)); // Your final diffuse light output (or composition) float3 Diffuse = NdotL * Li;// Your ambient light termfloat3 AmbientLight = AmbientLight;// Now "add" the ambient light to your diffuse compositionDiffuse += AmbientColor * AmbientIntensity;// And at last multiply the result of your light computation by your material's// diffuse color (albedo) -> basically the regular texture colorfloat3 output = Diffuse * Albedo;

#2lipsryme

Posted 29 December 2012 - 12:39 PM

I think what you want to do is something like this:
// Incoming radiance (this would be the color and intensity of the light energy// that is coming towards your surface/shaded pixel)float3 Li = LightColor * LightIntensity;  // This would correspond to your LightIntensity (the cosine factor)float NdotL = saturate(dot(Normal, LightDirection)); // Your final diffuse light output (or composition) float3 Diffuse = NdotL * Li;// Your ambient light termfloat3 AmbientLight = AmbientLight;// Now "add" the ambient light to your diffuse compositionDiffuse += AmbientColor * AmbientIntensity;// And at last multiply the result of your light computation by your material's// diffuse color (albedo) -> basically the regular texture colorfloat3 output = Diffuse * Albedo;

#1lipsryme

Posted 29 December 2012 - 10:45 AM

I think what you want to do is something like this:

 

// Incoming radiance (this would be the color and intensity of the light energy
// that is coming towards your surface/shaded pixel)
float3 Li = LightColor * LightIntensity;  

// This would correspond to your LightIntensity (the cosine factor)
float NdotL = saturate(dot(Normal, LightDirection)); 

// Your final diffuse light output (or composition) 
float3 Diffuse = NdotL * Li;

// Your ambient light term
float3 AmbientLight = AmbientColor * AmbientIntensity;

// Now "add" the ambient light to your diffuse composition
Diffuse += AmbientColor * AmbientIntensity;

// And at last multiply the result of your light computation by your material's
// diffuse color (albedo) -> basically the regular texture color
float3 output = Diffuse * Albedo;



PARTNERS