visual-song 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,12 @@ type Props = {
|
|
|
83
83
|
vertexCount?: number;
|
|
84
84
|
renderMode?: RenderMode;
|
|
85
85
|
initializedCallback?: () => void;
|
|
86
|
+
/**
|
|
87
|
+
* WebGL 기본 프레임버퍼 MSAA. 컨텍스트를 만들 때 한 번 정해진다.
|
|
88
|
+
* 생략하면 devicePixelRatio < 2 일 때만 켠다(고 DPR 캔버스는 이미 DPR배 해상도라 효과보다 메모리 비용이 크다).
|
|
89
|
+
* 영상 내보내기처럼 기기와 무관하게 매끈해야 하는 화면은 true 로 넘긴다.
|
|
90
|
+
*/
|
|
91
|
+
antialias?: boolean;
|
|
86
92
|
};
|
|
87
93
|
declare const VisualSong: react.ForwardRefExoticComponent<Props & react.RefAttributes<VisualSongRef>>;
|
|
88
94
|
|
package/dist/index.js
CHANGED
|
@@ -166,7 +166,7 @@ function useMainLoop() {
|
|
|
166
166
|
module
|
|
167
167
|
]);
|
|
168
168
|
}
|
|
169
|
-
const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgroundColor, vertexShader, primitiveMode, vertexCount, renderMode, initializedCallback }, ref) {
|
|
169
|
+
const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgroundColor, vertexShader, primitiveMode, vertexCount, renderMode, initializedCallback, antialias }, ref) {
|
|
170
170
|
const isInitialized = useRef(false);
|
|
171
171
|
const isMountedRef = useRef(true);
|
|
172
172
|
const canvasRef = useRef(null);
|
|
@@ -373,7 +373,8 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgro
|
|
|
373
373
|
const width = canvas.width;
|
|
374
374
|
const height = canvas.height;
|
|
375
375
|
const renderer = module.current.Renderer.getInstance();
|
|
376
|
-
|
|
376
|
+
const useAntialias = antialias ?? window.devicePixelRatio < 2;
|
|
377
|
+
playerRef.current = renderer.createPlayer(width, height, `#${canvas.id}`, useAntialias);
|
|
377
378
|
isInitialized.current = true;
|
|
378
379
|
if (backgroundColor !== undefined) {
|
|
379
380
|
setBackgroundColorInternal(backgroundColor);
|
|
@@ -432,8 +433,10 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgro
|
|
|
432
433
|
} else {
|
|
433
434
|
canvas.style.setProperty("width", "100%");
|
|
434
435
|
canvas.style.setProperty("height", "100%");
|
|
435
|
-
//
|
|
436
|
-
|
|
436
|
+
// 캔버스는 DPR배 해상도로 그리지만 gl_PointSize 에 DPR 을 곱하지 않는다. 셰이더 프롬프트가
|
|
437
|
+
// 점 크기를 resolution.y(디바이스 px)에 비례하게 쓰라고 하므로, 여기서 DPR 을 또 곱하면
|
|
438
|
+
// 레티나에서 2배, DPR 3 폰에서 3배로 커진다(2026-10 POINTS 보드 50개 렌더 비교로 확인).
|
|
439
|
+
_resizeRenderer(window.devicePixelRatio * wrapperWidth, window.devicePixelRatio * wrapperHeight, 1);
|
|
437
440
|
}
|
|
438
441
|
}
|
|
439
442
|
function destroy() {
|
|
@@ -23,7 +23,7 @@ export interface Renderer extends ClassHandle {
|
|
|
23
23
|
getPlayerCount(): number;
|
|
24
24
|
getFPS(): number;
|
|
25
25
|
setFPS(_0: number): void;
|
|
26
|
-
createPlayer(_0: number, _1: number, _2: EmbindString): VSPlayer | null;
|
|
26
|
+
createPlayer(_0: number, _1: number, _2: EmbindString, _3: boolean): VSPlayer | null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export interface SoundManager extends ClassHandle {
|
|
Binary file
|