Game Development Community

dev|Pro Game Development Curriculum

Flexible rain/snow texture in Torque

by Frank Bignone · 01/21/2003 (12:31 pm) · 11 comments

Download Code File

This little change allow to dynamically set the texture subdivision in the precipitation code. It allows more flexible texture with texture subdivided in 4, 8, ... parts.

So a classical precipitation texture file looks like that
darkhand.webhop.org/samples/raindrops.gifIt has 16 subdivisions and in each there is a raindrop.
However, it is impossible to have more detailed raindrop /snowflakes which was very important in DoP. The proposed code add one variable in the Precipitation datablock named numTextures which let you define the subdivision of your texture as shown in the following code :

datablock PrecipitationData(FunnyRain)
{
   type = 0;
   ...
   numTextures = 4;
};

You can then make much detailed texture like
darkhand.webhop.org/samples/funnyraindrops.gif
You just need to download the provided file and replace your files with the one in the archive + recompile torque.

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
01/22/2003 (9:28 am)
Hey, another nice one Frank. Working great and give a nice graphic touch freedom. Thanks !
#2
01/25/2003 (10:28 am)
Good Deal Frank!
#3
01/26/2003 (2:32 pm)
I have never been able to make my precipitation datablock scripts work. Any help or example code for a precipitation datablock and where to locate it in the example app?

Would like to try DOP's precipitations, they seem amazing!
#5
01/27/2003 (9:52 pm)
@Gilles

Hey kewl link, thanx a lot!
#6
02/08/2003 (5:13 am)
i made this mod to the engine, but i don't see any changes . the rain is horrible. It cut the texture in more than the 4 pieces i wrote in the property , making the rain very horribile.
help please.
#7
04/14/2003 (7:36 pm)
Has anyone had any problems with rendering raindrops? I have applied this update and it works great on my Nvidia GForce4 TI4600 but when I try and run it on an Nvidia GForce 2 or GForce4 440 all I get is white billboard squares no matter what png file I use. It acts like it can't find the png file. I have looked at the code and everything looks ok. I even displayed the png file in the GUI to make sure the alpha channel was ok. The png file looked good on all machines. I have been working on this since yesterday and can't find out why it is doing this. Any help would deeply appriciated.

Thanks!
MJ....
#8
04/20/2003 (7:14 pm)
Jackie, I am getting the same. I use a ATI Card..... I cant figure out how to fix this either.
#9
04/20/2003 (8:17 pm)
Geoff got to this link. I have posted what I had to do to make it work. Hope it helps.

MJ....
#10
07/01/2003 (11:30 am)
Hello!
mmh im new in those forrums and this seems tobe very usefull! thx! ;) (i like ure second rain its loly! ;-)
#11
11/23/2005 (6:40 am)
@Jackie @Geoff - I have the same problem, but check if Snow is working. My snow is workng, but my Rain is not.