Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
HLSL Development Cookbook

You're reading from   HLSL Development Cookbook Implement stunning 3D rendering techniques using the power of HLSL and DirectX 11

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781849694209
Length 224 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Doron Feinstein Doron Feinstein
Author Profile Icon Doron Feinstein
Doron Feinstein
Arrow right icon
View More author details
Toc

Rain


Particle systems are a very common technique used when rendering something with a shape that's either too complex to render using single mesh or when there are many simple shapes that move in a complex pattern. Fire is a good example for the first case, because the flames produce a random shape that can't be modeled beforehand. On the other hand, rainfall is made out of many simple streaks which move in a complex pattern, which is an example for the second case.

In this recipe, we will concentrate on rain because it requires a relatively simple simulation which is mostly effected by gravity. With a slight modification, the same simulation can be extended to support snow and steroid showers. Other types of particle effects such as smoke and fire, can also be handled entirely on the GPU, but the simulation required is going to be much more complicated.

The following screenshot features a scene with rain:

Getting ready

Similar to the way we handled the highlights for the bokeh effect, we will...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image