Game Development Community

Problem with rain and snow

by Christian Weber · in Torque Game Engine · 02/07/2003 (9:00 am) · 36 replies

Hi,

well, the rain works, but all I can see are little grey blocks falling from the sky.

Any suggestions?

Thx,
Chris
Page «Previous 1 2
#2
02/07/2003 (9:14 am)
Already tried that, same thing. :( The texture path is definantly right, dont know whats wrong. Another idea?

Chris
#3
02/07/2003 (9:56 am)
You have to make sure you have a transparent background on your texture. I've had problems with that too. Search the forums - there's several threads about this, and if I recall one of them was helpful to me, but I just can't remember which one :)
#4
02/07/2003 (10:02 am)
thx, but I have another problem, I wanted to add this piece of code "Optimization: Speeding up terrain occlusion check". I get one error.

sceneTraversal.cc(342) : error C2601: 'terrCheck' : Lokale Funktionsdefinitionen sind unzulaessig

The Problem has to be in here:

bool terrCheck(TerrainBlock* pBlock,
SceneObject* pObj,
const Point3F camPos)
{
Point3F localCamPos = camPos;
pBlock->getWorldTransform().mulP(localCamPos);
F32 height;

Thx again,
Chris
#5
02/08/2003 (3:29 am)
*push*
#6
04/14/2003 (7:59 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 else 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....
#7
04/14/2003 (8:04 pm)
You are most likely missing a { or a } somewhere in the function above terrcheck(....).
#8
04/15/2003 (5:25 am)
I have gone over the code again and still can't understand why this is happening. Everything else seems to be working fine. It just renders grey billboards on Nvidia 2 and Nvidia4 440 but works fine on Nvidia4 TI4600. Any thoughts from anyone!!:)

Thanks.
MJ....
#9
04/15/2003 (10:04 am)
I found and fixed the problem!

MJ....
#10
04/15/2003 (10:16 am)
then please enlighten everyone else as to your problem and the fix?
#11
04/15/2003 (12:57 pm)
It was staring me right in the face. DO NOT specify the root in the path of your material list. I found this the hard way by putting debug info in a console printf statement in the precipitation.cc file in the loadDML section. Rain and Snow both work great on all my test machines now.

===================================================
datablock PrecipitationData(Rain)
{
type = 0;
***********************************************
THIS DOES WORK!
materialList = "~/data/fx/precipitation/raindrops.dml";
***********************************************
THIS DOES NOT WORK!
materialList = "~/FPS/data/fx/precipitation/raindrops.dml";
***********************************************
soundProfile = "Rain_Soft";
sizeX = 0.10;
sizeY = 0.10;

movingBoxPer = 0.35;
divHeightVal = 1.5;
sizeBigBox = 1;
topBoxSpeed = 20;
frontBoxSpeed = 30;
topBoxDrawPer = 0.5;
bottomDrawHeight = 40;
skipIfPer = -0.3;
bottomSpeedPer = 1.0;
frontSpeedPer = 1.5;
frontRadiusPer = 0.5;
numTextures = 4;
};
===========================================================

Hope this helps!:)

MJ....
#12
04/15/2003 (2:23 pm)
my rain still shows white... but also shows the rain texture.. its not taking out the white part... any suggestions?
#13
04/15/2003 (5:11 pm)
@Tom
You need to make sure that you have an alpha channel in your png image. I made mine 64 X 64 and set my numTextures to 4. This gave me 4 flakes/drops per image. If you have not set the alpha channel correctly you will see the whole image. Including the "white parts". If you want I will send you my test snow flake and rain drop image I created but you have to have a the right graphics program in order to show the alpha channel. I use Corel PhotoPaint 10 for all my graphics. Adobe Photoshop will work also along with some others. I believe that Photoshop is the Paint Program of choice by most gamming artists. I have used Corel for years and personally prefer it though.


MJ....
#14
04/15/2003 (5:39 pm)
Well I snagged the rain png out of tribes 2... (i know I am bad) but it shows 1 raindrop on a white background. first it was all white but found that was due to my not having the dml named correctly.. if you could send me the test snow and rain image I would appreciate it so I can see if its the t2 pic or not.. I have the number set right (i think) there are 16 raindrops on the t2 pic so I put the number at 16, it was on 4 and still got the white with rain drop pic.. so dont know if that was it or not.. : )
My email is reconberk.teamrecon@attbi.com
#15
04/15/2003 (5:39 pm)
oh and I use paint shop pro 6...
#16
04/16/2003 (11:27 am)
@Tom
I emailed you the images. Hope it helps. They work great for me as test for testing.

MJ....
#17
04/16/2003 (12:25 pm)
they worked thanks.. : )
#18
04/19/2005 (8:21 pm)
Hey jackie. i'm also encountering the same problem. tried using the raindrop images from the torque demo but result in big square boxes rather than raindrops. will appreciate it if you're able to send me the images u've done.
thanks alot pal.

my email: bookerman@gmail.com
#19
04/20/2005 (4:26 pm)
@Chee
I emailed you a png file along with some scripts.

Boy time flies. It has been over two years since I posted to this.

Hope this helps Chee...
#20
08/20/2005 (4:54 am)
Hi all,
The PrecipitationData datablock interface has changed, rendering Desmond Fletcher's tutorial obsolet.

Here's what I've done (for TGE 1.3 SDK) to get rain working:

I've added a weather.cs in the server/scripts, loading it by adding it to server/scripts/game.cs (as usual)

datablock PrecipitationData(Rain)
{
dropTexture = "~/data/fx/precipitation/raindrops2"; //Points to a png file with transparens.
splashTexture = "~/data/fx/precipitation/water_splash1"; //Points to a png file with transparens.
soundProfile = "Universal_Rain_Light_1"; //Note tested yet, might not be working (from Desmond Fletcher's tutorial)
dropSize = 0.5; //guessing: scale of the drop image
splashSize = 0.5; //guessing: scale of the splash image
useTrueBillboards = true; //(don't know what this does!)
splashMS = 250; //(guessing, time for the splash image to be visible)
};

EDITED::
Add the rain in the mission file by adding (i think):

new Precipitation(Precipitation) {
dataBlock = "Rain";
numDrops = 5000;
boxWidth = 200;
boxHeight = 100;
doCollision = true;
//Movement
minSpeed = 1.5;
maxSpeed = 2.0;
minMass = 0.75;
maxMass = 0.85;
//Turbulence -- I don't know how the turbulence is supposed to work, it doesn't do anythin for me.
maxTurbulence = 0.1;
turbulenceSpeed = 0.2;
rotateWithCamVel = true;
useTurbulence = false;
}
Page «Previous 1 2