Skip to content

Commit b0df3fb

Browse files
TimJentzschalice-i-cecileIceSentry
authored
Document why examples are disabled on the web, pass 1 (#19262)
# Objective With the Bevy CLI, we now have an easy way to locally test if examples work on the web. We should start to explicitly document why examples don't work on the web to keep track and to ensure that as many examples are enabled as possible. ## Solution - Go through the examples with `wasm = false` and check if they really don't work - If they don't work, try to figure out why by looking through the code and announcement posts (we need better docs for this please) and add a comment explaining it - The `lightmap` example seemed to work without problems, so I enabled it ## Testing Install the [Bevy CLI](https://github.com/TheBevyFlock/bevy_cli) and run: ``` bevy run --example={example_name} web --open ``` # Future Work - There are about 100 more examples with `wasm = false` that also need to be documeneted - Also improve the documentation on the related features/plugins/types to make it easier for users to determine what they can use --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
1 parent 6729208 commit b0df3fb

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Cargo.toml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ doc-scrape-examples = true
868868
name = "Texture Atlas"
869869
description = "Generates a texture atlas (sprite sheet) from individual sprites"
870870
category = "2D Rendering"
871+
# Loading asset folders is not supported in Wasm, but required to create the atlas.
871872
wasm = false
872873

873874
[[example]]
@@ -945,6 +946,7 @@ doc-scrape-examples = true
945946
name = "2D Wireframe"
946947
description = "Showcases wireframes for 2d meshes"
947948
category = "2D Rendering"
949+
# PolygonMode::Line wireframes are not supported by WebGL
948950
wasm = false
949951

950952
# 3D Rendering
@@ -1012,6 +1014,7 @@ doc-scrape-examples = true
10121014
name = "Anti-aliasing"
10131015
description = "Compares different anti-aliasing methods"
10141016
category = "3D Rendering"
1017+
# TAA not supported by WebGL
10151018
wasm = false
10161019

10171020
[[example]]
@@ -1056,6 +1059,7 @@ doc-scrape-examples = true
10561059
name = "Auto Exposure"
10571060
description = "A scene showcasing auto exposure"
10581061
category = "3D Rendering"
1062+
# Requires compute shaders, which are not supported by WebGL.
10591063
wasm = false
10601064

10611065
[[example]]
@@ -1123,6 +1127,7 @@ doc-scrape-examples = true
11231127
name = "Screen Space Ambient Occlusion"
11241128
description = "A scene showcasing screen space ambient occlusion"
11251129
category = "3D Rendering"
1130+
# Requires compute shaders, which are not supported by WebGL.
11261131
wasm = false
11271132

11281133
[[example]]
@@ -1222,6 +1227,7 @@ doc-scrape-examples = true
12221227
name = "Order Independent Transparency"
12231228
description = "Demonstrates how to use OIT"
12241229
category = "3D Rendering"
1230+
# Not supported by WebGL
12251231
wasm = false
12261232

12271233
[[example]]
@@ -1321,7 +1327,7 @@ doc-scrape-examples = true
13211327
name = "Skybox"
13221328
description = "Load a cubemap texture onto a cube like a skybox and cycle through different compressed texture formats."
13231329
category = "3D Rendering"
1324-
wasm = false
1330+
wasm = true
13251331

13261332
[[example]]
13271333
name = "solari"
@@ -1432,6 +1438,7 @@ doc-scrape-examples = true
14321438
name = "Wireframe"
14331439
description = "Showcases wireframe rendering"
14341440
category = "3D Rendering"
1441+
# Not supported on WebGL
14351442
wasm = false
14361443

14371444
[[example]]
@@ -1443,6 +1450,8 @@ doc-scrape-examples = true
14431450
name = "Irradiance Volumes"
14441451
description = "Demonstrates irradiance volumes"
14451452
category = "3D Rendering"
1453+
# On WebGL and WebGPU, the number of texture bindings is too low
1454+
# See <https://github.com/bevyengine/bevy/issues/11885>
14461455
wasm = false
14471456

14481457
[[example]]
@@ -1455,6 +1464,7 @@ required-features = ["meshlet"]
14551464
name = "Meshlet"
14561465
description = "Meshlet rendering for dense high-poly scenes (experimental)"
14571466
category = "3D Rendering"
1467+
# Requires compute shaders and WGPU extensions, not supported by WebGL nor WebGPU.
14581468
wasm = false
14591469
setup = [
14601470
[
@@ -1490,7 +1500,7 @@ doc-scrape-examples = true
14901500
name = "Lightmaps"
14911501
description = "Rendering a scene with baked lightmaps"
14921502
category = "3D Rendering"
1493-
wasm = false
1503+
wasm = true
14941504

14951505
[[example]]
14961506
name = "no_prepass"
@@ -1643,6 +1653,7 @@ doc-scrape-examples = true
16431653
name = "Custom Loop"
16441654
description = "Demonstrates how to create a custom runner (to update an app manually)"
16451655
category = "Application"
1656+
# Doesn't render anything, doesn't create a canvas
16461657
wasm = false
16471658

16481659
[[example]]
@@ -1654,6 +1665,7 @@ doc-scrape-examples = true
16541665
name = "Drag and Drop"
16551666
description = "An example that shows how to handle drag and drop in an app"
16561667
category = "Application"
1668+
# Browser drag and drop is not supported
16571669
wasm = false
16581670

16591671
[[example]]
@@ -1665,6 +1677,7 @@ doc-scrape-examples = true
16651677
name = "Empty"
16661678
description = "An empty application (does nothing)"
16671679
category = "Application"
1680+
# Doesn't render anything, doesn't create a canvas
16681681
wasm = false
16691682

16701683
[[example]]
@@ -1688,6 +1701,7 @@ required-features = ["bevy_log"]
16881701
name = "Headless"
16891702
description = "An application that runs without default plugins"
16901703
category = "Application"
1704+
# Doesn't render anything, doesn't create a canvas
16911705
wasm = false
16921706

16931707
[[example]]
@@ -1710,6 +1724,8 @@ doc-scrape-examples = true
17101724
name = "Log layers"
17111725
description = "Illustrate how to add custom log layers"
17121726
category = "Application"
1727+
# Accesses `time`, which is not available on the web
1728+
# Also doesn't render anything
17131729
wasm = false
17141730

17151731
[[example]]
@@ -1721,6 +1737,7 @@ doc-scrape-examples = true
17211737
name = "Advanced log layers"
17221738
description = "Illustrate how to transfer data between log layers and Bevy's ECS"
17231739
category = "Application"
1740+
# Doesn't render anything, doesn't create a canvas
17241741
wasm = false
17251742

17261743
[[example]]

0 commit comments

Comments
 (0)