2
0

WebGLRenderer.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. WebGL Render 用[link:https://en.wikipedia.org/wiki/WebGL WebGL]渲染出你精心制作的场景。
  14. </p>
  15. <h2>构造器</h2>
  16. <h3>[name]( [param:Object parameters] )</h3>
  17. <p>
  18. [page:Object parameters] - (可选) 该对象的属性定义了渲染器的行为。也可以完全不传参数。在所有情况下,当缺少参数时,它将采用合理的默认值。
  19. 以下是合法参数:<br /><br />
  20. [page:DOMElement canvas] - 一个供渲染器绘制其输出的[link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas]
  21. 它和下面的[page:WebGLRenderer.domElement domElement]属性对应。
  22. 如果没有传这个参数,会创建一个新canvas<br />
  23. [page:WebGLRenderingContext context] - 可用于将渲染器附加到已有的渲染环境([link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext])中。默认值是null<br />
  24. [page:String precision] - 着色器精度. 可以是 *"highp"*, *"mediump"* 或者 *"lowp"*.
  25. 如果设备支持,默认为*"highp"* . 点击[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices here] 查看"应该避免的事"<br />
  26. [page:Boolean alpha] - canvas是否包含alpha (透明度)。默认为 *false*<br />
  27. [page:Boolean premultipliedAlpha] - renderer是否假设颜色有
  28. [link:https://en.wikipedia.org/wiki/Glossary_of_computer_graphics#Premultiplied_alpha premultiplied alpha].
  29. 默认为*true* <br />
  30. [page:Boolean antialias] - 是否执行抗锯齿。默认为*false*.<br />
  31. [page:Boolean stencil] - 绘图缓存是否有一个至少8位的模板缓存([link:https://en.wikipedia.org/wiki/Stencil_buffer stencil buffer])。默认为*true*<br />
  32. [page:Boolean preserveDrawingBuffer] -是否保留缓直到手动清除或被覆盖。 默认*false*.<br />
  33. [page:String powerPreference] - 提示用户代理怎样的配置更适用于当前WebGL环境。 可能是*"high-performance"*, *"low-power"* 或 *"default"*。默认是*"default"*.
  34. 详见[link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 WebGL spec]<br />
  35. [page:Boolean failIfMajorPerformanceCaveat] - whether the renderer creation will fail upon low perfomance is detected. Default is *false*.
  36. See [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 WebGL spec] for details.<br />
  37. [page:Boolean depth] - 绘图缓存是否有一个至少6位的深度缓存([link:https://en.wikipedia.org/wiki/Z-buffering depth buffer] )。
  38. 默认是*true*.<br />
  39. [page:Boolean logarithmicDepthBuffer] - 是否使用对数深度缓存。如果要在单个场景中处理巨大的比例差异,就有必要使用。
  40. Note that this setting uses gl_FragDepth if available which disables the [link:https://www.khronos.org/opengl/wiki/Early_Fragment_Test Early Fragment Test]
  41. optimization and can cause a decrease in performance.
  42. 默认是*false*。 示例:[example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer]
  43. </p>
  44. <h2>属性</h2>
  45. <h3>[property:Boolean autoClear]</h3>
  46. <p>定义渲染器是否在渲染每一帧之前自动清除其输出。</p>
  47. <h3>[property:Boolean autoClearColor]</h3>
  48. <p>
  49. 如果[page:.autoClear autoClear]为true, 定义renderer是否清除颜色缓存。
  50. 默认是*true*
  51. </p>
  52. <h3>[property:Boolean autoClearDepth]</h3>
  53. <p>
  54. 如果[page:.autoClear autoClear]是true, 定义renderer是否清除深度缓存。
  55. 默认是*true*
  56. </p>
  57. <h3>[property:Boolean autoClearStencil]</h3>
  58. <p>
  59. 如果[page:.autoClear autoClear]是true, 定义renderer是否清除模板缓存.
  60. 默认是*true*
  61. </p>
  62. <h3>[property:Boolean debug.checkShaderErrors]</h3>
  63. <p>
  64. 如果[page:.checkShaderErrors checkShaderErrors]为true,定义是否检查材质着色器程序
  65. 编译和链接过程中的错误。 禁用此检查生产以获得性能增益可能很有用。
  66. 强烈建议在开发期间保持启用这些检查。
  67. 如果着色器没有编译和链接 - 它将无法工作,并且相关材料将不会呈现。
  68. 默认是*true*
  69. </p>
  70. <h3>[property:Object capabilities]</h3>
  71. <p>
  72. 一个包含当前渲染环境([link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext])的功能细节的对象。<br />
  73. - [page:Boolean floatFragmentTextures]: 环境是否支持[link:https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float OES_texture_float]扩展。
  74. 根据[link:https://webglstats.com/ WebGLStats], 截至2016年2月,超过95%的支持WebGL的设备支持此功能<br />
  75. - [page:Boolean floatVertexTextures]: 如果[page:Boolean floatFragmentTextures]和[page:Boolean vertexTextures]都是true, 则此值为*true* <br />
  76. - [page:Method getMaxAnisotropy](): 返回最大可用各向异性。<br />
  77. - [page:Method getMaxPrecision](): 返回顶点着色器和片元着色器的最大可用精度。 <br />
  78. - [page:Boolean isWebGL2]: *true* if the context in use is a WebGL2RenderingContext object.<br />
  79. - [page:Boolean logarithmicDepthBuffer]: 如果[page:parameter logarithmicDepthBuffer]在构造器中被设为true且
  80. 环境支持[link:https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth EXT_frag_depth]扩展,则此值为*true*
  81. 根据[link:https://webglstats.com/ WebGLStats], 截至2016年2月, 约66%的支持WebGL的设备支持此功能<br />
  82. - [page:Integer maxAttributes]: *gl.MAX_VERTEX_ATTRIBS*的值<br />
  83. - [page:Integer maxCubemapSize]: *gl.MAX_CUBE_MAP_TEXTURE_SIZE* 的值,着色器可使用的立方体贴图纹理的最大宽度*高度<br />
  84. - [page:Integer maxFragmentUniforms]: *gl.MAX_FRAGMENT_UNIFORM_VECTORS*的值,片元着色器可使用的全局变量(uniforms)数量<br />
  85. - [page:Integer maxTextureSize]: *gl.MAX_TEXTURE_SIZE*的值,着色器可使用纹理的最大宽度*高度<br />
  86. - [page:Integer maxTextures]: *gl.MAX_TEXTURE_IMAGE_UNITS的值,着色器可使用的纹理数量<br />
  87. - [page:Integer maxVaryings]: *gl.MAX_VARYING_VECTORS*的值,着色器可使用矢量的数量<br />
  88. - [page:Integer maxVertexTextures]: *gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS*的值,顶点着色器可使用的纹理数量。<br />
  89. - [page:Integer maxVertexUniforms]: *gl.MAX_VERTEX_UNIFORM_VECTORS*的值,顶点着色器可使用的全局变量(uniforms)数量<br />
  90. - [page:String precision]: 渲染器当前使用的着色器的精度<br />
  91. - [page:Boolean vertexTextures]: 如果[property:Integer maxVertexTextures]大于0,此值为*true* (即可以使用顶点纹理)<br />
  92. </p>
  93. <h3>[property:Array clippingPlanes]</h3>
  94. <p>
  95. 用户自定义的剪裁平面,在世界空间中被指定为THREE.Plane对象。
  96. 这些平面全局使用。空间中与该平面点积为负的点将被切掉。
  97. 默认值是[]
  98. </p>
  99. <h3>[property:DOMElement domElement]</h3>
  100. <p>
  101. 一个[link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas],渲染器在其上绘制输出。<br />
  102. 渲染器的构造函数会自动创建(如果没有传入canvas参数);你需要做的仅仅是像下面这样将它加页面里去:<br />
  103. <code>
  104. document.body.appendChild( renderer.domElement );
  105. </code>
  106. </p>
  107. <h3>[property:Object extensions]</h3>
  108. <p>
  109. [page:WebGLRenderer.extensions.get .extensions.get]方法的包装, 用于检查是否支持各种WebGL扩展
  110. </p>
  111. <h3>[property:Float gammaFactor]</h3>
  112. <p>默认是 *2*. </p>
  113. <h3>[property:Boolean gammaInput]</h3>
  114. <p>如果设置,那么所有的纹理和颜色都会预乘gamma。 默认值是*false*.</p>
  115. <h3>[property:Boolean gammaOutput]</h3>
  116. <p>如果设置, 那么它期望所有纹理和颜色需要乘以gamma输出。 默认值*false*.</p>
  117. <h3>[property:Object info]</h3>
  118. <p>一个对象,包含有关图形板内存和渲染过程的一系列统计信息。这些信息可用于调试或仅仅满足下好奇心。改对象包含以下字段:</p>
  119. <p>
  120. <ul>
  121. <li>memory:
  122. <ul>
  123. <li>geometries</li>
  124. <li>textures</li>
  125. </ul>
  126. </li>
  127. <li>render:
  128. <ul>
  129. <li>calls</li>
  130. <li>triangles</li>
  131. <li>points</li>
  132. <li>lines</li>
  133. </ul>
  134. </li>
  135. <li>programs
  136. </li>
  137. </ul>
  138. </p>
  139. <p>默认情况下,每次调用渲染时这些数据都会重置。 但当时用一个或多个镜像时,最好使用自定义模式重置它们:
  140. <code>
  141. renderer.info.autoReset = false;
  142. renderer.info.reset();
  143. </code>
  144. </p>
  145. <h3>[property:Boolean localClippingEnabled]</h3>
  146. <p>定义渲染器是否考虑对象级剪切平面。 默认为*false*.</p>
  147. <h3>[property:Integer maxMorphTargets]</h3>
  148. <p>
  149. 默认是8。 一个着色器中允许的最大MorphTargets数。
  150. 切记标准材质只允许8个MorphTargets。
  151. </p>
  152. <h3>[property:Integer maxMorphNormals]</h3>
  153. <p>
  154. 默认是4。 色器中允许的最大MorphNormal数。
  155. 切记标准材质只允许4个MorphNormal。
  156. </p>
  157. <h3>[property:Boolean physicallyCorrectLights]</h3>
  158. <p>
  159. 是否使用物理上正确的光照模式。 默认是*false*。
  160. 示例:[example:webgl_lights_physical lights / physical]
  161. </p>
  162. <h3>[property:Object properties]</h3>
  163. <p>
  164. 渲染器内部使用,以跟踪各种子对象属性。
  165. </p>
  166. <h3>[property:WebGLRenderLists renderLists]</h3>
  167. <p>
  168. 在内部用于处理场景渲染对象的排序。
  169. </p>
  170. <h3>[property:WebGLShadowMap shadowMap]</h3>
  171. <p>
  172. 如果使用,它包含阴影贴图的引用。
  173. </p>
  174. <h3>[property:Boolean shadowMap.enabled]</h3>
  175. <p>如果设置, 请在场景中使用阴影贴图。 默认是 *false*</p>
  176. <h3>[property:Boolean shadowMap.autoUpdate]</h3>
  177. <p>启用场景中的阴影自动更新。默认是*true*</p>
  178. <p>如果不需要动态光照/阴影, 则可以在实例化渲染器时将之设为false</p>
  179. <h3>[property:Boolean shadowMap.needsUpdate]</h3>
  180. <p>当被设为*true*, 场景中的阴影贴图会在下次*render*调用时刷新。默认是*false* </p>
  181. <p>如果你已经禁用了阴影贴图的自动更新(*shadowMap.autoUpdate = false*), 那么想要在下一次渲染时更新阴影的话就需要将此值设为*true*</p>
  182. <h3>[property:Integer shadowMap.type]</h3>
  183. <p>定义阴影贴图类型 (未过滤, 关闭部分过滤, 关闭部分双线性过滤)</p>
  184. <p>可选值有THREE.BasicShadowMap, THREE.PCFShadowMap (默认), THREE.PCFSoftShadowMap 和 THREE.VSMShadowMap。详见[page:Renderer Renderer constants]</p>
  185. <h3>[property:Boolean sortObjects]</h3>
  186. <p>
  187. 定义渲染器是否应对对象进行排序。默认是*true*.<br /><br />
  188. 说明: 排序用于尝试正确渲染出具有一定透明度的对象。根据定义,排序可能不总是有用。根据应用的需求,可能需要关闭排序并使其他方法来处理透明度的渲染,例如,
  189. 手动确定每个对象的显然顺序。
  190. </p>
  191. <h3>[property:Object state]</h3>
  192. <p>
  193. 包含设置[page:WebGLRenderer.context]状态的各种属性的函数。
  194. </p>
  195. <h3>[property:Constant toneMapping]</h3>
  196. <p>
  197. 默认是[page:Renderer LinearToneMapping]。查看[page:Renderer Renderer constants]以获取其它备选项
  198. </p>
  199. <h3>[property:Number toneMappingExposure]</h3>
  200. <p>
  201. 色调映射的曝光级别。默认是*1*
  202. </p>
  203. <h3>[property:Number toneMappingWhitePoint]</h3>
  204. <p>
  205. 色调映射的白点。默认是*1*
  206. </p>
  207. <h2>方法</h2>
  208. <h3>[method:null clear]( [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] )</h3>
  209. <p>
  210. 告诉渲染器清除颜色、深度或模板缓存.
  211. 此方法将颜色缓存初始化为当前颜色。参数们默认都是*true*
  212. </p>
  213. <h3>[method:null clearColor]( )</h3>
  214. <p>清除颜色缓存。 相当于调用[page:WebGLRenderer.clear .clear]( true, false, false )</p>
  215. <h3>[method:null clearDepth]( )</h3>
  216. <p>清除深度缓存。相当于调用[page:WebGLRenderer.clear .clear]( false, true, false )</p>
  217. <h3>[method:null clearStencil]( )</h3>
  218. <p>清除模板缓存。相当于调用[page:WebGLRenderer.clear .clear]( false, false, true )</p>
  219. <h3>[method:null clearTarget]([param:WebGLRenderTarget renderTarget], [param:boolean color], [param:boolean depth], [param:boolean stencil])</h3>
  220. <p>
  221. renderTarget -- 需要被清除的[page:WebGLRenderTarget renderTarget]<br />
  222. color -- 如果设置, 颜色会被清除 <br />
  223. depth -- 如果设置, 深度缓存会被清除 <br />
  224. stencil -- 如果设置, 模板缓存会被清除
  225. </p>
  226. <p>
  227. 该方法清楚了一个rendertarget。为此它会激活此endertarget
  228. </p>
  229. <h3>[method:null compile]( [param:Scene scene], [param:Camera camera] )</h3>
  230. <p>使用相机编译场景中的所有材质。这对于在首次渲染之前预编译着色器很有用。</p>
  231. <h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
  232. <p>将当前WebGLFramebuffer中的像素复制到2D纹理中。可访问[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/copyTexImage2D WebGLRenderingContext.copyTexImage2D].</p>
  233. <h3>[method:null copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
  234. <p>将纹理的所有像素复制到一个已有的从给定位置开始的纹理中。可访问[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D WebGLRenderingContext.texSubImage2D].</p>
  235. <h3>[method:null dispose]( )</h3>
  236. <p>处理当前的渲染环境</p>
  237. <h3>[method:Object extensions.get]( [param:String extensionName] )</h3>
  238. <p>
  239. 用于检查是否支持各种扩展,并返回一个对象,其中包含扩展的详细信息。
  240. 该方法检查以下扩展:<br /><br />
  241. - *WEBGL_depth_texture*<br />
  242. - *EXT_texture_filter_anisotropic*<br />
  243. - *WEBGL_compressed_texture_s3tc*<br />
  244. - *WEBGL_compressed_texture_pvrtc*<br />
  245. - *WEBGL_compressed_texture_etc1*
  246. </p>
  247. <h3>[method:null forceContextLoss]( )</h3>
  248. <p>
  249. 模拟WebGL环境的丢失。需要支持
  250. [link:https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context WEBGL_lose_context]扩展才能用。
  251. 根据[link:https://webglstats.com/ WebGLStats], as of February 2016 90% of WebGL enabled devices support this.
  252. </p>
  253. <h3>[method:Float getClearAlpha]()</h3>
  254. <p>返回一个表示当前alpha值的[page:Float float],范围0到1</p>
  255. <h3>[method:Color getClearColor]()</h3>
  256. <p>返回一个表示当前颜色值的[page:Color THREE.Color]实例</p>
  257. <h3>[method:WebGLRenderingContext getContext]()</h3>
  258. <p>返回当前WebGL环境</p>
  259. <h3>[method:WebGLContextAttributes getContextAttributes]()</h3>
  260. <p>返回一个对象,这个对象中存有在WebGL环境在创建的时候所设置的属性</p>
  261. <h3>[method:Integer getActiveCubeFace]()</h3>
  262. <p>Returns the current active cube face.</p>
  263. <h3>[method:Integer getActiveMipmapLevel]()</h3>
  264. <p>Returns the current active mipmap level.</p>
  265. <h3>[method:RenderTarget getRenderTarget]()</h3>
  266. <p>如果当前存在[page:RenderTarget RenderTarget],则返回该值;否则返回*null*。</p>
  267. <h3>[method:RenderTarget getCurrentViewport]()</h3>
  268. <p>返回当前视口</p>
  269. <h3>[method:Object getDrawingBufferSize]()</h3>
  270. <p>返回一个包含渲染器绘图缓存宽度和高度(单位像素)的对象。</p>
  271. <h3>[method:number getPixelRatio]()</h3>
  272. <p>返回当前使用设备像素比</p>
  273. <h3>[method:Object getSize]()</h3>
  274. <p>返回包含渲染器输出canvas的宽度和高度(单位像素)的对象。</p>
  275. <h3>[method:null resetGLState]( )</h3>
  276. <p>将GL状态重置为默认值。WebGL环境丢失时会内部调用</p>
  277. <h3>[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget], [param:Float x], [param:Float y], [param:Float width], [param:Float height], [param:TypedArray buffer], [param:Integer activeCubeFaceIndex] )</h3>
  278. <p>buffer - Uint8Array is the only destination type supported in all cases, other types are renderTarget and platform dependent. See [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 WebGL spec] for details.</p>
  279. <p>将enderTarget中的像素数据读取到传入的缓冲区中。这是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels WebGLRenderingContext.readPixels]()的包装器<br />
  280. 示例:[example:webgl_interactive_cubes_gpu interactive / cubes / gpu]</p>
  281. <p>For reading out a [page:WebGLRenderTargetCube WebGLRenderTargetCube] use the optional parameter activeCubeFaceIndex to determine which face should be read.</p>
  282. <h3>[method:null render]( [param:Scene scene], [param:Camera camera], [param:WebGLRenderTarget renderTarget], [param:Boolean forceClear] )</h3>
  283. <p>
  284. 用相机([page:Camera camera])渲染一个场景([page:Scene scene])<br />
  285. 渲染一般是在canvas上完成的,或者是[page:WebGLRenderTarget renderTarget](如果有指定)<br />
  286. 如果[page:Boolean forceClear]值是*true*,那么颜色、深度及模板缓存将会在渲染之前清除,即使渲染器的[page:WebGLRenderer.autoClear autoClear]属性值是false<br />
  287. 即便forceClear设为true, 也可以通过将[page:WebGLRenderer.autoClearColor autoClearColor]、[page:WebGLRenderer.autoClearStencil autoClearStencil]或[page:WebGLRenderer.autoClearDepth autoClearDepth]属性的值设为false来阻止对应缓存被清除。
  288. </p>
  289. <h3>[method:null renderBufferDirect]( [param:Camera camera], [param:Fog fog], [param:Geometry geometry], [param:Material material], [param:Object3D object], [param:Object group] )</h3>
  290. <p>使用相机和指定材质渲染缓冲几何组。</p>
  291. <h3>[method:null renderBufferImmediate]( [param:Object3D object], [param:shaderprogram program], [param:Material shading] )</h3>
  292. <p>object - 一个[page:Object3D]实例<br />
  293. program - 一个shaderProgram实例<br />
  294. shading - 一个Material实例<br /><br />
  295. 渲染即使缓冲,由enderImmediateObject对象调用
  296. </p>
  297. <h3>[method:null setAnimationLoop]( [param:Function callback] )</h3>
  298. <p>[page:Function callback] — 每个可用帧都会调用的函数。 如果传入‘null’,所有正在进行的动画都会停止。</p>
  299. <p>可用来代替[link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]的内置函数. 对于WebVR项目,必须使用此函数。</p>
  300. <h3>[method:null setClearAlpha]( [param:Float alpha] )</h3>
  301. <p>设置alpha。合法参数是一个*0.0*到 *1.0*之间的浮点数</p>
  302. <h3>[method:null setClearColor]( [param:Color color], [param:Float alpha] )</h3>
  303. <p>设置颜色及其透明度</p>
  304. <h3>[method:null setPixelRatio]( [param:number value] )</h3>
  305. <p>设置设备像素比。通常用于避免HiDPI设备上绘图模糊</p>
  306. <h3>[method:null setRenderTarget]( [param:WebGLRenderTarget renderTarget], [param:Integer activeCubeFace], [param:Integer activeMipmapLevel] )</h3>
  307. <p>
  308. renderTarget -- 需要被激活的[page:WebGLRenderTarget renderTarget](可选)。若此参数为空,则将canvas设置成活跃render target。<br />
  309. activeCubeFace -- Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of [page:WebGLRenderTargetCube] (optional).<br />
  310. activeMipmapLevel -- Specifies the active mipmap level (optional).<br /><br />
  311. 该方法设置活跃rendertarget。
  312. </p>
  313. <h3>[method:null setScissor]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )</h3>
  314. <p>
  315. 将剪裁区域设为(x, y)到(x + width, y + height)
  316. Sets the scissor area from
  317. </p>
  318. <h3>[method:null setScissorTest]( [param:Boolean boolean] )</h3>
  319. <p>
  320. 启用或禁用剪裁检测. 若启用,则只有在所定义的裁剪区域内的像素才会受之后的渲染器影响。
  321. </p>
  322. <h3>[method:null setSize]( [param:Integer width], [param:Integer height], [param:Boolean updateStyle] )</h3>
  323. <p>
  324. 将输出canvas的大小调整为(width, height)并考虑设备像素比,且将视口从(0, 0)开始调整到适合大小
  325. 将[page:Boolean updateStyle]设置为false以阻止对canvas的样式做任何改变。
  326. </p>
  327. <h3>[method:null setViewport]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )</h3>
  328. <p>将视口大小设置为(x, y)到 (x + width, y + height).</p>
  329. <h2>源码</h2>
  330. <p>
  331. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  332. </p>
  333. </body>
  334. </html>