File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Fade
2
+
3
+ So we're on to a pretty basic example that uses a uniform. In this case we're
4
+ using a single float value as a uniform to control the opacity of the triangle.
5
+ In this case we can use the CPU to calculate what the fade should be based on
6
+ the time as we increment the value. And on each frame before every draw call,
7
+ we update the value of the uniform. The GPU will then remember that as a fixed
8
+ value until we update it again, which happens to be on each frame.
9
+
10
+ As far as opacity goes, this example doesn't exactly work. I'm not sure why the
11
+ example shows the console under the triangle each time. So I think there could
12
+ be some setting that I'm missing when setting up the OpenGL context.
You can’t perform that action at this time.
0 commit comments