NatureGL Weatherv1.1.0

More

Troubleshooting

The common problems, what causes them, and the fix for each.

It rains under the roofs

The roof isn't in the occlusion map. If you called setOccluders([...]), add the roof (or its parent group) to the list. The objects must be in the scene when the map renders. If the roof moved after that, set weather.occlusion.needsUpdate = true. Also check that it doesn't have userData.weatherOccluder = false.

The ground under a roof is still wet or snowy

Shelter reads the same occlusion map, so the fix above applies. Also check the material is patched (weather.patchMaterial) and that the quality tier's shelterTaps isn't 0. Small covers such as lamp caps and sills are meant to keep almost nothing dry.

The image is washed out or looks tone-mapped twice

weather.render() has its own ACES tonemapper. Leave renderer.toneMapping at THREE.NoToneMapping when you use it. Set a tone mapping on the renderer only for the renderer.render() path.

There is no volumetric fog, only flat fog

Volumetric fog, light shafts and lamp halos come from weather.render(). With renderer.render() you get the THREE.FogExp2 fallback on scene.fog. See Render paths.

The fog has no light shafts

Pass a shadow-casting light: weather.setLighting({ shadowLight: sun }) with sun.castShadow = true and renderer.shadowMap.enabled = true. Check that weather.fog.rays is true, and that sunDirection points at the same light.

Puddles don't appear

Puddles need a material patched with { ground: true } and more than 30 % wetness; they're full at 75 %. Check weather.wetness.wetness and weather.wetness.puddles. They never form under shelter or under snow cover. In the demo, drag Wetness up.

Puddles look black or flat

On the renderer.render() path, puddles reflect the material's environment map, so set scene.environment. Without one they reflect a sky tint. With weather.render(), SSR misses fall back to skyHorizon and skyZenith, which only take effect when you pass both.

setLighting({ skyHorizon }) does nothing

skyHorizon and skyZenith are only applied together. Pass both, or rely on ambient for the particle and fog light.

The rain is drawn under NatureGL Water's water

NatureGL Water draws transparent objects in its main pass under the water surface. Put the particles on its overlay layer: weather.setLayer(water.overlayLayer) or create({ layer }). Set weather.fog.sceneFog = false, and don't call weather.render(). See With other packs.

The rain disappeared after setLayer

The particle meshes are no longer on layer 0. If you render with renderer.render() or weather.render() yourself, enable the layer on the camera: camera.layers.enable(layer).

There's no sound

Audio is muted by default, and browsers only allow it after a user gesture. Call weather.audio.unmute() from a click or key handler.

patchMaterial logs a warning and nothing changes

Only MeshStandardMaterial and MeshPhysicalMaterial are supported. Lambert, Phong, Basic and custom ShaderMaterials are returned unchanged. For your own shaders, bind weather.uniforms yourself.

The page fails with "WebGL2 + EXT_color_buffer_float required"

The demo checks for both before starting. The pipeline renders to half-float targets, which needs EXT_color_buffer_float. Try a recent Chrome, Edge, Firefox or Safari, and check that hardware acceleration is on.

It's slow

Try weather.setQualityLevel('medium') or 'low', and cap the pixel ratio at the tier's pixelRatio. Test on downpour, which draws every streak the tier allows. See Quality levels.