From 1228803f042be90ef2d3726825dd635596a8f8eb Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 18 Jul 2022 20:46:50 -0700 Subject: [PATCH 1/4] Clean up solid fill --- impeller/entity/contents/clip_contents.cc | 26 ++++++++++++------- .../entity/contents/solid_color_contents.cc | 21 ++++++++------- impeller/entity/entity_unittests.cc | 14 +++++++--- impeller/entity/shaders/solid_fill.frag | 6 +++-- impeller/entity/shaders/solid_fill.vert | 12 +++------ 5 files changed, 46 insertions(+), 33 deletions(-) diff --git a/impeller/entity/contents/clip_contents.cc b/impeller/entity/contents/clip_contents.cc index 7947adad37582..b592052b2edbd 100644 --- a/impeller/entity/contents/clip_contents.cc +++ b/impeller/entity/contents/clip_contents.cc @@ -45,12 +45,17 @@ bool ClipContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = ClipPipeline::VertexShader; + using FS = ClipPipeline::FragmentShader; - VS::FrameInfo info; - // The color really doesn't matter. - info.color = Color::SkyBlue(); + VS::VertInfo info; Command cmd; + + FS::FragInfo frag_info; + // The color really doesn't matter. + frag_info.color = Color::SkyBlue(); + FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); + auto options = OptionsFromPassAndEntity(pass, entity); cmd.stencil_reference = entity.GetStencilDepth(); options.stencil_compare = CompareFunction::kEqual; @@ -69,7 +74,7 @@ bool ClipContents::Render(const ContentContext& renderer, cmd.BindVertices(std::move(vertices)); info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()); - VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); + VS::BindVertInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); cmd.pipeline = renderer.GetClipPipeline(options); pass.AddCommand(cmd); @@ -95,7 +100,7 @@ bool ClipContents::Render(const ContentContext& renderer, info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * entity.GetTransformation(); - VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); + VS::BindVertInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); pass.AddCommand(std::move(cmd)); return true; @@ -123,6 +128,7 @@ bool ClipRestoreContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = ClipPipeline::VertexShader; + using FS = ClipPipeline::FragmentShader; Command cmd; cmd.label = "Restore Clip"; @@ -145,12 +151,14 @@ bool ClipRestoreContents::Render(const ContentContext& renderer, }); cmd.BindVertices(vtx_builder.CreateVertexBuffer(pass.GetTransientsBuffer())); - VS::FrameInfo info; - // The color really doesn't matter. - info.color = Color::SkyBlue(); + VS::VertInfo info; info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()); + VS::BindVertInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); - VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); + FS::FragInfo frag_info; + // The color really doesn't matter. + frag_info.color = Color::SkyBlue(); + FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); pass.AddCommand(std::move(cmd)); return true; diff --git a/impeller/entity/contents/solid_color_contents.cc b/impeller/entity/contents/solid_color_contents.cc index b0009af71890b..2af3815158135 100644 --- a/impeller/entity/contents/solid_color_contents.cc +++ b/impeller/entity/contents/solid_color_contents.cc @@ -48,11 +48,8 @@ VertexBuffer SolidColorContents::CreateSolidFillVertices(const Path& path, VertexBufferBuilder vtx_builder; auto tesselation_result = Tessellator{}.Tessellate( - path.GetFillType(), path.CreatePolyline(), [&vtx_builder](auto point) { - VS::PerVertexData vtx; - vtx.vertices = point; - vtx_builder.AppendVertex(vtx); - }); + path.GetFillType(), path.CreatePolyline(), + [&vtx_builder](auto point) { vtx_builder.AppendVertex({point}); }); if (tesselation_result != Tessellator::Result::kSuccess) { return {}; } @@ -64,6 +61,7 @@ bool SolidColorContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = SolidFillPipeline::VertexShader; + using FS = SolidFillPipeline::FragmentShader; Command cmd; cmd.label = "Solid Fill"; @@ -77,11 +75,14 @@ bool SolidColorContents::Render(const ContentContext& renderer, : path_, pass.GetTransientsBuffer())); - VS::FrameInfo frame_info; - frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); - frame_info.color = color_.Premultiply(); - VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); + VS::VertInfo vert_info; + vert_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * + entity.GetTransformation(); + VS::BindVertInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(vert_info)); + + FS::FragInfo frag_info; + frag_info.color = color_.Premultiply(); + FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); cmd.primitive_type = PrimitiveType::kTriangle; diff --git a/impeller/entity/entity_unittests.cc b/impeller/entity/entity_unittests.cc index f75b3c715b5b8..00fcb190dc774 100644 --- a/impeller/entity/entity_unittests.cc +++ b/impeller/entity/entity_unittests.cc @@ -708,6 +708,8 @@ TEST_P(EntityTest, BlendingModeOptions) { Rect rect, Color color, Entity::BlendMode blend_mode) -> bool { using VS = SolidFillPipeline::VertexShader; + using FS = SolidFillPipeline::FragmentShader; + VertexBufferBuilder vtx_builder; { auto r = rect.GetLTRB(); @@ -729,12 +731,16 @@ TEST_P(EntityTest, BlendingModeOptions) { cmd.BindVertices( vtx_builder.CreateVertexBuffer(pass.GetTransientsBuffer())); - VS::FrameInfo frame_info; + VS::VertInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * world_matrix; - frame_info.color = color.Premultiply(); - VS::BindFrameInfo(cmd, - pass.GetTransientsBuffer().EmplaceUniform(frame_info)); + VS::BindVertInfo(cmd, + pass.GetTransientsBuffer().EmplaceUniform(frame_info)); + + FS::FragInfo frag_info; + frag_info.color = color.Premultiply(); + FS::BindFragInfo(cmd, + pass.GetTransientsBuffer().EmplaceUniform(frag_info)); cmd.primitive_type = PrimitiveType::kTriangle; diff --git a/impeller/entity/shaders/solid_fill.frag b/impeller/entity/shaders/solid_fill.frag index 0263c965f294b..fbaccbd595dd0 100644 --- a/impeller/entity/shaders/solid_fill.frag +++ b/impeller/entity/shaders/solid_fill.frag @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -in vec4 color; +uniform FragInfo { + vec4 color; +} frag_info; out vec4 frag_color; void main() { - frag_color = color; + frag_color = frag_info.color; } diff --git a/impeller/entity/shaders/solid_fill.vert b/impeller/entity/shaders/solid_fill.vert index 9d29d7eeee634..4ecd8a0f900c0 100644 --- a/impeller/entity/shaders/solid_fill.vert +++ b/impeller/entity/shaders/solid_fill.vert @@ -2,16 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -uniform FrameInfo { +uniform VertInfo { mat4 mvp; - vec4 color; -} frame_info; +} vert_info; -in vec2 vertices; - -out vec4 color; +in vec2 position; void main() { - gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); - color = frame_info.color; + gl_Position = vert_info.mvp * vec4(position, 0.0, 1.0); } From 30fcc85b6e2ccd00ab3e8908d0f670443dfe388b Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 18 Jul 2022 22:18:13 -0700 Subject: [PATCH 2/4] Clean up solid stroke --- .../entity/contents/solid_stroke_contents.cc | 74 ++++++++++--------- impeller/entity/shaders/solid_stroke.frag | 7 +- impeller/entity/shaders/solid_stroke.vert | 15 ++-- 3 files changed, 50 insertions(+), 46 deletions(-) diff --git a/impeller/entity/contents/solid_stroke_contents.cc b/impeller/entity/contents/solid_stroke_contents.cc index 201f7ad6cd722..c332b966c5b51 100644 --- a/impeller/entity/contents/solid_stroke_contents.cc +++ b/impeller/entity/contents/solid_stroke_contents.cc @@ -109,8 +109,8 @@ static VertexBuffer CreateSolidStrokeVertices( // We're drawing a triangle strip, so we need to "pick up the pen" by // appending transparent vertices between the end of the previous contour // and the beginning of the new contour. - vtx.vertex_position = polyline.points[contour_start_point_i - 1]; - vtx.vertex_normal = {}; + vtx.position = polyline.points[contour_start_point_i - 1]; + vtx.normal = {}; vtx.pen_down = 0.0; // Append two transparent vertices when "picking up" the pen so that the // triangle drawn when moving to the beginning of the new contour will @@ -119,7 +119,7 @@ static VertexBuffer CreateSolidStrokeVertices( vtx_builder.AppendVertex(vtx); vtx_builder.AppendVertex(vtx); - vtx.vertex_position = polyline.points[contour_start_point_i]; + vtx.position = polyline.points[contour_start_point_i]; // Append two vertices at the beginning of the new contour // so that the next appended vertex will create a triangle with zero // volume. @@ -139,16 +139,16 @@ static VertexBuffer CreateSolidStrokeVertices( point_i++) { if (point_i > contour_start_point_i) { // Generate line rect. - vtx.vertex_position = polyline.points[point_i - 1]; + vtx.position = polyline.points[point_i - 1]; vtx.pen_down = 1.0; - vtx.vertex_normal = normal; + vtx.normal = normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = -normal; + vtx.normal = -normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_position = polyline.points[point_i]; - vtx.vertex_normal = normal; + vtx.position = polyline.points[point_i]; + vtx.normal = normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = -normal; + vtx.normal = -normal; vtx_builder.AppendVertex(vtx); if (point_i < contour_end_point_i - 1) { @@ -181,13 +181,16 @@ bool SolidStrokeContents::Render(const ContentContext& renderer, return true; } - using VS = SolidStrokeVertexShader; + using VS = SolidStrokePipeline::VertexShader; + using FS = SolidStrokePipeline::FragmentShader; + + VS::VertInfo vert_info; + vert_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * + entity.GetTransformation(); + vert_info.size = stroke_size_; - VS::FrameInfo frame_info; - frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); - frame_info.color = color_.Premultiply(); - frame_info.size = stroke_size_; + FS::FragInfo frag_info; + frag_info.color = color_.Premultiply(); Command cmd; cmd.primitive_type = PrimitiveType::kTriangleStrip; @@ -206,7 +209,8 @@ bool SolidStrokeContents::Render(const ContentContext& renderer, cmd.BindVertices(CreateSolidStrokeVertices(path_, pass.GetTransientsBuffer(), cap_proc_, join_proc_, miter_limit_, smoothing)); - VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); + VS::BindVertInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(vert_info)); + FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); pass.AddCommand(cmd); @@ -251,7 +255,7 @@ void SolidStrokeContents::SetStrokeCap(Cap cap) { const Point& position, const Point& normal, const SmoothingApproximation& smoothing) { SolidStrokeVertexShader::PerVertexData vtx; - vtx.vertex_position = position; + vtx.position = position; vtx.pen_down = 1.0; Point forward(normal.y, -normal.x); @@ -262,14 +266,14 @@ void SolidStrokeContents::SetStrokeCap(Cap cap) { forward + normal * PathBuilder::kArcApproximationMagic, forward) .CreatePolyline(smoothing); - vtx.vertex_normal = normal; + vtx.normal = normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = -normal; + vtx.normal = -normal; vtx_builder.AppendVertex(vtx); for (const auto& point : arc_points) { - vtx.vertex_normal = point; + vtx.normal = point; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = (-point).Reflect(forward); + vtx.normal = (-point).Reflect(forward); vtx_builder.AppendVertex(vtx); } }; @@ -279,18 +283,18 @@ void SolidStrokeContents::SetStrokeCap(Cap cap) { const Point& position, const Point& normal, const SmoothingApproximation& smoothing) { SolidStrokeVertexShader::PerVertexData vtx; - vtx.vertex_position = position; + vtx.position = position; vtx.pen_down = 1.0; Point forward(normal.y, -normal.x); - vtx.vertex_normal = normal; + vtx.normal = normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = -normal; + vtx.normal = -normal; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = normal + forward; + vtx.normal = normal + forward; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = -normal + forward; + vtx.normal = -normal + forward; vtx_builder.AppendVertex(vtx); }; break; @@ -307,15 +311,15 @@ static Scalar CreateBevelAndGetDirection( const Point& start_normal, const Point& end_normal) { SolidStrokeVertexShader::PerVertexData vtx; - vtx.vertex_position = position; + vtx.position = position; vtx.pen_down = 1.0; - vtx.vertex_normal = {}; + vtx.normal = {}; vtx_builder.AppendVertex(vtx); Scalar dir = start_normal.Cross(end_normal) > 0 ? -1 : 1; - vtx.vertex_normal = start_normal * dir; + vtx.normal = start_normal * dir; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = end_normal * dir; + vtx.normal = end_normal * dir; vtx_builder.AppendVertex(vtx); return dir; @@ -357,9 +361,9 @@ void SolidStrokeContents::SetStrokeJoin(Join join) { // Outer miter point. SolidStrokeVertexShader::PerVertexData vtx; - vtx.vertex_position = position; + vtx.position = position; vtx.pen_down = 1.0; - vtx.vertex_normal = miter_point * dir; + vtx.normal = miter_point * dir; vtx_builder.AppendVertex(vtx); }; break; @@ -391,12 +395,12 @@ void SolidStrokeContents::SetStrokeJoin(Join join) { .CreatePolyline(smoothing); SolidStrokeVertexShader::PerVertexData vtx; - vtx.vertex_position = position; + vtx.position = position; vtx.pen_down = 1.0; for (const auto& point : arc_points) { - vtx.vertex_normal = point * dir; + vtx.normal = point * dir; vtx_builder.AppendVertex(vtx); - vtx.vertex_normal = (-point * dir).Reflect(middle); + vtx.normal = (-point * dir).Reflect(middle); vtx_builder.AppendVertex(vtx); } }; diff --git a/impeller/entity/shaders/solid_stroke.frag b/impeller/entity/shaders/solid_stroke.frag index 3a3cb61e3cfb8..c49fef048556d 100644 --- a/impeller/entity/shaders/solid_stroke.frag +++ b/impeller/entity/shaders/solid_stroke.frag @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -in vec4 stroke_color; +uniform FragInfo { + vec4 color; +} frag_info; + in float v_pen_down; out vec4 frag_color; void main() { - frag_color = stroke_color * floor(v_pen_down); + frag_color = frag_info.color * floor(v_pen_down); } diff --git a/impeller/entity/shaders/solid_stroke.vert b/impeller/entity/shaders/solid_stroke.vert index 67310e3118274..21fd93d9cb741 100644 --- a/impeller/entity/shaders/solid_stroke.vert +++ b/impeller/entity/shaders/solid_stroke.vert @@ -2,23 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -uniform FrameInfo { +uniform VertInfo { mat4 mvp; - vec4 color; float size; -} frame_info; +} vert_info; -in vec2 vertex_position; -in vec2 vertex_normal; +in vec2 position; +in vec2 normal; in float pen_down; -out vec4 stroke_color; out float v_pen_down; void main() { // Push one vertex by the half stroke size along the normal vector. - vec2 offset = vertex_normal * vec2(frame_info.size * 0.5); - gl_Position = frame_info.mvp * vec4(vertex_position + offset, 0.0, 1.0); - stroke_color = frame_info.color; + vec2 offset = normal * vec2(vert_info.size * 0.5); + gl_Position = vert_info.mvp * vec4(position + offset, 0.0, 1.0); v_pen_down = pen_down; } From b8afe01abe8ab39179fa7752f398e453c1683ebf Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 18 Jul 2022 22:32:46 -0700 Subject: [PATCH 3/4] Formatting --- impeller/entity/shaders/solid_fill.frag | 3 ++- impeller/entity/shaders/solid_fill.vert | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/impeller/entity/shaders/solid_fill.frag b/impeller/entity/shaders/solid_fill.frag index fbaccbd595dd0..5d9c83604dd68 100644 --- a/impeller/entity/shaders/solid_fill.frag +++ b/impeller/entity/shaders/solid_fill.frag @@ -4,7 +4,8 @@ uniform FragInfo { vec4 color; -} frag_info; +} +frag_info; out vec4 frag_color; diff --git a/impeller/entity/shaders/solid_fill.vert b/impeller/entity/shaders/solid_fill.vert index 4ecd8a0f900c0..8fdc5b1ea3f1e 100644 --- a/impeller/entity/shaders/solid_fill.vert +++ b/impeller/entity/shaders/solid_fill.vert @@ -4,7 +4,8 @@ uniform VertInfo { mat4 mvp; -} vert_info; +} +vert_info; in vec2 position; From abfdfd26f8420e799c0173af45f08631e8644e6b Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 18 Jul 2022 22:33:38 -0700 Subject: [PATCH 4/4] Clean up texture fill --- impeller/entity/contents/texture_contents.cc | 12 ++++++------ impeller/entity/shaders/solid_stroke.frag | 3 ++- impeller/entity/shaders/solid_stroke.vert | 3 ++- impeller/entity/shaders/texture_fill.frag | 5 +++-- impeller/entity/shaders/texture_fill.vert | 12 +++++------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index cc9b883870fe6..10a72daab7073 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -78,7 +78,7 @@ bool TextureContents::Render(const ContentContext& renderer, path_.GetFillType(), path_.CreatePolyline(), [this, &vertex_builder, &coverage_rect, &texture_size](Point vtx) { VS::PerVertexData data; - data.vertices = vtx; + data.position = vtx; auto coverage_coords = (vtx - coverage_rect->origin) / coverage_rect->size; data.texture_coords = @@ -101,13 +101,13 @@ bool TextureContents::Render(const ContentContext& renderer, auto& host_buffer = pass.GetTransientsBuffer(); - VS::FrameInfo frame_info; - frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * - entity.GetTransformation(); - frame_info.alpha = opacity_; + VS::VertInfo vert_info; + vert_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * + entity.GetTransformation(); FS::FragInfo frag_info; frag_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); + frag_info.alpha = opacity_; Command cmd; cmd.label = "TextureFill"; @@ -115,7 +115,7 @@ bool TextureContents::Render(const ContentContext& renderer, renderer.GetTexturePipeline(OptionsFromPassAndEntity(pass, entity)); cmd.stencil_reference = entity.GetStencilDepth(); cmd.BindVertices(vertex_builder.CreateVertexBuffer(host_buffer)); - VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info)); + VS::BindVertInfo(cmd, host_buffer.EmplaceUniform(vert_info)); FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); FS::BindTextureSampler(cmd, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler( diff --git a/impeller/entity/shaders/solid_stroke.frag b/impeller/entity/shaders/solid_stroke.frag index c49fef048556d..0c88de8117ff5 100644 --- a/impeller/entity/shaders/solid_stroke.frag +++ b/impeller/entity/shaders/solid_stroke.frag @@ -4,7 +4,8 @@ uniform FragInfo { vec4 color; -} frag_info; +} +frag_info; in float v_pen_down; diff --git a/impeller/entity/shaders/solid_stroke.vert b/impeller/entity/shaders/solid_stroke.vert index 21fd93d9cb741..f5c6f634ff0e3 100644 --- a/impeller/entity/shaders/solid_stroke.vert +++ b/impeller/entity/shaders/solid_stroke.vert @@ -5,7 +5,8 @@ uniform VertInfo { mat4 mvp; float size; -} vert_info; +} +vert_info; in vec2 position; in vec2 normal; diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index 2c0024a6aa007..913cc7e1e8a70 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -5,18 +5,19 @@ #include uniform sampler2D texture_sampler; + uniform FragInfo { float texture_sampler_y_coord_scale; + float alpha; } frag_info; in vec2 v_texture_coords; -in float v_alpha; out vec4 frag_color; void main() { vec4 sampled = IPSample(texture_sampler, v_texture_coords, frag_info.texture_sampler_y_coord_scale); - frag_color = sampled * v_alpha; + frag_color = sampled * frag_info.alpha; } diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index 303936eec685e..c8abc9aaabbce 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -2,19 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -uniform FrameInfo { +uniform VertInfo { mat4 mvp; - float alpha; -} frame_info; +} +vert_info; -in vec2 vertices; +in vec2 position; in vec2 texture_coords; out vec2 v_texture_coords; -out float v_alpha; void main() { - gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); + gl_Position = vert_info.mvp * vec4(position, 0.0, 1.0); v_texture_coords = texture_coords; - v_alpha = frame_info.alpha; }