visual-song 1.1.4 → 1.1.6

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
- playerRef.current = renderer.createPlayer(width, height, `#${canvas.id}`);
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);
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visual-song",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "visual-song core library",
5
5
  "author": "kunyoungparkk (rjsdud3263@gmail.com)",
6
6
  "license": "MIT",