-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: 성능 개선 및 정리 #5
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- waterGeometry 해상도를 500에서 300으로 낮춰 activeWave 루프 성능 향상 - openGL에 DynamicDrawUsage 최적화 옵션 추가 - Vector3를 루프마다 할당하지 않고 재사용 - 벡터에서 z 좌표를 가져오는 대신 직접 할당 - wave와 activeWave를 별개 함수로 분리
유일한 카메라이므로, 모듈을 사용하는 것이 싱글톤 클래스 패턴보다 단순하다 판단했습니다.
화면에 눈에 띄는 변화가 없는 선에서 성능 향상에 도움이 되는 옵션들을 적용시켰습니다. 참고: https://discoverthreejs.com/tips-and-tricks/#renderer
- 레이캐스터를 재사용 - glb scene에서 병 모델만 추출 - 전체 scene 대신 개별 object를 레이캐스트
@scarf005 is attempting to deploy a commit to the 42Benefit Team on Vercel. A member of the Team first needs to authorize it. |
YeonSeong-Lee
approved these changes
Aug 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT. 아주 좋습니다~!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
개요
after.mp4
녹화하지 않고 로컬 실행시 마우스 이동 시에도 75fps 를 유지하며, 변경 전에 비해 5~7배 가량 성능을 올렸습니다.
변경 이후
변경 전
before.mp4
변경점
three/addons/
import 경로를three/examples/jsm
로 바꾸었습니다.<script>
태그만 있는 svelte 컴포넌트를 타입스크립트 파일로 전환했습니다.colorthief
패키지의d.ts
타입 파일을 작성했습니다.최적화
THREE.Vector3
같이 할당시 큰 부하가 걸리는 작업을 반복문 밖으로 꺼내 재사용했습니다.boundingbox
를 사용했습니다.scene.add
대신visible
속성값만을 수정하도록 했습니다.