Skip to content

Commit

Permalink
Shaders- need to unbind after setting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tzachshabtay committed Mar 27, 2018
1 parent c917728 commit fe50a28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Demo/DemoQuest/Shaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ private static void setVignetteResolution()
_vignetteShader.Compile();
_vignetteShader.Bind();
_vignetteShader.SetVariable("resolution", resolution.Width, resolution.Height);
_vignetteShader.Unbind();
}

private static void unbindVignetteShader()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private void onBeforeRender()
}
shader.Bind();
shader.SetVariable("adjustment", Saturation);
shader.Unbind();
}
}
}
1 change: 1 addition & 0 deletions Source/Engine/AGS.Engine/Graphics/Effects/ShakeEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private void onBeforeRender()
shader.SetVariable("time", (float)Repeat.Do("ShakeEffect"));
var currentStrength = _strength + MathUtils.Random().Next(1000) / 1000000f; //Adding a little jerkiness
shader.SetVariable("strength", currentStrength);
shader.Unbind();
_strength = _strength * _decay;
}

Expand Down

0 comments on commit fe50a28

Please sign in to comment.