Silverbow and space rain..

Published April 15, 2007
Advertisement
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.

Silverbow

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)
1 likes 10 comments

Comments

jollyjeffers
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!

Jack
April 15, 2007 12:25 PM
ApochPiQ
You better not put me out of a job, you bastard [grin]
April 15, 2007 02:46 PM
Ysaneya
Quote: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 :)
April 15, 2007 04:44 PM
dgreen02
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!
April 16, 2007 04:33 AM
Bliz23
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???

[edit]
My bad, I was to amazed by the pictures to read that you we're gonna keep the space rain.
April 16, 2007 08:28 PM
venzon
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:

http://www.cs.huji.ac.il/~werman/Papers/Rain.pdf
http://www.cs.huji.ac.il/~werman/Papers/rain/rain.html
April 20, 2007 09:28 PM
MindWipe
Amazing rain effect! Yet in theory so simple to do! Thanks, it inspired me!

/MindWipe
May 16, 2007 09:12 AM
favormm
It's a cool demo, the rain is very cool, can you write a tutorial to introduce the rain droplets on the glass?
May 20, 2009 04:11 AM
GMA965_X3100
the NaN error seems like a data type conversion issue.
January 20, 2011 07:50 PM
GMA965_X3100
and thanks for that physics engine of yours......I may find a way to patch in deformation code into it someday...
January 20, 2011 07:52 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement