Author Topic: 3D Shockwaves question (or a bad idea)  (Read 13781 times)

0 Members and 1 Guest are viewing this topic.

3D Shockwaves question (or a bad idea)
I was seeing that DaBrain Shockwaves uses 804 polys, it may not be much, but when there are lot of Shockwaves there is always a slowdown in most system, maybe a little maybe too much (if you have played INF you know what I mean).

My question is, why in exchange of using those polys, why don't make a Planar Square model using Alpha Channel Textures, the DDS version of DaBrain are DXT5, so they already have an empty alpha channel (32 bits depth).

Here is what I mean, seems logically and totally possible (and even better really easy), this is a model of White Dwarf (actually the White Dwarf needs to be added):



It could have a problem, I don't know if the FSSCP support Multiple Alpha Channels, I have tried with the TGA but it didn't work, maybe it works with DDS. Anyways even with a Binary Alpha it would look good.

The only thing that could ruin this, is that the collision of a Shockwave vs. Ship is managed by the Radius of the Model Shockwave, in this case a square won't work, I don't believe it is calculated that way....

------------------------------------------------------------

If this is so stupid please let me notice, because it I can't, it seems too perfect to be a idea that works...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: 3D Shockwaves question (or a bad idea)
Thing is that it's not the number of polys causing the slowdown. It's the number of textures. Using the alpha would mean bigger (or same sized - I forget which it is) textures and thus wouldn't cause any speed up at all.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Re: 3D Shockwaves question (or a bad idea)
Never mind that if you're going planar you really should be falling back to 2d anyway.  There is no instance where a 2-polygon shockwave will EVER look better than the bitmap ones.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Ulala

  • 29
  • Groooove Evening, viewers!
Re: 3D Shockwaves question (or a bad idea)
Certainly an interesting idea, though. 'Tis always nice seeing ideas brought to the table.  :)
I am a revolutionary.

 
Re: 3D Shockwaves question (or a bad idea)
Quote
Thing is that it's not the number of polys causing the slowdown. It's the number of textures. Using the alpha would mean bigger (or same sized - I forget which it is) textures and thus wouldn't cause any speed up at all.

Same Size, DXT5 are 32 Bit Alpha Textures, it saves the Alpha even if you don't want that channel, it should be the same size and memory usage. For that there are DXT1 and DXT3 textures.

I know the Textures are the one exausting the RAM, but DDS use MipMaps, while the Model of the 3D Shockwaves are just Detail-0, that means 804 polys for every Shockwave even at unseen distances. I am sure that in INF (and others), as an example we get up to 6 shockwaves for ship simultaneus and with a Wing of 6 Ship, we get 6 x 6 = 36 simulateous Shockwaves, with just LOD0 it is just 28944 polys, that's only per 1 Wing of Bomber if there were even more Wings (which happens), , that's a good number compared to FS2 Campaing...

I don't really know how Alpha is managed by SCP, because I can't get any Alpha to work for Texture Maps, not even Binary Alpha. For Backgrounds it works totally OK, as it should be, but for Models it works different, I can't really figure how....

Quote
Never mind that if you're going planar you really should be falling back to 2d anyway.  There is no instance where a 2-polygon shockwave will EVER look better than the bitmap ones.

This simple Model just has 12 polys.

A Model rotates and has an unfixed position for Shockwaves, a Bitmap is Static it doesn't rotate or anything, the viewpoint is always the same. The difference is clear...it seems that EVER just means EVER when your affirmation is not wrong (2D Earth Background have frequently more quality and colours than a 3D Model)

------------------------------------------------------------

The Main case, is this, a Square Planar model can't be seen from Left / Right / Botton or Top view, it is planar, the problem is that the Shockwaves made by DaBrain doesn't have a real texture from those sides, so at the moment it would be the same, I mean, have sometime a Shockwave hit you from one of those points ?, you should see two lines just 2 lines, it happens with the actual Model of Dabrain, it's is rare and not so...in exchange of see that we should see a Explosion (Blue, etc.) wall coming over to us, but at the moment that can't be made, with a Planar square model that would be totally 100% impossible to be made.

So, actually both could have the same graphical quality, I don't really see too much difference
« Last Edit: March 10, 2006, 10:11:21 pm by Shadow0000 »

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: 3D Shockwaves question (or a bad idea)
Shadow's quite right on most accounts actually. You could indeed produce an identical shape of shockwave with a 2d plane as opposed to the 3d model currently being used - though you'd need to use a minimum of 16 polys on it. ;)
The reason? If you look at the animation DaBrain created, (the frames themselves, not the spectacular end result), you'll notice that the shockwave is expanding out from the corner, and only a quater of the shockwave is actually drawn at any time.

It works like this:


Basically, the projection of the animation onto the model remains the same throughout the sequence - the expanding motion we see is caused by the animated shockwave itself growing relative to the model. It is not only because the model is expanding.
(though it should be noted that the model is actually expanding throughout this, which is why they were originally much faster than normal shockwaves).

So really, the model itself is acting just like an expanding 2d plane for the shockwave animation anyway! ;)

All that would be needed to make it more efficient is to create two quatered planes stuck together. It would have the exact same look as the 3d model, with the possible difference of there being less distance between those twin parallel shockwaves we see with the current model. (to create a single shockwave, you'd just create a single quatered plane - I think they're visible from both sides)

The problem with 3d mesh based shockwaves is this:

From some angle, you will always see a horrible hard edge. There's not really a good way around it other than particle based effects.

In regards to the alpha mapping, it's automaticly done on all effects - which is why you don't see dark outlines around them. ;)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline CaptJosh

  • 210
Re: 3D Shockwaves question (or a bad idea)
Yeah. We don't have the capability to make our shockwaves look like the ones that Industrial Light and Magic makes for movies like the Star Wars: A New Hope update or Star Trek VI.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline DaBrain

  • Screensniper
  • Moderator
  • 212
    • Shadows of Lylat board
Re: 3D Shockwaves question (or a bad idea)
Karajorma is right. The poly count doesn't really matter. The maps are the problem. A problem with two parts. First part is the loading, which causes slow-downs on some machines and the second problem is the total ammount of used memory.

So it comes at a cost. The High-End version works just fine for me, but for anyone with slower and even with a faster PC, I got additional versions.


A flat plane... well I know many people do not like the dual layer shockwave, but trust me, it's a good idea. The shockwaves appear with random angles and a flat plane looks just flat from the side. -> Very ugly.

Using two layers minimizes the problematic angles. And they are not 100% flat. So the problem isn't completely fixed, but at least you won't see it very often anymore. For a complete fix, we'll need either a code change that limtes the possible angles, or shaders.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Re: 3D Shockwaves question (or a bad idea)
Karajorma is right. The poly count doesn't really matter. The maps are the problem. A problem with two parts. First part is the loading, which causes slow-downs on some machines and the second problem is the total ammount of used memory.

So it comes at a cost. The High-End version works just fine for me, but for anyone with slower and even with a faster PC, I got additional versions.


A flat plane... well I know many people do not like the dual layer shockwave, but trust me, it's a good idea. The shockwaves appear with random angles and a flat plane looks just flat from the side. -> Very ugly.

Using two layers minimizes the problematic angles. And they are not 100% flat. So the problem isn't completely fixed, but at least you won't see it very often anymore. For a complete fix, we'll need either a code change that limtes the possible angles, or shaders.

That's what I was trying to get at.  I still prefer 2D because shockwaves should be spherical in space (the Praxis effect as it's called has always bothered me, to be honest) and the only way to make that work without shaders is to use a map that always faces the player in the same way.  There are downsides, yes.  But it's still the most practical way to do it especially if you're quibbling over polycounts, and it avoids the edge problem entirely.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: 3D Shockwaves question (or a bad idea)
How'bout a solution where you have a single expanding map always facing the player AND a separate spreading ring of fire that has an angle of max 60 degrees compared to the main plane?
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 
Re: 3D Shockwaves question (or a bad idea)
Quote
A flat plane... well I know many people do not like the dual layer shockwave, but trust me, it's a good idea. The shockwaves appear with random angles and a flat plane looks just flat from the side. -> Very ugly.

Actually the image I post above it's not a planar single layer, it has 2 layers as the shockwave model has. I know when you see a shockwave, most times you see 2 the a lower and a upper one. So we should see something very much like it.

My machine can afford even the Super-High End Shockwaves (OpenGL Mode, mostly), but since I see this tech for used for a White Dwarf, I believe it could be interesting (it's unreal I know, but the player should not see the difference).

----------------------------------------------------------

This is not really related, I just wanted to report it, but I take this idea from Celestia, a program that simulates the Solar System mostly (uses OpenGL), it uses *.TGA and *.DDS Textures (and others), it also supports multi-Alpha channel textures, Bump, Normal and Specular Level maps (shaders, etc.)

I don't know if this will help, but if someone found this useful (want to try to port some of the mapping code for the SCP mapping), Celestia is Open Source writted in Visual C++, the page of the source is here
http://sourceforge.net/projects/celestia

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Re: 3D Shockwaves question (or a bad idea)
Technically any format that FS supports that can have alpha transparency will use it, more or less.  The trouble is the polygon ordering is not as robust because the rendering system was not originally designed for transparency and so you can have transpartent polys obscure non-transparent ones.  This is a fairly major issue with cockpits, and it's something I've had to deal with numerous times.  In theory it's supposed to be getting some attention, but I don't know how far Bob's gotten with the material system.

As an aside, the trouble with fixing the angles in which shockwaves can generate is that you cannot provide any assurance that the minimum angle that you set will be maintained through the duration of the shockwave's existance.  In fact, no matter how you set it up, I can still produce a screenshot that will show the shockwave at a hard angle that is very much non-optimal.  As for using both, I think everyone dev-side will shoot that one down in a heartbeat, as shockwaves are already the single leading source of texture map memory usage and adding a second map to that equation (2D plus the one for geometry) would be fairly universally condemned, just on performance concerns.  But ultimately I stand by the insistance that there is absolutely no way you can make a shockwave with a box model that looks good from many angles (or at least doesn't scream "I'm 4 polygons!") from most angles.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: 3D Shockwaves question (or a bad idea)
Well, my currently-weird net connection swallowed my post..... :(

My whole point was that the current model being used to render shockwaves onto isn't all that efficient, since the shape of it is having absolutely no bearing on the appearance of the shockwave other than having two layers.
If you were to replace the current 800 poly rounded shockwave-shaped model with a better version of this 16 poly shape, you would have a result almost identical in every way to what we currently have:

(side on they'll still both look silly though, as seen above. :\ )
HTL or not, if you're not even able to see those 800 polys on something so commonly used like the shockwave, there's not really a good reason to have them there. ;)

Allmost all the pure awesomeness of the current shockwaves comes from the map, not the model, since the model is acting exactly like a dual layered plane anyway! The roundness of it is just unnessecary. :)
(and by 2d plane I mean a 3d modeled object, not the mechanism Strat's referring to, where the plane always faces the player)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 
Re: 3D Shockwaves question (or a bad idea)
Yah, I always thought that I had a pretty high end computor.  Pentium 4 1gig of ram, 256mb graphicscard Nvidia 5400 (or was it 5200, oh well)  In anycase, whenever a single shockwave appears, weather it be from a bomb or a ship exploding, my computor will slow down to a crawl.  And if its 5 bombs that blow up a ship, well you can guess. There should at least be a flag that can choose between 3d shockwaves or 2d.  Quite frankly I think Vasudan Admiral's concept would be fine, and seems very realistic enough for kind the technology that most people have.  (most of us dont have Think Blues and HAL 5000 in our closets) There is no point In having a massive 800 polygone shockwaves with TGA textures, or what ever, if you can't see it trough the slideshow.  And If my computor is better than most and is still expieriencing this diffulculty, then I guess most, will have to sit trough the slide show,  which in the longrun will hurt SCP popularity.
« Last Edit: March 12, 2006, 10:29:25 am by Darklord42 »

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: 3D Shockwaves question (or a bad idea)
Well, that shouldn't be happening at all - the number of polys used in it - even at 800, only ammounts to a tiny difference in performance untill you have a very large number of them at once, since HT&L is so blindingly fast at rendering polys.

More likely you have the super high end shockwaves installed - check for a .VP file named "mv_adveffects" in your main FS folder, and move or delete it if you find it.
If that isn't the case, try using one of DaBrains lower res versions as Shadow posted here: http://www.hard-light.net/forums/index.php/topic,38016.0.html
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline DaBrain

  • Screensniper
  • Moderator
  • 212
    • Shadows of Lylat board
Re: 3D Shockwaves question (or a bad idea)
256mb graphicscard Nvidia 5400 (or was it 5200, oh well) 

Oh... I guess there is the problem. The 5200 is a really slow card. Even slower than many older cards (like the 4600 and the 4800).
Also many 256MB versions have slower ram, to keep the costs low for this low-end card, so you'd be better of with a 128 MB version.

If your P4 got more than 1,5 Ghz, you should really start looking for a better gfx card.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline BlackDove

  • Star Killer
  • 211
  • Section 3 of the GTVI
    • http://www.shatteredstar.org
Re: 3D Shockwaves question (or a bad idea)
I have an A64 3500+, 1gig of Ram, X550 Radeon.

With me it's a little different. The FPS slows to a crawl (and by crawl, I mean 1/2 second 2 FPS)  only with the first four or five explosions and then all the rest of the explosions work fine after that.

I gather they need to be written to memory or something first, and then after the game can quick-read them or something, they cease to be a problem.

Weird ****.

 

Offline DaBrain

  • Screensniper
  • Moderator
  • 212
    • Shadows of Lylat board
Re: 3D Shockwaves question (or a bad idea)
Again a really slow GFX card.

The X550 is a refresh of the X300, which was a low-end card. You can't use the high-end versions of the shockwaves with these cards. They can't handle it.

The mid-quality version needs a gfx card with at least the power of a GF4 TI, GF FX 5700 or Radeon 9600 Pro.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Re: 3D Shockwaves question (or a bad idea)
I wish my laptop vid card had HTL support. :(
Freelance Modeler | Amateur Artist

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: 3D Shockwaves question (or a bad idea)
My Celeron D, 512MB computer with a ATI Radeon 9250 (PCI :mad:) card handles most of the normal effects pretty well, but tends to slow down to 20 fps whenever a 3D shockwave appears. I know I don't have a high end card, to say the least, but I think a more available lower end shockwave (included in the baseline media VPs) might be in order, because many peoples systems don't really seem up to it.