You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.9 KiB
66 lines
1.9 KiB
2 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<base href="../../../" />
|
||
|
<script src="page.js"></script>
|
||
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
[page:Mesh] →
|
||
|
|
||
|
<h1>[name]</h1>
|
||
|
|
||
|
<p class="desc">
|
||
|
Creates a simulated lens flare that tracks a light. [name] can only be used when setting the `alpha` context parameter of [page:WebGLRenderer] to `true`.
|
||
|
</p>
|
||
|
|
||
|
<h2>Code Example</h2>
|
||
|
|
||
|
<code>
|
||
|
const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
|
||
|
|
||
|
const textureLoader = new THREE.TextureLoader();
|
||
|
|
||
|
const textureFlare0 = textureLoader.load( "textures/lensflare/lensflare0.png" );
|
||
|
const textureFlare1 = textureLoader.load( "textures/lensflare/lensflare2.png" );
|
||
|
const textureFlare2 = textureLoader.load( "textures/lensflare/lensflare3.png" );
|
||
|
|
||
|
const lensflare = new Lensflare();
|
||
|
|
||
|
lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );
|
||
|
lensflare.addElement( new LensflareElement( textureFlare1, 512, 0 ) );
|
||
|
lensflare.addElement( new LensflareElement( textureFlare2, 60, 0.6 ) );
|
||
|
|
||
|
light.add( lensflare );
|
||
|
</code>
|
||
|
|
||
|
<h2>Examples</h2>
|
||
|
|
||
|
<p>
|
||
|
[example:webgl_lensflares WebGL / lensflares]
|
||
|
</p>
|
||
|
|
||
|
<h2>Constructor</h2>
|
||
|
|
||
|
|
||
|
<h3>LensflareElement( [param:Texture texture], [param:Float size], [param:Float distance], [param:Color color] )</h3>
|
||
|
<p>
|
||
|
[page:Texture texture] - THREE.Texture to use for the flare. <br />
|
||
|
[page:Float size] - (optional) size in pixels <br />
|
||
|
[page:Float distance] - (optional) (0-1) from light source (0 = at light source) <br />
|
||
|
[page:Color color] - (optional) the [page:Color] of the lens flare
|
||
|
</p>
|
||
|
|
||
|
<h2>Properties</h2>
|
||
|
<p>See the base [page:Mesh] class for common properties.</p>
|
||
|
|
||
|
|
||
|
<h2>Source</h2>
|
||
|
|
||
|
<p>
|
||
|
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Lensflare.js examples/jsm/objects/Lensflare.js]
|
||
|
</p>
|
||
|
</body>
|
||
|
</html>
|