You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG-v3.50.md
+43-4Lines changed: 43 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,9 +97,9 @@ The WebGL Pipeline class now extends Event Emitter and emits the following event
97
97
* The `WebGL.Pipelines.Events.REBIND` event is dispatched by a WebGL Pipeline when the Pipeline Manager resets and rebinds it.
98
98
* The `WebGL.Pipelines.Events.RESIZE` event is dispatched by a WebGL Pipeline when it is resized, usually as a result of the Renderer.
99
99
100
-
### Pipeline Uniform Changes
100
+
### Pipeline Uniform Changes
101
101
102
-
WebGLShaders a`uniforms` object that is automatically populated when the shader is created. It scans all of the active uniforms from the compiled shader and then builds an object containing their `WebGLUniformLocation` and a value cache.
102
+
WebGLShaders have a `uniforms` object that is automatically populated when the shader is created. It scans all of the active uniforms from the compiled shader and then builds an object containing their `WebGLUniformLocation` and a value cache.
103
103
104
104
This saves redundant gl operations for both looking-up uniform locations and setting their values if they're already the currently set values by using the local cache instead.
105
105
@@ -249,7 +249,44 @@ The following properties and methods are available in the new `RenderTexture` cl
249
249
250
250
### Point Lights
251
251
252
-
TODO
252
+
The Point Light Game Object is brand new in 3.50 and provides a way to add a point light effect into your game, without the expensive shader processing requirements of the traditional Light Game Object.
253
+
254
+
The difference is that the Point Light renders using a custom shader, designed to give the impression of a radial light source, of variable radius, intensity and color, in your game. However, unlike the Light Game Object, it does not impact any other Game Objects, or use their normal maps for calcuations. This makes them extremely fast to render compared to Lights
255
+
and perfect for special effects, such as flickering torches or muzzle flashes.
256
+
257
+
For maximum performance you should batch Point Light Game Objects together. This means ensuring they follow each other consecutively on the display list. Ideally, use a Layer Game Object and then add just Point Lights to it, so that it can batch together the rendering of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in your game then it's perfectly safe to mix them into the dislay list as normal. However, if you're using a large number of them, please consider how they are mixed into the display list.
258
+
259
+
The renderer will automatically cull Point Lights. Those with a radius that does not intersect with the Camera will be skipped in the rendering list. This happens automatically and the culled state is refreshed every frame, for every camera.
260
+
261
+
The `PointLight` Game Object has the following unique properties and methods:
262
+
263
+
* The `PointLight.color` property is an instance of the Color object that controls the color value of the light.
264
+
* The `PointLight.intensity` property sets the intensity of the light. The colors of the light are multiplied by this value during rendering.
265
+
* The `PointLight.attenuation` property sets the attenuation of the light, which is the force with which the light falls off from its center.
266
+
* The `PointLight.radius` property sets the radius of the light, in pixels. This value is also used for culling.
267
+
268
+
Point Lights also have corresponding Factory and Creator functions, available from within a Scene:
269
+
270
+
```js
271
+
this.add.pointlight(x, y, color, radius, intensity, attenuation);
272
+
```
273
+
274
+
and
275
+
276
+
```js
277
+
this.make.pointlight({ x, y, color, radius, intensity, attenuation });
278
+
```
279
+
280
+
### Point Lights Pipeline
281
+
282
+
The Point Light Pipeline is a brand new pipeline in 3.50 that was creates specifically for rendering the new Point Light Game Objects in WebGL.
283
+
284
+
It extends the WebGLPipeline and sets the required shader attributes and uniforms for Point Light rendering.
285
+
286
+
You typically don't access or set the pipeline directly, but rather create instances of the Point Light Game Object instead. However, it does have the following unique methods:
287
+
288
+
* The `PointLightPipeline.batchPointLight` method is a special-case method that is called directly by the Point Light Game Object during rendering and allows it to add itself into the rendering batch.
289
+
* The `PointLightPipeline.batchLightVert` method is a special internal method, used by `batchPointLight` that adds a single Point Light vert into the batch.
253
290
254
291
### Utility Pipeline
255
292
@@ -1237,4 +1274,6 @@ My thanks to the following for helping with the Phaser 3 Examples, Docs, and Typ
1237
1274
1238
1275
A special mention to the following who submitted feedback on the the 3.50 Beta releases:
0 commit comments