Raining Experience in VR Tutorial Using Three.js and WebVR


Join 6000+ Students

Upgrade your programming skills to include Virtual Reality. A premium step-by-step training course to get you building real world Virtual Reality apps and website components. You’ll have access to 40+ WebVR & Unity lessons along with their source code.

Start Learning Now

Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
150$ for all 3 courses (SAVE 70%)

This is part of #DaysInVR series. View All VR Projects

Yesterday, we learnt how to create a snow effect in VR on top of photos or videos.

Rainfall in WebVR

In this tutorial, we’ll see how to create raining effect in VR complete with sound. I’m using Three.js and WebVR api to create this project.

Add 360 Photo

We’re going to use MeshLambertMaterial instead of MeshBasicMaterial to add our 360 photo. This is because MeshLambertMaterial because this material reacts to light in the scene.

That way we can control the intensity of the image displayed. In the demo, I used this effect to make the environment a little darker suitable for raining weather.

Adding Rainfall in WebVR

I’m using the excellent ShaderParticleEngine to generate the raindrops.

There are two main parts in SPE.

  1. SPE.Group
  2. SPE.Emitter

SPE.Group is used to create a particle group. SPE.Emitter is used to create the emitter. Emitter is then added to the particle group. Any number of emitters can be added to a group. All the emitters will then share the same attribute buffers for rendering.

You can try changing the parameters and see how it affects the rain effect.

Adding sound effects in Three.js

We can use Web Audio API to add the rain sound effects in our VR project.

This is simple with inbuilt Three.js functions.

For VR mode to be enabled, you’ll have to add VRControls, VR Effects and webvr-ui. If you have any trouble setting that up, check the day 1 tutorial.

Its your turn

Did you follow the tutorial and made it yourself?

 

Download Source Code

Kickstart VR development by downloading source code for this project. You’ll have instant access to source code and asset files. You can use them in your personal or commercial projects.

Download Source Code

Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Get instant access for $39

Leave a Reply

Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link
Own the course that helped 6000+ developers find VR jobs.
GET FREE LESSON

Get your Free Lesson now. 

We shall send you an email with the link to the best starter lesson in 5 minutes
close-link