-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPU: Custom Lighting Model #21706
Conversation
A
void ( vec3 lightColor ) {
ReflectedLightDirectDiffuse += lightColor;
} A void RE_Direct_BlinnPhong( vec3 lightDirection, vec3 lightColor ) {
float dotNL = saturate( dot( NormalView, lightDirection ) );
vec3 irradiance = dotNL * lightColor;
#ifndef PHYSICALLY_CORRECT_LIGHTS
irradiance *= PI; // punctual light
#endif
ReflectedLightDirectDiffuse += irradiance * BRDF_Diffuse_Lambert( MaterialDiffuseColor.rgb );
ReflectedLightDirectSpecular += irradiance * BRDF_Specular_BlinnPhong( lightDirection, MaterialSpecularColor, MaterialSpecularShininess );
} |
Looks interesting! I like the idea introduced in #21322 to represent components of a lighting model as instances of This goes definitely into the right direction 👍 . |
Thanks! |
BTW: It seems the spheres representing the point lights in |
Ohh… I will fix it. |
Description
An example of how to create custom lighting model with
NodeMaterial
andPointsMaterial
.Related
#17618