CSimpleParticleSystem(tests, sample code when it works) - Page 2

CSimpleParticleSystem(tests, sample code when it works)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

I wouldn't worry... it doesn't look at all static- seeing a still shot... er, let's just say it doesn't even slightly prepare you for what the animation looks like.

Can't make it drift with the wind, though- CSimpleParticleSystem doesn't allow for that.
Last edited by Argh on 10 Nov 2006, 12:55, edited 1 time in total.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10452
Joined: 24 Jan 2006, 21:12

Post by PicassoCT »

And i said don`t push that red Button... we are all gone die - and it will look that Good. :wink: :lol:
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Also, DelaySpawner doesn't seem to respect i or r commands. Not terribly important, all things considered, but it'd be nice.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Further tests have proven, at least to my satisfaction, that there is indeed an error in the z-buffer sorting. Size of the particles makes no difference.

Maybe the size of the entire sphere is being used to determine z-order? If so... then that's not going to work. Neither is some simplistic solution from the centroid of the camera.

I know it's expensive to do a z-buffer sort by particle, but it's necessary, or stuff like this will look good only from an OTA angle... and terrible otherwise :P

It's not like FX of this complexity are going to be running constantly- and for the lighter ones, adding a per-particle z-buffer sort probably won't make them that much slower. You could even make it optional, for FX of this type that don't need much slower calculations. But the way it works now, I see tons of clipping that looks extremely ugly when viewed from the sides.

I've tried various ColorMap settings to try to reduce this problem, but to no avail.
Last edited by Argh on 10 Nov 2006, 13:00, edited 1 time in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The glow and fire not showing through makes it looks like a disc shaped rocket lifting off into space, it just doesn't look that much like a nuclear fireball than an oddly shaped cloud.. But its very close already, you've got the shape sort of right and it looks much better than the last attempt, which sort of fizzled out looking a bit weak and sparse this one I'd expect more of an oomph from.

Is that smoke going to be in your GPL BOS script base?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

The glow/fire thing is one of the problems I am referring to with the whole z-buffer thing. What's happening right now is that FX are either getting drawn entirely over ... or not. Per system, not per particle. Which doesn't work at all right, for the layered effect I want. I was aiming for "fuzzy at the edges, impenetrable in the center", like the previous one, but with the new toys available in CSimpleParticleSystem. For that to work, each particle needs to be drawn on top ones farther from the camera's centroid, with alphas being added to one another. That's not working right in this version.

The smoke/fire is another project entirely. It may share bitmaps with this, but probably not. These are pretty much custom-built for the larger scales.

However, the SizeGrowth/Mod tags + SpawnDelay should allow for me to do them entirely with CSimpleParticleSystem, if I want to. Truth be told, it will probably be more efficient to use HeatCloud, which I think is faster code. I dunno yet. It does have to be fast code, though.

I've already written up one semi-dynamic flame, and I'm sure I can improve upon it over time. I'm not ready to put any of that on the table yet, though.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well, I think that the alpha transparency and the bug you have are both useful features in themselves and should be shown as a tag. Oh bugger you would just use a 0 alpha value......

I take it they have alpha channels? Or do they use alpha masks?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Er... I don't think you understand the true extent of the problem. Here, lemme put up a less-flattering screenshot, that shows the extent of the pop-over going on:

Image

As you can see, there are obvious problems here.

While all of the smoke in this shot is using a ColorMap value ending with 1.0 (full additive alpha), it's clear that things aren't working right. For example, the central column should be thickening the effect of the smokepuffs behind them... that's not what happens.

Going the other way with ColorMap will cure the problem, but the cure is worse than the disease:

Image

Here, I'm using alpha values of 0.1 for the smoke. As you can see, it is now adding each alpha/RGB value, resulting in a great deal of pure white, which is not exactly the desired result :P
Last edited by Argh on 10 Nov 2006, 13:31, edited 1 time in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

:shock:

I can see that would look so much nicer if it would only render correctly.

*looks for yeha*
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

As a last note, before I crash into bed... basically, what's happening here is that each entire system is obviously being assigned a z-buffer level. Each system works fine on its own- it's only when I have multiples of them layered like this that there are serious problems. I've only had this problem with CSimpleParticleSystem. With HeatCloud, the problem was that the alphas were always additive, so I had to keep that in mind when designing the individual bitmap elements, for the first nuke, so that everything didn't wash out... and the smoke just uses a straight alpha, so it wasn't a problem.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Hmm, you mean the individual CSimpleParticleSystems work fine, but once you have two systems at approximately the same position all particles of one of the systems overlap all particles of the other system?

(That's what would be consistent with the code IIRC)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Yup. As the screenshots show pretty clearly. Pity, too, that's the only real problem with this sucker at the moment- it's really beautiful code otherwise, from an art perspective- very flexible.
Yeha
Posts: 96
Joined: 13 Aug 2004, 19:12

Post by Yeha »

You are correct that the systems aren't internally z-sorted, this is for speed reasons and for most purposes it isn't vissible. I'll see if i can add in an option for z ordering for those events that need it though.

Delayspawner spawn a completely new explosion generator, so it will have its new internal i and r.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

That would be awesome, for the rare occasions when it's actually necessary. Needless to say, that isn't the case for most garden-variety explosions- my previous tests have shown that it's working quite handsomely for smaller-scale stuff with less complexity. However, having that option will make this kind of larger, layered event work, and the extra cost, CPU/GPU-wise will be worth it for sure.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Any news on the z-buffer issue? I hate to be a pain about this, but it's about the only thing keeping the next version of NanoBlobs from being declared "done", and I have another commitment coming up that will also make use of this.
Yeha
Posts: 96
Joined: 13 Aug 2004, 19:12

Post by Yeha »

SimpleParticleSpawner is availble in the svn now, it has identical propertiers to SimpleParticleSystem but the particles are world sorted. Be aware that it is a little slower though.
[KnoX]ElementalGizmo
XTA Developer
Posts: 266
Joined: 24 Aug 2006, 01:33

Post by [KnoX]ElementalGizmo »

Sooooooooooooooooo. I WANT IT, I WANT IT NOW! lmao Awsome yum yums dude. XTA v8 had a few new effect that noruas has been playing about with, but that nuke WOW.

Please, when you get a vertion of this working to your high standards pass it on! Ill be over joyed to stick it in XTA v8.1

Ow and this :

PauloMorfeo:
Unit script and modell is from rattle, the explosion script looks like this
Code:

[properties]
{
emitVector =dir;
gravity =0,0,0;
colorMap=1 1 1 0.01 0 0 0 0.01;
texture =circularthingy;
airdrag = 0.95;
particleLife = 40;
particleLifeSpread = 30;
numParticles = 200;
particleSpeed =0.2;
particleSpeedSpread=0.5;
particleSize = 1;
particleSizeSpread = 1;
emitRot = 90;
emitRotSpread = 0;
directional = 1;

}

What dimentions are we talking about here for a texture for an effect. Ive no idea about creating stuff for this, but would love a vertion of that smoke on the BB n INTI on xta.

Truly cool stuff on this page. There should be a main page about effects for the developers. I found this the other day......

http://taspring.clan-sy.com/phpbb/viewtopic.php?t=8040

Also extreamly cool stuff that i havent seen b4. Is there an EXPERIMENTAL FX page about i havent found yet? Or am i doomed to wondering the forums trying to find cool FX to add here n there ¿
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Tested CSphereParticleSpawner. The z-buffer sort works- and you're right, it's quite expensive, CPU-wise, so I will have to be careful.

It doesn't seem to be affected by Gravity, however. Everything else seems to work. I need Gravity to perform the animations, though.
Last edited by Argh on 18 Nov 2006, 02:53, edited 1 time in total.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Holy! Shit! That! Explo! Sion! Looks! Sweet! As! Hell!

If it had correct color values, that would be the best nuke I have seen in a video game to date, even better than F.E.A.R. methinks!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Also, I see that DelaySpawner is an ExplosionGenerator class. How am I supposed to be using this? I was wondering why it didn't seem to be working to time-delay ExplosionGenerator events correctly...
Post Reply

Return to “Engine”