Skip to content

Commit 6b94a40

Browse files
committed
Merge pull request #120 from hapticdata/master
fix typo and add uniforms to gpgpu-2
2 parents 46a58fb + fdf22de commit 6b94a40

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

exercises/gpgpu-2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Implement a shader which computes a single step of the explicit Euler scheme for integrating the heat equation, described below.
66

7-
The previous state of `f(x,y,t-1)` will be encoded in a periodic texture. The diffusion constant and damping will be sent in the parameters `kdiffuse` and `kambient` respectively.
7+
The previous state of `f(x,y,t-1)` will be encoded in a periodic texture. The diffusion constant and damping will be sent in the parameters `kdiffuse` and `kdamping` respectively.
88

99
To get started, there is a file called <a href="/open/gpgpu-2" target="_blank">`heat.glsl` in the directory for this lesson</a>.
1010

exercises/gpgpu-2/files/heat.glsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ precision mediump float;
22

33
uniform sampler2D prevState;
44
uniform vec2 stateSize;
5+
uniform float kdiffuse;
6+
uniform float kdamping;
57

68
float state(vec2 x) {
79
return texture2D(prevState, fract(x / stateSize)).r;
@@ -10,7 +12,7 @@ float state(vec2 x) {
1012
void main() {
1113
vec2 coord = gl_FragCoord.xy;
1214

13-
//TODO: Compute next state using a 5-point Laplacian stencil and the rule
15+
//TODO: Compute next state using a 5-point Laplacian stencil and the rule
1416

1517
float y = state(coord);
1618

0 commit comments

Comments
 (0)