15 Commits

Author SHA1 Message Date
BaekRyang
15144240b7 Fix sprite aspect ratio distortion and bump version to 1.5.2
- 스프라이트 파티클의 종횡비 왜곡 방지를 위한 해상도 보정 로직 추가
- SpriteEffectManager 및 Instance의 update 메서드에 해상도 인자 추가
- NDC 좌표계 기준 OrthographicCamera의 종횡비 보정 구현
- 패키지 버전을 1.5.2로 업데이트
2026-03-13 15:23:12 +09:00
BaekRyang
530e6d0396 Refactor sprite effects to be independent and support sprite sheets
- 스프라이트 이펙트를 왜곡 영역에서 분리하여 독립적인 영역으로 관리
- 스프라이트 시트 애니메이션 기능 추가 및 UV 제어 로직 구현
- 에디터 내 스프라이트 이펙트 영역 시각화 및 드래그 이동 기능 추가
- 이펙트 감지 방식을 다각형에서 원형(Radius) 기반으로 변경
- 관련 타입 정의 및 매니저 클래스 리팩토링
2026-03-11 08:32:36 +09:00
BaekRyang
48fdd5e17c Add sprite particle effects and improve lens distortion
- 스프라이트 기반 파티클 이펙트 관리 기능 추가 (SpriteEffectManager)
- 렌즈 왜곡 셰이더 로직 개선 및 픽셀 공간 기준 등방성 확대 적용
- 파티클 최적화를 위한 오브젝트 풀링(SpriteParticlePool) 도입
- DistortionArea 타입에 spriteEffects 설정 필드 추가
- ThreeScene에 씬 객체 접근 기능 및 렌더 순서 제어 추가
- useMouseInteraction 훅에서 마우스 상태 조회 기능 추가
- 버전 1.3.0 업데이트 및 관련 타입 정의 반영
2026-03-10 13:24:12 +09:00
BaekRyang
6d9dd082c1 Add lens effect and step easing functions
- 단계별(Step) 이징 함수 추가 (steps2 ~ steps10)
- 영역별 렌즈 왜곡 효과(볼록/오목) 기능 및 셰이더 로직 추가
- 에디터 파라미터 패널에 렌즈 효과 슬라이더 및 스텝 이징 옵션 추가
- 관련 상수, 타입 정의 및 유니폼 변수 업데이트
- 패키지 버전 업데이트 (1.2.7)
2026-02-25 14:35:45 +09:00
BaekRyang
031230bc36 feat: Improve canvas resizing and animation handling
- EditorCanvas:
  - 컨테이너 크기 측정 로직을 ResizeObserver를 사용하여 개선했습니다.
  - 초기 크기 설정 및 크기 변경 감지 기능을 추가했습니다.
  - 컨테이너의 width, height 스타일을 '100%'로 변경하여 부모 요소에 맞게 조절되도록 했습니다.
- ImageDistortion:
  - isPlaying prop을 제거하고 애니메이션을 항상 실행하도록 변경했습니다.
  - useAnimationFrame의 실행 조건을 항상 true로 설정하여 애니메이션 루프가 안정적으로 동작하도록 했습니다.
- package.json:
  - 버전 정보를 1.2.1에서 1.2.6으로 업데이트했습니다.
2025-11-28 16:37:20 +09:00
BaekRyang
e08f34caab feat: Add per-area physics configuration
- 영역별 물리 설정 `physics` 옵션을 추가했습니다.
- `useMouseInteraction` 훅에서 영역별 물리 설정을 적용하도록 수정했습니다.
- `ImageDistortion` 컴포넌트에서 `selectedAreaId` prop을 제거하고, 마우스 인터랙션 시 `interactingAreaIndices`를 활용하도록 변경했습니다.
- 셰이더에서 텍스처 좌표가 범위를 벗어날 때 부드럽게 페이드 아웃되도록 수정했습니다.
2025-11-24 14:23:06 +09:00
BaekRyang
4bdae13f7f feat: Add isDragging hook to mouse interaction
- useMouseInteraction 훅에 isDragging 함수를 추가했습니다.
- ImageDistortion 컴포넌트의 애니메이션 콜백에서 마우스 드래그 상태를 감지하여,
  드래그 중일 때는 자동 애니메이션의 dragVector를 0으로 설정하도록 로직을 개선했습니다.
2025-11-24 13:48:06 +09:00
BaekRyang
c18f3fffb5 Refactor: Update import paths with alias
- `@/types` 경로를 사용하여 타입 관련 import 경로를 수정했습니다.
- `@/engine` 경로를 사용하여 엔진 관련 import 경로를 수정했습니다.
- `@/editor` 경로를 사용하여 에디터 관련 import 경로를 수정했습니다.
- `@/components` 경로를 사용하여 컴포넌트 관련 import 경로를 수정했습니다.
- `@/hooks` 경로를 사용하여 훅 관련 import 경로를 수정했습니다.
- `@/utils` 경로를 사용하여 유틸리티 관련 import 경로를 수정했습니다.
2025-11-06 09:41:12 +09:00
BaekRyang
7f6a72c058 feat: Add mouse interaction for physics-based distortion
- 마우스 움직임에 따라 왜곡 영역이 튕기는 효과를 추가했습니다.
- `useMouseVelocity` 훅을 사용하여 마우스 속도와 가속도를 추적합니다.
- `SpringPhysics` 클래스를 구현하여 스프링 기반 물리 효과를 시뮬레이션합니다.
- `useMouseInteraction` 훅은 마우스 이벤트를 감지하고 `SpringPhysics`를 제어하여 왜곡 영역의 `dragVector`를 업데이트합니다.
- `ImageDistortion` 컴포넌트에서 `mouseInteraction` prop을 통해 이 기능을 활성화/설정할 수 있습니다.
2025-11-05 14:56:36 +09:00
BaekRyang
ef992b5525 fix: Fix coordinate system to match Flutter implementation
- Fix y-coordinate inversion between UI (top-left origin) and WebGL (bottom-left origin)
- Convert UI coordinates to WebGL coordinates when passing to shader
- Invert drag vector y-direction to match coordinate system
- Add getResolution() method to ThreeScene for coordinate conversion
- Update shader to use normalized drag vectors directly

This resolves the issue where distortion appeared at opposite y-position from clicked point.
2025-11-05 11:20:07 +09:00
BaekRyang
e371321fd2 feat: Fix image distortion shader and improve loading state
- Fix distortion.frag.glsl to match Flutter original implementation
  - Update computeUV function with single Newton-Raphson iteration
  - Fix coordinate transformation (normalized to pixel)
  - Fix distortion application logic
  - Add break after first matching area (Flutter behavior)

- Add image loading state management
  - Add imageLoaded state
  - Add loading progress callback
  - Add loading UI indicator
  - Improve error handling

- Add comprehensive debug logging
  - ShaderManager: fetch status and shader lengths
  - ThreeScene: shader compilation check, render calls
  - ImageDistortion: lifecycle and loading status

- Add test/debug shaders for troubleshooting
  - test.frag.glsl: Simple pass-through shader
  - debug.frag.glsl: Area visualization shader

- Fix infinite loop bug in animationCallback
  - Use setState updater function to avoid dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 11:51:39 +09:00
BaekRyang
c3b5aaadcb Debug: Add more detailed logging for containerRef 2025-11-04 10:55:43 +09:00
BaekRyang
d66c43f6f1 Debug: Add console logs for troubleshooting 2025-11-04 10:49:38 +09:00
BaekRyang
05b47fb177 Fix: Resolve infinite loop in animationCallback using setState with updater function 2025-11-04 10:45:44 +09:00
BaekRyang
808ddd99ec init 2025-11-04 10:15:34 +09:00