Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Luis Dias on March 01, 2011, 08:42:04 pm

Title: Dust flowing against alpha1
Post by: Luis Dias on March 01, 2011, 08:42:04 pm
Would it be possible to code an effect as if you were flying past a huge field of dust, where if you move fast, you'll get a lot of pixels coming out at you, always correct perspectically speaking? Imagine old screensaver "starfield" on windows, but maleable and denser.

I had an excellent idea for this type of thing...
Title: Re: Dust flowing against alpha1
Post by: General Battuta on March 01, 2011, 09:02:32 pm
Turn on motion debris and you'll get that. It's piss ugly though. Been in since retail.
Title: Re: Dust flowing against alpha1
Post by: jr2 on March 01, 2011, 09:06:06 pm
Feature request: update motion debris to HD motion debris?  :lol:  Seriously, though, for those that like it maybe it could use an upgrade.  IIRC it looks low-res when you happen to focus on a piece close-up.
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 01, 2011, 09:41:05 pm
wouldnt mind if they were replaced with tiny space dust sprites. would look pretty cool (cooler still with motion blur but i doubt that is possible).
Title: Re: Dust flowing against alpha1
Post by: Reprobator on March 02, 2011, 08:05:09 am
I agree with nuke , that 'll increase speed sense too.
Title: Re: Dust flowing against alpha1
Post by: headdie on March 02, 2011, 08:16:57 am
wouldnt mind if they were replaced with tiny space dust sprites. would look pretty cool (cooler still with motion blur but i doubt that is possible).
:yes: +1
it would be really cool with FRED control of said effect (background editor perhaps), especially if you  could vary it using sexps
Title: Re: Dust flowing against alpha1
Post by: Reprobator on March 02, 2011, 09:56:04 am
Remind me the nexus2 trailer when you see fighter flying through huge debris ... :D
Title: Re: Dust flowing against alpha1
Post by: Spoon on March 02, 2011, 10:48:59 am
After reading this thread I decided to mess around with motion debris for a bit (I've never turned it off once I found out about it, I like the sense of speed it gives), replaced the 4 debris.ani's with greyscale pixels. Looks aright to me.
Title: Re: Dust flowing against alpha1
Post by: Reprobator on March 03, 2011, 01:24:47 am
Would you mind sharing ?  ;7
Title: Re: Dust flowing against alpha1
Post by: Spoon on March 03, 2011, 09:27:25 am
http://www.mediafire.com/?owi4dr5ywnbmv34
throw em in data/effects

Do not expect 'HD motiondebris' though  :p
Title: Re: Dust flowing against alpha1
Post by: Sushi on March 03, 2011, 09:31:24 am
Heh, my very first FS mod was to get rid of the motion debris. The circle is complete...
Title: Re: Dust flowing against alpha1
Post by: Luis Dias on March 03, 2011, 10:06:44 am
Heh, my very first FS mod was to get rid of the motion debris. The circle is complete...

It's not as if I like the effect. But if you want to have a different mission, say, in a dusty setting (saying no more than this!), and you don't want to use a full blown nebula, then we might just have to use a different effect.
Title: Re: Dust flowing against alpha1
Post by: Reprobator on March 03, 2011, 12:02:12 pm
What we would be cool is having the possibility to control this on fred :)

Trying your dust now :)
and it looks much better than the orginal one yup!
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 03, 2011, 01:54:49 pm
at this point this thread could probibly either be moved to modding or fs upgrade project.
Title: Re: Dust flowing against alpha1
Post by: Luis Dias on March 03, 2011, 02:30:55 pm
at this point this thread could probibly either be moved to modding or fs upgrade project.

Before you do so, can I ask whether anyone can code the dust to be an option in fredding that can be changed anytime? And its intensity, etc?

I imagine something on the order of... no dust at all... then suddenly we see some dust, someone says "wtf is this?", someone else explains with astrobabble, and then it slowly increases its effect until it's a maddening sand storm all over you.

And then it fades away again.

There is good fred material to make good stories here. But I doubt we have all the tools to do so.
Title: Re: Dust flowing against alpha1
Post by: General Battuta on March 03, 2011, 02:56:38 pm
At one point in 3.6.12 development someone coded it so motion debris would turn on inside asteroid fields, but this was vetoed as a stupid idea.
Title: Re: Dust flowing against alpha1
Post by: Sushi on March 03, 2011, 03:17:11 pm
At one point in 3.6.12 development someone coded it so motion debris would turn on inside asteroid fields, but this was vetoed as a stupid idea.

IIRC idea was fine, implementation was problematic.
Title: Re: Dust flowing against alpha1
Post by: General Battuta on March 03, 2011, 03:24:18 pm
Well I think the issue was that it would always be on in asteroid fields, even if the player had motion debris turned off in the launcher, which would a) piss off people who really don't like motion debris), and b) render it impossible to do any cutscenes in asteroid fields.
Title: Re: Dust flowing against alpha1
Post by: Luis Dias on March 03, 2011, 03:34:02 pm
Well I think the issue was that it would always be on in asteroid fields, even if the player had motion debris turned off in the launcher, which would a) piss off people who really don't like motion debris), and b) render it impossible to do any cutscenes in asteroid fields.

I agree, that is agressive and annoying. Perhaps we could SEXP it? Including a variable for intensity? idk if this is possible / hard to do / etc., but it would be an interesting addition.
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 03, 2011, 04:06:30 pm
maybe make it so you can set the debris sprites based on your proximity to an asteroid field. change small dust sprites in the world for larger rock sprites in the asteroid field, and nebulas could have their own set of sprites. may also want some kind of density control. kind of interpolate between 2 sprite sets and density values on transition from inside and outside of asteroid fields.
Title: Re: Dust flowing against alpha1
Post by: Luis Dias on March 03, 2011, 04:14:00 pm
maybe make it so you can set the debris sprites based on your proximity to an asteroid field. change small dust sprites in the world for larger rock sprites in the asteroid field, and nebulas could have their own set of sprites. may also want some kind of density control. kind of interpolate between 2 sprite sets and density values on transition from inside and outside of asteroid fields.

Disagree. I think it should be left to the fredder when and where these particles intensify, start to exist, stop existing, etc. More freedom to who is writing the thing. Imagine a fredder "why should I have to put an asteroid field if all I want is dust?!?"
Title: Re: Dust flowing against alpha1
Post by: Trivial Psychic on March 03, 2011, 06:13:25 pm
Not to get this thread off track, but a lot of the controls for variable dust size and density are very much like those requested for variable nebular densities.  Perhaps if there is intended implementation for one, the other could be introduced alongside.
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 03, 2011, 07:37:53 pm
any fredder who is concerned with every grain of dust in the mission is obviously very bored or has some kind of ocd. :D

still making dust work automatically doesn't exclude the possibility of some manual control. i mean every environment would have its particle set and associated variables. where these are loaded from is another matter entirely. im not even sure what table would cover something like this. however once the data structures exist then they can be manipulated quite easily with a sexp or scripting. i would imagine that in some table you would define the particle set/variables entry and give that entry some name. one may be set as the default set. certain asteroid sets may be associated with a particular particle set that would be used while in an asteroid field with that type of asteroid. way it would typically work is you would start a regular old mission and the default particle is used. if you enter an asteroid field (or start out in one) then whatever particle set the that type of asteroid has defined will be used (if none defined then default). transitions would be handled automatically. now the mission may override either one. if thats not enough you can have sexp to change your set (again transition would be automatic).  of course i probably wouldn't code the thing so i dont know.
Title: Re: Dust flowing against alpha1
Post by: jr2 on March 03, 2011, 09:03:40 pm
Would be fun for flying through the tails of comets.  ;)
Title: Re: Dust flowing against alpha1
Post by: Sushi on March 03, 2011, 11:51:55 pm
Not to get this thread off track, but a lot of the controls for variable dust size and density are very much like those requested for variable nebular densities.  Perhaps if there is intended implementation for one, the other could be introduced alongside.

We're halfway there with variable nebula densities. I've got code that adjusts the render distance in a nebula based on a mission setting: we just need to be able to make the nebula fog look "thinner" as well.

IMHO mission settings for dust density, size, and sprite + SEXPs to change them mid-mission would cover most things nicely.
Title: Re: Dust flowing against alpha1
Post by: Trivial Psychic on March 04, 2011, 07:02:34 pm
Would be fun for flying through the tails of comets.  ;)
Or through planetary rings.
Title: Re: Dust flowing against alpha1
Post by: Woolie Wool on March 04, 2011, 08:16:33 pm
Not to get this thread off track, but a lot of the controls for variable dust size and density are very much like those requested for variable nebular densities.  Perhaps if there is intended implementation for one, the other could be introduced alongside.

We're halfway there with variable nebula densities. I've got code that adjusts the render distance in a nebula based on a mission setting: we just need to be able to make the nebula fog look "thinner" as well.

IMHO mission settings for dust density, size, and sprite + SEXPs to change them mid-mission would cover most things nicely.

How difficult would it be to introduce proper depth fog instead of the current nebula rendering?
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 04, 2011, 08:56:33 pm
id love to have basic depth fog, for in and out of the nebula. its a boring effect by itself, but with backgrounds and particle sprites i think it would work well.
Title: Re: Dust flowing against alpha1
Post by: Sushi on March 04, 2011, 11:32:47 pm

How difficult would it be to introduce proper depth fog instead of the current nebula rendering?

Not sure. I'm really not familiar with the rendering code. Sounds easy, but that's the classic trap for coders. :)
Title: Re: Dust flowing against alpha1
Post by: Nuke on March 05, 2011, 07:08:52 am
i think its just a matter of telling gl to use one of its extensions. its an effect that was quickly added to quake builds back when its source was released. though i think the hardest part would be to make it play well with backgrounds.

a google search gives me this code snippet:

Code: [Select]
void drawScene() {
    //...
    GLfloat fogColor[] = {0.5f, 0.5f, 0.5f, 1};
    glFogfv(GL_FOG_COLOR, fogColor);
    glFogi(GL_FOG_MODE, GL_LINEAR);
    glFogf(GL_FOG_START, 10.0f);
    glFogf(GL_FOG_END, 20.0f);
    //...
}

from here:
http://www.videotutorialsrock.com/opengl_tutorial/fog/text.php

variables here are color, near distance, far distance and curves. its worth a try to see what it does considering its just a few function calls.
Title: Re: Dust flowing against alpha1
Post by: Black Wolf on March 05, 2011, 08:58:31 am
I can think of a few situations where the ability to control motion debris in mission would be useful - I'd love to see this implemented.\
Title: Re: Dust flowing against alpha1
Post by: Reprobator on March 07, 2011, 02:15:53 am
I agree with the fog things, if we can replace nebula's sprite by a real fog (and beeing able to control depth color and... dust in it) i think i would looks better :)

Title: Re: Dust flowing against alpha1
Post by: Nuke on March 07, 2011, 04:35:09 am
I agree with the fog things, if we can replace nebula's sprite by a real fog (and beeing able to control depth color and... dust in it) i think i would looks better :)

i dont know. of all the games that have had nebulas, i still think freespace did it fairly well. you should kind of think of distance fog as an alternative to nebulas, for where you need some kind of haze but without really playing havok on the sensors.
Title: Re: Dust flowing against alpha1
Post by: -Norbert- on March 09, 2011, 01:06:56 pm
Would it be possible for the motion debris to move on it's own?
I'm thinking of the atmosphere missions some mods have. There the dust could slowly drift down towards the "ground part" of the skybox or surface model, while you hover/stand still. That would be pretty nice to have, especially if the mission is supposed to play in a warzone with burning buildings.
Title: Re: Dust flowing against alpha1
Post by: jr2 on March 11, 2011, 09:46:18 am
Heh, here's an idea... can has spawn motion debris from exploding ships, getting thinner from the focal point  outwards?  You'd get sprayed by tiny pieces while you dodged the big ones.  ;7
Title: Re: Dust flowing against alpha1
Post by: VerGreeneyes on March 11, 2011, 10:13:19 am
Rendering that many particles sounds like a pain - unless the tiny particles move collectively as a field and the big chunks are handled separately.
Title: Re: Dust flowing against alpha1
Post by: jr2 on March 11, 2011, 12:21:03 pm
Sounds like a plan. xD
Title: Re: Dust flowing against alpha1
Post by: butter_pat_head on March 11, 2011, 12:31:31 pm
Heh, here's an idea... can has spawn motion debris from exploding ships, getting thinner from the focal point  outwards?  You'd get sprayed by tiny pieces while you dodged the big ones.  ;7

Add appropriate SFX to that and the effect would be great! 

"What do you hear?" 
"Nothing but the rain"
"Grab your gun and bring the cat in"  :D