Skip to content

Commit

Permalink
Renamed point light to omni light (#447)
Browse files Browse the repository at this point in the history
* Renamed point light to omni light

playcanvas/editor#801

* Apply suggestions from code review

* Updated point to omni

Co-authored-by: Steven Yau <[email protected]>
  • Loading branch information
yaustar and steveny-sc authored Nov 15, 2022
1 parent a1cf246 commit e330923
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion content/en/tutorials/controlling-lights.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ These lines assign values to r, g and b variables based on a sin wave and then a

## General setup

We added a spot light (attached to a parent assembly of a basic torch model), a point light attached to a parent sphere model, in addition to the default directional light that is created for every new Scene. The controlling script was attached to the root entity. The sphere and torch were made children of a blank entity residing in the centre of the scene to enable easy rotation. The [full Editor scene and scripts can be accessed here][2] in the 'controllingLights' Scene.
We added a spot light (attached to a parent assembly of a basic torch model), an omni light attached to a parent sphere model, in addition to the default directional light that is created for every new Scene. The controlling script was attached to the root entity. The sphere and torch were made children of a blank entity residing in the centre of the scene to enable easy rotation. The [full Editor scene and scripts can be accessed here][2] in the 'controllingLights' Scene.

The full code used for the above PlayCanvas app is as follows.

Expand Down
4 changes: 2 additions & 2 deletions content/en/tutorials/light-cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ thumb: https://s3-eu-west-1.amazonaws.com/images.playcanvas.com/projects/12/4097

Find out more by forking the [full project][1].

In theatre it is common to create visual effects on stage by using shape masks to cast shadows across the scene. These masks are called "cucoloris" or "cookies". Creating a light cookie in WebGL using PlayCanvas is achieved using a texture or a cubemap that is applied to the Light Component. Light Cookies are applicable to spot lights and point lights.
In theatre it is common to create visual effects on stage by using shape masks to cast shadows across the scene. These masks are called "cucoloris" or "cookies". Creating a light cookie in WebGL using PlayCanvas is achieved using a texture or a cubemap that is applied to the Light Component. Light Cookies are applicable to spot lights and omni lights.

![Grid Cookie][2]
**A simple grid cookie gives the impression of a window**
Expand All @@ -22,7 +22,7 @@ A cookie texture is just a regular texture asset which is applied to a spot ligh

## Cookie Cubemap

For a point light the cookie needs to be a cubemap so that it can be projected in 6 directions around the point of the light.
For an omni light the cookie needs to be a cubemap so that it can be projected in 6 directions around the point of the light.

## Use Cases

Expand Down
2 changes: 1 addition & 1 deletion content/en/user-manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can create a new Entity by clicking on the <span class="pc-icon">&#57632;</s

## How do I create a light?

You can create a light by adding a **Light** component to an Entity. You can also right click on an Entity and select New Entity / Directional Light to create a new directional light and similarly for spot lights and point lights.
You can create a light by adding a **Light** component to an Entity. You can also right click on an Entity and select New Entity / Directional Light to create a new directional light and similarly for spot lights and omni lights.

[Learn more](https://developer.playcanvas.com/en/user-manual/packs/components/light/)

Expand Down
2 changes: 1 addition & 1 deletion content/en/user-manual/graphics/lighting/shadows.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The shadow sampling type is specified per light and so the option can be found i

Enabling shadows has performance implications:

* For each shadow casting directional or spot light, the scene must be rendered once into a shadow map every frame. Point light shadows are far more expensive since the scene is rendered six times per light (the shadow map is stored as a 6-sided cube map). Rendering the scene into shadow maps places load on both the CPU and the GPU.
* For each shadow casting directional or spot light, the scene must be rendered once into a shadow map every frame. Omni light shadows are far more expensive since the scene is rendered six times per light (the shadow map is stored as a 6-sided cube map). Rendering the scene into shadow maps places load on both the CPU and the GPU.
* Using a greater shadow map resolution with generate crisper shadows but the GPU must fill more shadow map pixels and therefore this may affect frame rate.
* Selecting soft shadows (PCF3x3) for the shadow sample type on a shadow receiving material is more expensive on the GPU versus the hard shadows option.
* If your shadows are from static parts of the environment consider using [lightmaps][4] to bake shadows into textures.
Expand Down
2 changes: 1 addition & 1 deletion content/en/user-manual/optimization/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here are some tips and hints on how to achieve good performance in your PlayCanv
## Graphics - CPU and GPU

* For applications where there is little visual change over a period such as product configurators, there is a specialist property to reduce CPU and GPU usage. [`pc.Application#autoRender`][3] can be set to `false` so that frames are rendered on demand via [`pc.Application#renderNextFrame`][4] when there is a visual change such as the user moving the camera or adding a part to the product.
* Enabling shadow casting on dynamic lights is expensive. Point light shadows are particularly expensive. For each point light that casts shadow, the scene must be rendered 6 times into a shadow map.
* Enabling shadow casting on dynamic lights is expensive. Omni light shadows are particularly expensive. For each omni light that casts shadow, the scene must be rendered 6 times into a shadow map.
* Keep the number of blended mesh instances in your scene to a minimum. Blended meshes are deferred until all opaque mesh instances have been dispatched and are then submitted in back to front camera depth order. This results in pixels being filled multiple times and can result in a lot of render state changes since blended meshes cannot be sorted by material.

## Physics
Expand Down
14 changes: 7 additions & 7 deletions content/en/user-manual/packs/components/light.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ The Light component can be enabled or disabled using the toggle in the top right

![Light component (Directional)][1]

#### Point
#### Omni

![Light component (Point)][2]
![Light component (Omni)][2]

#### Spot

Expand All @@ -24,11 +24,11 @@ The Light component can be enabled or disabled using the toggle in the top right

| Property | Description |
|--------------------|-------------|
| Type | Can be: <ul><li>Directional: a light casting in a uniform direction</li><li>Point: a light casting in all directional around a point</li><li>Spot: a light casting from the apex of a cone</li></ul> |
| Type | Can be: <ul><li>Directional: a light casting in a uniform direction</li><li>Omni: a light casting in all directional around an omni</li><li>Spot: a light casting from the apex of a cone</li></ul> |
| Color | The color of the emitted light. |
| Intensity | The intensity of the light, this acts as a scalar value for the light's color. This value can exceed 1. |
| Range | Point and Spot only. The distance from the spotlight source at which its contribution falls to zero. |
| Falloff Mode | Point and spot only. Controls the rate at which a light attenuates from its position. |
| Range | Omni and Spot only. The distance from the spotlight source at which its contribution falls to zero. |
| Falloff Mode | Omni and spot only. Controls the rate at which a light attenuates from its position. |
| Cone Angle | Spot only. The inner and outer cone angles, measured from the spotlight's direction, at which light falls from its maximum to zero. |
| Bake Lightmap | Enable lightmap baking from this light. |
| Affect | Determines which types of objects are lit by this light. Can be any combination of dynamically lit or lightmapped objects. |
Expand All @@ -38,8 +38,8 @@ The Light component can be enabled or disabled using the toggle in the top right
| Distance | Directional lights only. The shadow distance is the maximum distance from the camera beyond which shadows that come from Directional Lights are no longer visible. Smaller values produce more detailed shadows. The closer the limit the less shadow data has to be mapped to, and represented by, any shadow map; shadow map pixels are mapped spatially and so the less distance the shadow map has to cover, the smaller the pixels and so the more resolution any shadow has. |
| Shadow Type | The shadow mapping algorithm to use. The selection will affect the appearance and performance of the shadows. Can be: <ul><li>Shadow Map: PCF (Percentage Closer Filtering) shadowmaps.</li><li>Variance Shadow Map (8bit): Low precision shadowmaps. VSM is generally softer than PCF shadows.</li><li>Variance Shadow Map (16bit): Medium precision shadowmaps. Uses twice as much VRAM as 8 bit VSM.</li><li>Variance Shadow Map (32bit): High precision shadowmaps. Uses twice as much VRAM as 16 bit VSM.</li></ul> |
| Shadow Bias | Bias values enable the tuning of shadows in order to eliminate rendering artifacts, namely 'shadow acne' and 'peter-panning'. The two values are a shadow bias and a normal offset bias. |
| Cookie | Point and spot only. A texture asset to be projected from the light. |
| Cookie Intensity | Point and spot only. Defines the strength of the cookie texture. |
| Cookie | Omni and spot only. A texture asset to be projected from the light. |
| Cookie Intensity | Omni and spot only. Defines the strength of the cookie texture. |
| Cookie Falloff | Spot only. Disable the spotlight falloff. |

## Scripting Interface
Expand Down
4 changes: 2 additions & 2 deletions content/en/user-manual/xr/optimizing-webxr.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A high and consistent framerate is critical for making an enjoyable XR experienc

For AR experiences, framerates must be managed carefully as world, image and face tracking effects sometimes incur significant performance costs. This is in addition to the typically performance-constrained mobile hardware most users have access to.

For VR experiences, rendering is especially expensive due to the fact that the scene must be rendered once for each view (eye). While PlayCanvas is highly optimized to ensure VR rendering doesn't fully duplicate effort, stereo rendering remains more expensive than mono rendering.
For VR experiences, rendering is especially expensive due to the fact that the scene must be rendered once for each view (eye). While PlayCanvas is highly optimized to ensure VR rendering doesn't fully duplicate effort, stereo rendering remains more expensive than mono rendering.

In addition, devices like the Oculus Rift and HTC Vive demand high frame rates, like 75Hz or 90Hz, further increasing the need for highly efficient rendering. Mobile VR, whilst not requiring high framerates, suffer from the lack of native support for distortion effects, incurring additional overhead on a JavaScript and WebGL layer.

Expand All @@ -24,7 +24,7 @@ Read more about using [runtime lightmap generation][1].

### Cautious use of real time shadows

For similar reasons to dynamic lights, dynamic shadows also have a per-frame runtime cost. Point lights, in particular, have to render the scene 6 times to generate shadows. You should avoid having many lights casting dynamic shadows.
For similar reasons to dynamic lights, dynamic shadows also have a per-frame runtime cost. Omni lights, in particular, have to render the scene 6 times to generate shadows. You should avoid having many lights casting dynamic shadows.

### Watch your fill rate and overdraw

Expand Down
2 changes: 1 addition & 1 deletion faq/create_light.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ keywords: component, light, sun, shadows, directional, spot, point

## How do I create a light?

You can create a light by adding a **Light** component to an Entity. You can also right click on an Entity and select New Entity / Directional Light to create a new directional light and similarly for spot lights and point lights.
You can create a light by adding a **Light** component to an Entity. You can also right click on an Entity and select New Entity / Directional Light to create a new directional light and similarly for spot lights and omni lights.

[Learn more](https://developer.playcanvas.com/en/user-manual/packs/components/light/)

0 comments on commit e330923

Please sign in to comment.