@@ -77,7 +77,7 @@ bool LinearGradientContents::RenderTexture(const ContentContext& renderer,
77
77
};
78
78
return ColorSourceContents::DrawGeometry<VS>(
79
79
renderer, entity, pass, pipeline_callback, frame_info,
80
- [this , &renderer](RenderPass& pass) {
80
+ [this , &renderer, &entity ](RenderPass& pass) {
81
81
auto gradient_data = CreateGradientBuffer (colors_, stops_);
82
82
auto gradient_texture =
83
83
CreateGradientTexture (gradient_data, renderer.GetContext ());
@@ -92,7 +92,9 @@ bool LinearGradientContents::RenderTexture(const ContentContext& renderer,
92
92
frag_info.decal_border_color = decal_border_color_;
93
93
frag_info.texture_sampler_y_coord_scale =
94
94
gradient_texture->GetYCoordScale ();
95
- frag_info.alpha = GetOpacityFactor ();
95
+ frag_info.alpha =
96
+ GetOpacityFactor () * GetGeometry ()->ComputeAlphaCoverage (entity);
97
+ ;
96
98
frag_info.half_texel =
97
99
Vector2 (0.5 / gradient_texture->GetSize ().width ,
98
100
0.5 / gradient_texture->GetSize ().height );
@@ -137,13 +139,14 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer,
137
139
};
138
140
return ColorSourceContents::DrawGeometry<VS>(
139
141
renderer, entity, pass, pipeline_callback, frame_info,
140
- [this , &renderer](RenderPass& pass) {
142
+ [this , &renderer, &entity ](RenderPass& pass) {
141
143
FS::FragInfo frag_info;
142
144
frag_info.start_point = start_point_;
143
145
frag_info.end_point = end_point_;
144
146
frag_info.tile_mode = static_cast <Scalar>(tile_mode_);
145
147
frag_info.decal_border_color = decal_border_color_;
146
- frag_info.alpha = GetOpacityFactor ();
148
+ frag_info.alpha =
149
+ GetOpacityFactor () * GetGeometry ()->ComputeAlphaCoverage (entity);
147
150
frag_info.start_to_end = end_point_ - start_point_;
148
151
frag_info.inverse_dot_start_to_end =
149
152
CalculateInverseDotStartToEnd (start_point_, end_point_);
0 commit comments