• entries
    232
  • comments
    1462
  • views
    954932

Silverbow and space rain..

Sign in to follow this  
Ysaneya

1431 views

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)
Sign in to follow this  


10 Comments


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!

Jack

Share this comment


Link to comment
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 :)

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???

[edit]
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:

http://www.cs.huji.ac.il/~werman/Papers/Rain.pdf
http://www.cs.huji.ac.il/~werman/Papers/rain/rain.html

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