Update the shaders
Translate by (-x, -y) first, then by (x, y) to get it back to normal.
This commit is contained in:
parent
1b8fc1feb7
commit
141eee69ee
2 changed files with 4 additions and 3 deletions
|
@ -89,7 +89,8 @@ sampleToColorShader(RasterizerData in [[stage_in]],
|
|||
out = singleColor(sample, target, feather, parameters.colors[0]);
|
||||
break;
|
||||
case Gradient2Horizontal: {
|
||||
const float blend = in.position.x / parameters.size[0];
|
||||
const float3 transformedColor = (parameters.colorTransform * float3(in.position.xy, 1.0));
|
||||
const float blend = transformedColor.x / parameters.size[0];
|
||||
out = gradient2(sample, target, feather, blend, parameters.colors[0], parameters.colors[1]);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue