Fix bump3d use of sample()

Change-Id: I75d7a4bdbfb2a5d22b85bca0cae2975378b19a53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269365
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2020-02-07 12:03:13 -05:00 committed by Skia Commit-Bot
parent d2e4de1c33
commit 46b2b00584

View File

@ -556,7 +556,7 @@ public:
}
void main(float x, float y, inout half4 color) {
float3 norm = convert_normal_sample(sample(normal_map));
float3 norm = convert_normal_sample(sample(normal_map, float2(x, y)));
float3 plane_norm = normalize(localToWorld * float4(norm, 0)).xyz;
float3 plane_pos = (localToWorld * float4(x, y, 0, 1)).xyz;
@ -566,7 +566,7 @@ public:
float dp = dot(plane_norm, light_dir);
float scale = min(ambient + max(dp, 0), 1);
color = sample(color_map) * half4(float4(scale, scale, scale, 1));
color = sample(color_map, float2(x, y)) * half4(float4(scale, scale, scale, 1));
}
)";
auto [effect, error] = SkRuntimeEffect::Make(SkString(code));