Skip to content

Commit 96a8033

Browse files
committed
stepAngleをCPU側で計算してから転送する
1 parent 0d4441f commit 96a8033

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

script/RotBlur_M.anm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if GLShaderKit.isInitialized() then
4949
GLShaderKit.setShader(shader_path, reload)
5050
GLShaderKit.setFloat("resolution", w, h)
5151
GLShaderKit.setFloat("pivot", x + w * 0.5, y + h * 0.5)
52-
GLShaderKit.setFloat("amount", amount)
52+
GLShaderKit.setFloat("stepAngle", amount / quality)
5353
GLShaderKit.setFloat("rPos", amount * r_pos)
5454
GLShaderKit.setInt("quality", quality)
5555
GLShaderKit.setTexture2D(0, data, w, h)

script/RotBlur_M.frag

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ in vec2 TexCoord;
55
layout(location = 0) out vec4 FragColor;
66

77
uniform sampler2D texture0;
8-
uniform float amount;
8+
uniform float stepAngle;
99
uniform int quality;
1010
uniform vec2 resolution;
1111
uniform vec2 pivot;
@@ -15,7 +15,6 @@ mat2 rot_mat(float angle) { return mat2(cos(angle), -sin(angle), sin(angle), cos
1515

1616
void main() {
1717
vec4 color = vec4(0);
18-
float stepAngle = amount / quality;
1918
mat2 rot1 = rot_mat(stepAngle);
2019
mat2 rot2 = rot_mat(-stepAngle);
2120
vec2 uv1 = (TexCoord * resolution - pivot) * rot_mat(rPos);

0 commit comments

Comments
 (0)