Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Fog and Particles

Author
Message
Digital Worm
11
Years of Service
User Offline
Joined: 19th May 2009
Location:
Posted: 17th Jun 2010 08:45
Hi everyone.
I've been having some problems recently with the fogging effect in DBC. I know DB Classic doesn't have any particle commands, so I decided to make my own particles using ghosted plains. it works pretty well, but then I went to add fog to my game, and there is now a slight, but visible outline on all my my particles. What is causing this? Is it the light that the particles emit? If so, how do I make the objects ignore the light?
Here's two screenshots: one with fog, one without.



I used to play sports. Then I found out that you can buy trophies on the internet. Now I'm good at everything.
Sixty Squares
14
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Jun 2010 14:42
You could try using the SET OBJECT command and setting the fog flag to 0.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Jun 2010 16:51
And also make sure you set the transparency flag to 0 with the SET OBJECT command.

TheComet

Digital Worm
11
Years of Service
User Offline
Joined: 19th May 2009
Location:
Posted: 17th Jun 2010 19:33
Thanks guys! It works perfectly now. I'm not new to DB, but I am somewhat new to 3D graphics. I didn't even know that you could turn the fogging effect off on objects. Thanks again!

I used to play sports. Then I found out that you can buy trophies on the internet. Now I'm good at everything.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Jun 2010 05:21
Just so others know what you did, what exactly did you do to correct the problem? Just turn the fog flag off? And are you using normal ghosting - GHOST OBJECT ON obj - or dark ghosting - GHOST OBJECT ON obj,1

(and your burning jet effect looks pretty cool)

Enjoy your day.
Robert The Robot
13
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 19th Jun 2010 18:41
Wow, very nice jet engine effect - looks like something out of DarkPhysics command set for DBPro! How'd you do it in DBC??

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Digital Worm
11
Years of Service
User Offline
Joined: 19th May 2009
Location:
Posted: 21st Jun 2010 07:08
To fix the problem, I simply turned the fog flag in SET OBJECT to OFF (0).
I've been told by many people that the effect looks very nice, and the game I'm making started out as a simple demo of the particles.

This is how I did it:
Every flame effect on the screen (the game currently supports 5) is made up of 50 plains, all ghosted using GHOST OBJECT ON *number*, some with a flame texture, the others with a smoke texture. The game decides whether to make a flame or smoke particle using a random number (type=RND(1)). Each particle also gets a set of random properties, all stored in an array. These include speed, size, and X and Z position (Y position is all the same). Every SYNC, each particle moves up incrementally by its random speed, which makes a cool effect. This is all in a function that take parameters such as radius, position, etc. Also, there are several lights that follow the particles so when you fly over a flaming vehicle of something, there is a shine on the bottom of your plane (I set the specular light on the plane pretty high).

Anyways, you can try it yourself if you want. Oh, and if you think it looks cool on a plane lying on the ground, you should see how cool it is when you start firing on a plane in mid-air, dodging their bullets as well, and your enemy just explodes into flames mid-flight and crashes into the ground! (yes, I already have that working)
I may decide to just put my function up on the forums for others to use, but it's a little "dirty", if you will. I could certainly clean it up a bit and make it a little more readable. Couldn't we all? Haha!

I used to play sports. Then I found out that you can buy trophies on the internet. Now I'm good at everything.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Oct 2010 22:26
I'd be curious to see that function...

Enjoy your day.

Login to post a reply

Server time is: 2020-08-13 19:06:44
Your offset time is: 2020-08-13 19:06:44