[skottie] Fix sphere lighting shader
Clamp s_base to avoid negative pow arguments. Fixes rendering issues on Mac/Win. Change-Id: I5176ffa6150ec430c2ab72115b74fd7ede5f5934 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369482 Commit-Queue: Florin Malita <fmalita@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
f67199e1a7
commit
26af11c867
@ -112,7 +112,7 @@ static constexpr char gFancyLightSkSL[] = R"(
|
|||||||
|
|
||||||
half4 apply_light(half3 EYE, half3 N, half4 c) {
|
half4 apply_light(half3 EYE, half3 N, half4 c) {
|
||||||
half3 LR = reflect(-l_vec*side_select, N);
|
half3 LR = reflect(-l_vec*side_select, N);
|
||||||
half s_base = dot(normalize(EYE), LR),
|
half s_base = max(dot(normalize(EYE), LR), 0),
|
||||||
|
|
||||||
a = l_coeff_ambient,
|
a = l_coeff_ambient,
|
||||||
d = l_coeff_diffuse * max(dot(l_vec, N), 0),
|
d = l_coeff_diffuse * max(dot(l_vec, N), 0),
|
||||||
|
Loading…
Reference in New Issue
Block a user