Jump to content
  • Advertisement
  • entries
  • comments
  • views

Silverbow and space rain..

Sign in to follow this  


Minas Tirith v12 release

I'm working on the release for Minas Tirith v12 ( a side project using the I-Novae engine ), so it's consuming a bit of time. I have upgraded ODE (the physics engine) from version 0.6 to 0.8, but for some reason I get strange slowdowns when some box bodies are not well placed. I must also investigate some strange crashes in ODE ( some bodies get a NaN - Not-a-number - in their positions or velocities ). It will likely keep me busy the whole next week.. and maybe more, so expect slower updates.


ResourceCollector has finished to model the Silverbow ( with a full set of modules, wings and fins ); while Juan has finished ( minus minute details ) to texture it. The result is looking very good IMO, especially with the latest ASEToBin shaders.

Distortion effects

I always wanted to experiment a pure graphical effect: distortion effects. A distortion effect basically renders the scene into a texture ( the "scene buffer" ), renders some distortion effects/geometry into another texture ( the "distortion button" ), and applies a shader to displace per-pixel the scene buffer by the distortion buffer.

I plan to use and abuse of this effect everywhere possible. Not exhaustively:
- heat wave effect ( on desert planets )
- heat behind thrusters ( for non-realistic settings )
- heat around suns ( for non-realistic settings )
- rain effect ( see next chapter )
- heat effect around ship ( heating due to entering an atmosphere at high speeds )
- shield effect around ship
- some weapons effects ( lasers/beams ? )
- explosion effects
- etc..

In practise, it's been extremely easy to implement in the engine, thanks to the render pipeline system. It took maybe an hour to add it.

Rain effect

Space rain ! Nah, kidding. I implemented a rain ( or more exactly, droplet ) effect in ASEToBin, and as you know, ASEToBin cannot render planets, so..

The rain effect is an application of that distortion effect I talked above. It works in camera space, by rendering tens to hundreds of droplets in a "droplet buffer". This droplet buffer is then used as the basis for the distortion ( / refraction ), and also for the lighting ( specular effect in the droplets ).

Technically, it works like this: I have a droplet buffer, initially filled with the color (128, 128, 255). This droplet buffer contains normals. I also generate droplets ( each with a position and a velocity ), updated in the CPU. Droplets merge together and grow in size when they hit each other; their velocity is also updated with some noise values each frame, to make them move more naturaly. Each frame, all the droplets are rendered into the droplet buffer with a "droplet normal map". The droplet normal map is generated from a simple gradiant bump effect and converted to a normal map:

The trick to the effect is to not clear the color buffer between each frame, and to render each droplet with alpha blending.

To simulate the "evaporation", the whole buffer is alpha-blended by a small percentage with the default color (128, 128, 255) every frame.

The result is a bit similar to ATI's Toyshop demo, but is a lot more simple to code and has a very light CPU impact.

Here's the content of the droplet buffer after a while:

On the Silverbow, here's a typical result after all the effects are applied:

The rain effect is much nicer in motion, so I created a video:

Silverbow and rain (Divx5, 23.2 MB)
Sign in to follow this  


Recommended Comments

That's some pretty cool stuff you've got there [grin]

The first shot of the 'silverbow' is really impressive - what sort of shader are you using?

Keep up the good work!


Share this comment

Link to comment
Original post by ApochPiQ
You better not put me out of a job, you bastard [grin]

I think you are still safe for a few years :)

Share this comment

Link to comment
That's a nice rain effect you got there...

The shader on the ship is really amazing...and the video was great. I got a sense of vertigo as the background planet rotated into view...scary stuff man.

Keep up the good work!

Share this comment

Link to comment
Even though its only a spaceship and rain drops shown on screen, it looks very well polished. The only thing that really gets me is how do you have rain in outer space???

My bad, I was to amazed by the pictures to read that you we're gonna keep the space rain.

Share this comment

Link to comment
The model looks great. The view from under the ship is especially nice... ambient occlusion always looks great for situations like that (lots of protruding structure). :-)

I like your approach with the distortions. The rain looks a bit silly in that context, of course, but it'd be a nice touch of immersion (along with the sound of raindrops hitting the hull) to see the rain streaking down the windshield/camera when flying around in a rainy planet, especially if the raindrops responded to the accelerations of your movement. For the simulation of the rain itself (rather than the rain streaks), you might want to check out this webpage, which talks about human perceptions of rain:


Share this comment

Link to comment
Amazing rain effect! Yet in theory so simple to do! Thanks, it inspired me!


Share this comment

Link to comment
It's a cool demo, the rain is very cool, can you write a tutorial to introduce the rain droplets on the glass?

Share this comment

Link to comment
and thanks for that physics engine of yours......I may find a way to patch in deformation code into it someday...

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!