绘制具有Alpha颜色的金属三角形时颜色不正确。如(0.9,0.6,0,0.4)

问题描述 投票:2回答:1
vertex Vertex
line_vertex_main(device Vertex *vertices [[buffer(0)]],
                 constant Uniforms &uniforms [[buffer(1)]],
                 uint vid [[vertex_id]])
{
  float4x4 matrix = uniforms.matrix;
  Vertex in = vertices[vid];
  Vertex out;
  out.position = matrix * float4(in.position);
  out.color = in.color;
  return out;
}

fragment float4
line_fragment_main(Vertex inVertex [[stage_in]])
{
  return inVertex.color;
}

颜色不正确。金属中的color(0.9,0.6,0,0.4)变成了一种奇怪的颜色:左边是正确的,右边是用金属enter image description here绘制的

绘制没有阿尔法颜色的金属三角形时颜色是正确的,右边是用金属绘制的。 enter image description here

ios metal
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.