How to fill with gradient in shader mode?
- 主要語言
- Python
- 星號
- 93.9k
- 分支
- 7.7k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 4
描述
How to fill circle for example with gradient in shader mode? I tried set_color_by_gradient, it results in having different colors for different submobjects.
For example:
```
class Gradient(Scene):
def construct(self):
circle_1 = Circle().move_to(2*RIGHT)
circle_2 = Circle().move_to(2*LEFT)
circles = VGroup(circle_1,circle_2)
self.add(circles.set_color_by_gradient(PINK, YELLOW))
self.wait()
```
The results is:
https://user-images.githubusercontent.com/53943014/102837108-1a97a280-4436-11eb-83cf-72dee1fa1d3b.mp4
What I want is something like this:

All suggestions are highly appreciated. Thank you.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
此問題是將 gradient fill 應用於 shader mode 中的單一形狀,而不是跨越多個 submobjects。查看 manim 的 shader mode 實作,尤其關注顏色與 gradient 在渲染管線中的處理方式。檢查 set_color_by_gradient 方法和相關 shader 程式碼,以理解目前行為。目標是修改 shader,使其在單一物件(如 circle)內套用 gradient。
由索引模型根據 Issue 內容生成。
評估
- 領域
- computer-graphics
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100