1
0

XREstimatedLight.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Group] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. XREstimatedLight은 WebXR의 빛 추정 기능을 사용하여 광도계(light probe), 방향광(directional light) 그리고 (선택적으로) 환경 맵(environment
  14. map)을 생성하여 사용자의 현실 세계의 환경과 조명을 모델링합니다.<br>
  15. WebXR가 빛과 환경 추정을 업데이트할 때, XREstimatedLight는 자동으로 광도계, 방향광, 그리고 환경 맵을 업데이트합니다.<br><br>
  16. WebXR 세션을 생성할 때 `light-estimation`을 선택적 또는 필수 기능으로 지정하는 것이 중요합니다. 그렇지 않으면 빛 추정 기능은 작동하지 않습니다.<br><br>
  17. 브라우저 호환성 정보는 여기를 참조하십시오. 이는 아직 WebXR의 실험적 기능입니다. <a
  18. href="https://developer.mozilla.org/en-US/docs/Web/API/XRLightProbe#browser_compatibility">여기</a><br><br>
  19. 이를 사용하려면, /examples 디렉토리 내의 모든 파일과 마찬가지로, HTML에 별도로 파일을 포함해야 합니다.
  20. </p>
  21. <h2>가져오기</h2>
  22. <p>
  23. [name]은 애드온이므로 명시적으로 가져와야 합니다.
  24. [link:#manual/introduction/Installation 설치 / 애드온]을 참조하십시오.
  25. </p>
  26. <code>
  27. import { XREstimatedLight } from 'three/addons/webxr/XREstimatedLight.js';
  28. </code>
  29. <h2>코드 예제</h2>
  30. <code>
  31. renderer.xr.enabled = true;
  32. // XREstimatedLight를 초기 시점에 장면에 추가하지 마세요.
  33. // AR 세션이 시작할 때까지 추정된 조명값이 없기 때문입니다.
  34. const xrLight = new XREstimatedLight( renderer );
  35. xrLight.addEventListener( 'estimationstart' , () => {
  36. scene.add( xrLight );
  37. if ( xrLight.environment ) {
  38. scene.environment = xrLight.environment;
  39. }
  40. } );
  41. xrLight.addEventListener( 'estimationend', () => {
  42. scene.remove( xrLight );
  43. scene.environment = null;
  44. } );
  45. // 조명 추정 기능을 작동하도록 하려면 'light-estimation'을 선택적 또는 필수 기능으로 포함해야 합니다.
  46. document.body.appendChild( XRButton.createButton( renderer, {
  47. optionalFeatures: [ 'light-estimation' ]
  48. } ) );
  49. </code>
  50. <h2>예제</h2>
  51. <p>[example:webxr_ar_lighting webxr / light estimation]</p>
  52. <h2>생성자</h2>
  53. <h3>[name]( [param:WebGLRenderer renderer], [param:Boolean environmentEstimation] )</h3>
  54. <p>
  55. [page:WebGLRenderer renderer]: (필수) 장면을 렌더링하는 렌더러. 주로 WebXRManager와 상호작용하는 데 사용됩니다.<br><br>
  56. environmentEstimation: `true`로 설정하면 WebXR을 사용하여 환경 맵을 추정합니다.
  57. </p>
  58. <h2>이벤트</h2>
  59. <h3>estimationstart</h3>
  60. <p>
  61. 추정된 조명값이 업데이트 시작할 때 발생합니다.
  62. </p>
  63. <h3>estimationend</h3>
  64. <p>
  65. 추정된 조명값이 업데이트 중지할 때 발생합니다.
  66. </p>
  67. <h2>속성</h2>
  68. <h3>[property:Texture environment]</h3>
  69. <p>
  70. WebXR에 의해 추정된 환경 맵입니다. 이는 environmentEstimation이 `true`로 설정된 경우에만 사용할 수 있습니다.<br><br>
  71. 이는 [page:Scene.environment], [page:MeshStandardMaterial.envMap], 또는 [page:Scene.background]로 사용할 수 있습니다.
  72. </p>
  73. <h2>소스</h2>
  74. <p>
  75. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/XREstimatedLight.js
  76. examples/jsm/webxr/XREstimatedLight.js]
  77. </p>
  78. </body>
  79. </html>