Skip to content

Commit 7ff2138

Browse files
committed
v1.03-for-beta20
+Explicitly specify the shader sampler.
1 parent 61f14ee commit 7ff2138

2 files changed

Lines changed: 36 additions & 33 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
http://spring-fragrance.mints.ne.jp/aviutl
2020

21-
- `beta4` で動作確認済み.
21+
- `beta20` で動作確認済み.
2222

2323
## 導入方法
2424

@@ -159,6 +159,11 @@ $$
159159

160160
## 改版履歴
161161

162+
- **v1.03 (for beta20)** (2025-11-17)
163+
164+
- HLSL の Sampler の設定を明示的に指定するように変更.
165+
- `beta20` での動作確認.
166+
162167
- **v1.02 (for beta3)** (2025-07-24)
163168

164169
- `リサイズ` など一部フィルタ効果の直後に適用した場合,`サイズ固定` が OFF でもオブジェクト外周が透明にならずに塗りつぶしされていたのを修正.

RadRotDirBlur_S.anm2

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SOFTWARE.
2222

2323
https://mit-license.org/
2424
]]
25-
--information:RadRotDirBlur_S v1.02 (for beta3) by σ軸
25+
--information:RadRotDirBlur_S v1.03 (for beta20) by σ軸
2626
--label:ぼかし
2727
--track0:移動X,-4000,4000,0,0.01
2828
--track1:移動Y,-4000,4000,0,0.01
@@ -41,8 +41,9 @@ Texture2D src : register(t0);
4141
cbuffer constant0 : register(b0) {
4242
float2 zmrot_d, zmrot_i, mov_d, mov_i;
4343
float2 center, size;
44-
float quality, mode_outer;
44+
float quality;
4545
};
46+
SamplerState s : register(s0);
4647

4748
float2x2 make_mat(float2 zmrot)
4849
{
@@ -55,11 +56,9 @@ const static float2x2
5556
mat_i = make_mat(zmrot_i);
5657
const static float2 lbd = 0.5 / size, ubd = 1.0 - lbd;
5758

58-
SamplerState s;
5959
float4 pick_color(float2 pos)
6060
{
61-
float2 t = saturate(size * min(pos, 1 - pos) + 0.5);
62-
return max(t.x * t.y, mode_outer) * src.Sample(s, clamp(pos, lbd, ubd));
61+
return src.Sample(s, pos);
6362
}
6463
float4 apply(float4 pos : SV_Position) : SV_Target
6564
{
@@ -84,8 +83,9 @@ cbuffer constant0 : register(b0) {
8483
float2 mov_d_r, mov_d_g, mov_d_b;
8584
float2 mov_i_r, mov_i_g, mov_i_b;
8685
float2 center, size;
87-
float quality, mode_outer, mode_blend;
86+
float quality, mode_blend;
8887
};
88+
SamplerState s : register(s0);
8989

9090
float2x2 make_mat(float2 zmrot)
9191
{
@@ -98,11 +98,9 @@ const static float2x2
9898
mat_i[3] = { make_mat(zmrot_i_r), make_mat(zmrot_i_g), make_mat(zmrot_i_b) };
9999
const static float2 lbd = 0.5 / size, ubd = 1.0 - lbd;
100100

101-
SamplerState s;
102101
float4 pick_color(float2 pos)
103102
{
104-
float2 t = saturate(size * min(pos, 1 - pos) + 0.5);
105-
return max(t.x * t.y, mode_outer) * src.Sample(s, clamp(pos, lbd, ubd));
103+
return src.Sample(s, pos);
106104
}
107105
float4 apply_chroma(float4 pos : SV_Position) : SV_Target
108106
{
@@ -310,14 +308,14 @@ if chrm_abrr == 0 then
310308
-- apply the shader.
311309
obj.pixelshader("apply", "object", keep_size and "object" or "tempbuffer",
312310
{
313-
math.cos(-info.rotate_d) / info.scale_d, math.sin(-info.rotate_d) / info.scale_d,
314-
math.cos(-info.rotate1) / info.scale1, math.sin(-info.rotate1) / info.scale1,
315-
-info.move_x_d / w, -info.move_y_d / h,
316-
-(info.move_x1 + offset_x) / w, -(info.move_y1 + offset_y) / h,
317-
318-
cx / w + 0.5, cy / h + 0.5, w, h,
319-
quality, keep_size and 1 or 0
320-
});
311+
math.cos(-info.rotate_d) / info.scale_d, math.sin(-info.rotate_d) / info.scale_d;
312+
math.cos(-info.rotate1) / info.scale1, math.sin(-info.rotate1) / info.scale1;
313+
-info.move_x_d / w, -info.move_y_d / h;
314+
-(info.move_x1 + offset_x) / w, -(info.move_y1 + offset_y) / h;
315+
316+
cx / w + 0.5, cy / h + 0.5; w, h;
317+
quality;
318+
}, "copy", keep_size and "clamp" or "clip");
321319
else
322320
-- prepare transforms for each color component.
323321
local t2, t3 = 1 - chrm_abrr ^ 2 / 2, 1 - chrm_abrr ^ 2;
@@ -337,23 +335,23 @@ else
337335
-- apply the shader.
338336
obj.pixelshader("apply_chroma", "object", keep_size and "object" or "tempbuffer",
339337
{
340-
math.cos(-infos[1].rotate_d) / infos[1].scale_d, math.sin(-infos[1].rotate_d) / infos[1].scale_d,
341-
math.cos(-infos[2].rotate_d) / infos[2].scale_d, math.sin(-infos[2].rotate_d) / infos[2].scale_d,
342-
math.cos(-infos[3].rotate_d) / infos[3].scale_d, math.sin(-infos[3].rotate_d) / infos[3].scale_d,
338+
math.cos(-infos[1].rotate_d) / infos[1].scale_d, math.sin(-infos[1].rotate_d) / infos[1].scale_d;
339+
math.cos(-infos[2].rotate_d) / infos[2].scale_d, math.sin(-infos[2].rotate_d) / infos[2].scale_d;
340+
math.cos(-infos[3].rotate_d) / infos[3].scale_d, math.sin(-infos[3].rotate_d) / infos[3].scale_d;
343341

344-
math.cos(-infos[1].rotate1) / infos[1].scale1, math.sin(-infos[1].rotate1) / infos[1].scale1,
345-
math.cos(-infos[2].rotate1) / infos[2].scale1, math.sin(-infos[2].rotate1) / infos[2].scale1,
346-
math.cos(-infos[3].rotate1) / infos[3].scale1, math.sin(-infos[3].rotate1) / infos[3].scale1,
342+
math.cos(-infos[1].rotate1) / infos[1].scale1, math.sin(-infos[1].rotate1) / infos[1].scale1;
343+
math.cos(-infos[2].rotate1) / infos[2].scale1, math.sin(-infos[2].rotate1) / infos[2].scale1;
344+
math.cos(-infos[3].rotate1) / infos[3].scale1, math.sin(-infos[3].rotate1) / infos[3].scale1;
347345

348-
-infos[1].move_x_d / w, -infos[1].move_y_d / h,
349-
-infos[2].move_x_d / w, -infos[2].move_y_d / h,
350-
-infos[3].move_x_d / w, -infos[3].move_y_d / h,
346+
-infos[1].move_x_d / w, -infos[1].move_y_d / h;
347+
-infos[2].move_x_d / w, -infos[2].move_y_d / h;
348+
-infos[3].move_x_d / w, -infos[3].move_y_d / h;
351349

352-
-(infos[1].move_x1 + offset_x) / w, -(infos[1].move_y1 + offset_y) / h,
353-
-(infos[2].move_x1 + offset_x) / w, -(infos[2].move_y1 + offset_y) / h,
354-
-(infos[3].move_x1 + offset_x) / w, -(infos[3].move_y1 + offset_y) / h,
350+
-(infos[1].move_x1 + offset_x) / w, -(infos[1].move_y1 + offset_y) / h;
351+
-(infos[2].move_x1 + offset_x) / w, -(infos[2].move_y1 + offset_y) / h;
352+
-(infos[3].move_x1 + offset_x) / w, -(infos[3].move_y1 + offset_y) / h;
355353

356-
cx / w + 0.5, cy / h + 0.5, w, h,
357-
quality, keep_size and 1 or 0, max_alpha and 0 or 1
358-
});
354+
cx / w + 0.5, cy / h + 0.5; w, h;
355+
quality; max_alpha and 0 or 1;
356+
}, "copy", keep_size and "clamp" or "clip");
359357
end

0 commit comments

Comments
 (0)