Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: Valathil on April 12, 2012, 12:47:47 am

Title: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 12, 2012, 12:47:47 am
Here's a vid if you haven't seen it yet: http://www.youtube.com/watch?v=ScWqgReCRPk&hd=1

Zip file here: http://www.mediafire.com/?fpwko4ev1ccqfwq with a build, shaders, a patchfile for programmers, and a noise texture.

the shaders go into the data/effects directory and the noise texture in data/maps.

Please test some mission where cap ships blow up and report any oddness.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Mongoose on April 12, 2012, 02:03:03 am
How did you...bwuh... :eek2:
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: headdie on April 12, 2012, 02:43:32 am
 :eek2: :jaw:
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Kolgena on April 12, 2012, 02:57:05 am
That's really cool. Much better than the jarring sharp line we have now.

A couple refinements to consider, no idea how hard they'd be to do:

Could the dissolving "plane" move at a variable pace? (preferably more rapidly in time with explosions, and slower in between explosions)
A particle effect of small hull pieces coming off the dissolving plane, as if it were crumbling into chunks rather than burning away like paper. These particles (if ambitious) could pull from the cap ships textures somehow.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 12, 2012, 08:49:24 am
Wow. You keep to amaze me. The only thing (that I can think of now) that could enhance it would be implementing Kolgena's suggestion.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Rga_Noris on April 12, 2012, 10:14:29 am
Wow! You keep to amaze me too!
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: General Battuta on April 12, 2012, 10:15:14 am
it's a miracle. a miracle
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: The E on April 12, 2012, 10:57:02 am
I can confirm that this works as advertised on ATI cards.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Spoon on April 12, 2012, 12:55:17 pm
I can confirm that this works the way its meant to be played.
Also, its super sweet and a huge improvement over the old clipping plane.  :yes:
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 12, 2012, 04:04:26 pm
http://youtu.be/04OcdUG5e5A?hd=1

[attachment deleted by a ninja]
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: General Battuta on April 12, 2012, 04:05:22 pm
Mega gorgeous. It'd be awesome if there were a way to 'plug the hole', so to speak, but I'm not sure how you'd go about it.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 12, 2012, 04:19:00 pm
well there are bees and flowers ........
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Kolgena on April 12, 2012, 04:22:02 pm
How did you-- never mind. So awesome.

(the only thing now is that it looks like hull is peeling away to reveal the same hull underneath where there's premodeled debris. Very mall price to pay. Could be fixed by retexturing debris to look less pristine)
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 12, 2012, 04:29:14 pm
yeah but like "upper armor plating is burning off or ****" also dont get too excited it seems the effect is really dependent on model size so i have to do a version where its dependent on the size. also this version i posted screws up the 3d ship select. Also ATI's have problems apparently. JUST PLAY IT THE WAY ITS MEANT TO BE PLAYED

EDIT: More to come 14.04.12 Real Life calls for duty
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Bobboau on April 12, 2012, 06:57:14 pm
I'm not sure the deformation really works, I mean technically it's cool, but it makes the ships seem too soft, and you are going to have issues with it going through debris and it's self.you might want to extend the width of the basic effect, so the burn time acts longer.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 12, 2012, 07:59:50 pm
im seeing some space through the ship that kinda breaks the illusion for me. is there any way to support any of the things from this thread to fill in the ship's holes with geometry.
http://www.hard-light.net/forums/index.php?topic=80098.msg1589929#msg1589929
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nighteyes on April 12, 2012, 08:23:29 pm
It looks good, but I don't think it works so well currently, mainly because the line moves along the hull in a constant speed, giving the feeling the ship is peeling rather than exploding, the glowing line probably draws too much attention, so you notice it more than before when there was nothing.

is it possible to adjust the animation? so instead of the line constantly moving, it would stay in place for a second of so, than deform/vaporize at once, a section at a time, as if the hull is actually exploding a part at a time as the ship dies.
*the animation itself won't have to change, just the way it renders the effect
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Cyborg17 on April 12, 2012, 08:47:29 pm
The most recently posted video looks beautiful to me. 

I feel like the thing getting in the way is the gigantic image of an explosion going on behind the ship. Although I know we could never get everybody to agree on a "best" explosion, I think we can agree that the way Vanilla Freespace handled explosions was mostly to hide the way big ships exploded.  I feel like there is probably a better way to get explosion bitmaps, flashes and effects like this to work together.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Kolgena on April 13, 2012, 12:34:15 am
nooooo why must everything ATI break first distortion on thrusters now this
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: FreeSpaceFreak on April 13, 2012, 01:42:44 am
Now that's what an exploding ship should look like! Nice work on the skin blowing up :yes:
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: logomancer on April 13, 2012, 12:49:10 pm
How does the effect play out on smaller ships like cruisers?
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: bkd86 on April 15, 2012, 11:19:07 am
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: pecenipicek on April 15, 2012, 11:25:00 am
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.
thank you for applying to model and texture those bits as well. We eagerly await your contributions.

Cant do it? Sorry, shut up then.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: The E on April 15, 2012, 11:34:29 am
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.

Which, as pece has remarked, is kinda impractical unless you build your models from the ground up with this effect in mind. Since 100% of all models aren't done that way, making it look good is a matter of chance.

The hull dissolve bit of this works pretty well, it's just the vertex deformations that fail a bit. Which is the price that has to be paid when experimenting with this stuff, sometimes an idea doesn't really pan out as you would expect.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 11:42:52 am
Would it be possible to change the destruction mechanism a bit (optionally, of course), so that instead of turning into "debris" submodels, a destroyed ship would retain it's main mesh and all non-subsystem submodels (subsystem ones would turn into "destroyed" variant if there's one and disappear if there isn't), and change it's textures to a destroyed variant via shader? Combined with this effect, it could look really awesome, not to mention more realistic. Of course, it won't be used by Mediavps, but think of possibilities it'd open for mods.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 15, 2012, 12:04:16 pm
Dragon what you want is basically how Starlancer did it. The thing is we cant just remove the ship breaking up aspect it's just a part of the game that was in since FS1. What i do want to ask you guys since I experimented a bit with the mesh deformation and it really doesnt look good on most ships because of low poly count I need some suggestions that are not going to be Performance hogs like Kolgena's particle suggestion but might spice up the dissolve effect I have now. Again Mesh Deformation will not be in the final version. We wont go into Geometry shading and tesselation any time soon now. Also i'd like to hear from the MediaVP guys how we gonna regulate the integration of the noise texture so people can get it when the next release comes with the feature.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 12:19:13 pm
Like I said, my proposition wouldn't be of any use for Mediavps, but I'd like to be able to enable it for mods, especially those that aren't set in FS universe. Perhaps even have the game chose between this and FS-style destruction based on the way the ship was destroyed, but that would be for the future (plus I'm not exactly sure how to do it to make it both controllable and realistic).

As for suggestions, I think that Kolgena's idea with variable dissolving speed and particles splitting off is the way to go. I can't really think of any way to made it look more awesome without killing performance. Perhaps adding a way to control the dissolving effect speed and color on a per-ship basis could be a good idea.
Also, on some retail models, there are "split" subsystems, which aren't referenced in tables. I wonder what they do, maybe you could do something interesting with them.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: pecenipicek on April 15, 2012, 12:22:51 pm
Like I said, my proposition wouldn't be of any use for Mediavps, but I'd like to be able to enable it for mods, especially those that aren't set in FS universe. Perhaps even have the game chose between this and FS-style destruction based on the way the ship was destroyed, but that would be for the future (plus I'm not exactly sure how to do it to make it both controllable and realistic).

As for suggestions, I think that Kolgena's idea with variable dissolving speed and particles splitting off is the way to go. I can't really think of any way to made it look more awesome without killing performance. Perhaps adding a way to control the dissolving effect speed and color on a per-ship basis could be a good idea.
Also, on some retail models, there are "split" subsystems, which aren't referenced in tables. I wonder what they do, maybe you could do something interesting with them.
just use bigger chunks of a ship if you want non-"small bits everywhere" debris. oh, wait, that'd mean that you'd have to learn a proper 3D app, sorry.



Spoiler:
yes, i'm cranky.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 12:30:26 pm
just use bigger chunks of a ship if you want non-"small bits everywhere" debris. oh, wait, that'd mean that you'd have to learn a proper 3D app, sorry.
Spoiler:
yes, i'm cranky.
Your "solution" is worthless. I don't want chunks at all, I want the mesh to be intact, but as a charred, burnt out hulk. Also, it should keep the parent ship's velocity (and coast to a stop after a while), don't explode randomly and don't spin randomly. If this was just about not having small chunks, it wouldn't be a problem, HTL Fenris is done that way. It does look good, but definitely not the effect I'm after. Think Starlancer of Wing Commander Prophecy for what I want the effect to be like (except more awesome, of course).
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: The E on April 15, 2012, 12:33:28 pm
Quote
I need some suggestions that are not going to be Performance hogs like Kolgena's particle suggestion
Quote
I think that Kolgena's idea with variable dissolving speed and particles splitting off is the way to go.

 :banghead:

Your "solution" is worthless. I don't want chunks at all, I want the mesh to be intact, but as a charred, burnt out hulk. Also, it should keep the parent ship's velocity (and coast to a stop after a while), don't explode randomly and don't spin randomly. If this was just about not having small chunks, it wouldn't be a problem, HTL Fenris is done that way. It does look good, but definitely not the effect I'm after. Think Starlancer of Wing Commander Prophecy for what I want the effect to be like (except more awesome, of course).

Use change-ship-class to swap the healthy and hulked versions, use ship-maneuver to induce rolls, use explosion-effect to cover up the transition, use force-glide to force gliding et voila, instant hulk using technology already present.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: pecenipicek on April 15, 2012, 12:51:34 pm
just use bigger chunks of a ship if you want non-"small bits everywhere" debris. oh, wait, that'd mean that you'd have to learn a proper 3D app, sorry.
Spoiler:
yes, i'm cranky.
Your "solution" is worthless. I don't want chunks at all, I want the mesh to be intact, but as a charred, burnt out hulk. Also, it should keep the parent ship's velocity (and coast to a stop after a while), don't explode randomly and don't spin randomly. If this was just about not having small chunks, it wouldn't be a problem, HTL Fenris is done that way. It does look good, but definitely not the effect I'm after. Think Starlancer of Wing Commander Prophecy for what I want the effect to be like (except more awesome, of course).
okay, use the mesh of the original ship, cut it up in parts which you want to be a bit on the "banged up" side. take the texture of the ship, mess it up, make it "trashed hulk".

or what the E said.

But wait. Any of that would require for you to have actual abilities to actually DO things. Your "texturing" attempts were just recolors of normal tiles. Your help with the mods whose badges you have collected are "look at assets, ***** about something unrelated, pretend you did constructive criticism".

Everything you try to do is "i wanna dis, i wanna dat!", then pretend you know better than people who actually work on these things. You ignore plainly shown information and ask useless stuff. Stuff that you could've learned if you actually did/tried to do something yourself. But noooo. You continue to be a little demanding dude who cant do **** other than to take others work, modify a few bits and bobs here and there and then try to pass it off as something awesome/new/whatever.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 15, 2012, 01:04:25 pm
Whoa whoa whoa guys slow down there. You can flame each other in IRC can we please keep this on topic.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: mjn.mixael on April 15, 2012, 01:32:43 pm
Well, as for the noise texture..

I would think that we can't require people to have the MediaVPs for mods or to run FSO. So the noise texture (If I'm understanding this right) can be packaged with the MediaVPs, but there should probably be (perhaps low-res or something) one built into the shader/code/however this works...

Zacam, can correct me if I'm wrong though.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 02:16:57 pm
or what the E said.

But wait. Any of that would require for you to have actual abilities to actually DO things. Your "texturing" attempts were just recolors of normal tiles. Your help with the mods whose badges you have collected are "look at assets, ***** about something unrelated, pretend you did constructive criticism".

Everything you try to do is "i wanna dis, i wanna dat!", then pretend you know better than people who actually work on these things. You ignore plainly shown information and ask useless stuff. Stuff that you could've learned if you actually did/tried to do something yourself. But noooo. You continue to be a little demanding dude who cant do **** other than to take others work, modify a few bits and bobs here and there and then try to pass it off as something awesome/new/whatever.
This is obvious trolling, so I won't comment on it anymore. Not to mention this solution doens't work either, but I've considered it. :) I don't want any mesh modifications, save for destroying subsystems (I could make a damage texture, and my suggestion does in fact require doing so). And it'd still be subject to randomly exploding, drifting and other such behavior, which is a bad thing. And please refrain from making ad hominem (personal) attacks in a serious thread.

As for The_E's solution, it relies too much on SEXPs, making it somewhat unrealiable, especially when dealing with capships that don't follow waypoints, not to mention the transition will be instant in this case, while the entire reason I posted that suggestion here was to point out that it'd go really well with Valathil's dissolution improvements. Also, explosion-effect was, last time I checked, quite limited, so the whole thing would end up looking rather bland. Not to mention the game would never consider the ship destroyed, which creates a load of other problems (most of them not insurmountable, but the player won't be able to score a kill that way). Granted, you could emulate WCP-style capship explosions with this (and it's not a bad idea overall), but my suggestion was about making an effect similar in style, but looking a lot better, a lot more intuitive to use and more realiable.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: zookeeper on April 15, 2012, 03:47:56 pm
Would it be possible to change the destruction mechanism a bit (optionally, of course), so that instead of turning into "debris" submodels, a destroyed ship would retain it's main mesh and all non-subsystem submodels (subsystem ones would turn into "destroyed" variant if there's one and disappear if there isn't), and change it's textures to a destroyed variant via shader? Combined with this effect, it could look really awesome, not to mention more realistic. Of course, it won't be used by Mediavps, but think of possibilities it'd open for mods.

Can't you do that simply by giving the ship only one debris piece, which is a copy of the normal version but with a different texture? Maybe I'm not fully understanding what you want or maybe there's something about debris behaviour that renders it an unworkable idea, but without testing, I can't think of much obstacles besides inheriting velocity and so on, which you could probably script.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: FreeSpaceFreak on April 15, 2012, 03:49:20 pm
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.

Hey, this man has a point. When this effect makes it into trunk, it would look awesome when combined with framework debris models. It might be worth redoing the debris for the ships that blow up often, like Fenrises or Cains, and it's definitely something to keep in mind when making debris from scratch. Disembodied framework floating about...

What I'm wondering now is, how does the peeling effect look on more complicated geometry? The Orion explodes outward, that's easy, but what about say the Karuna with that hollow bow? It might look odd if the effect is not coded with this in mind.

Would it be possible to change the destruction mechanism a bit (optionally, of course), so that instead of turning into "debris" submodels, a destroyed ship would retain it's main mesh and all non-subsystem submodels (subsystem ones would turn into "destroyed" variant if there's one and disappear if there isn't), and change it's textures to a destroyed variant via shader? Combined with this effect, it could look really awesome, not to mention more realistic. Of course, it won't be used by Mediavps, but think of possibilities it'd open for mods.

Would a POF with a single debris piece accomplish this effect? Or does FSO really want to split a ship in half? (Ninja'd by zookeeper)
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 04:36:15 pm
Would it be possible to change the destruction mechanism a bit (optionally, of course), so that instead of turning into "debris" submodels, a destroyed ship would retain it's main mesh and all non-subsystem submodels (subsystem ones would turn into "destroyed" variant if there's one and disappear if there isn't), and change it's textures to a destroyed variant via shader? Combined with this effect, it could look really awesome, not to mention more realistic. Of course, it won't be used by Mediavps, but think of possibilities it'd open for mods.

Can't you do that simply by giving the ship only one debris piece, which is a copy of the normal version but with a different texture? Maybe I'm not fully understanding what you want or maybe there's something about debris behaviour that renders it an unworkable idea, but without testing, I can't think of much obstacles besides inheriting velocity and so on, which you could probably script.
The main obstacle I see is that default debris are:
a). Slowly rotating (or not so slowly) and moving in a random direction with random velocity.
b). Spontaneously exploding right after the parent ship.
c). Comparatively easy to blow into nothingness.
As I said, I considered this. Maybe this can be mitigated somewhat, but I'm not sure how much. They should either inherit parent's velocity and keep it, or coast to a stop, like a disabled ship. Also, I'm not sure if a debris piece can have subobjects.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: bkd86 on April 15, 2012, 04:41:59 pm
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.
thank you for applying to model and texture those bits as well. We eagerly await your contributions.

Cant do it? Sorry, shut up then.
I don't know you from Adam, and you have no idea what I can or can't do.  I'm not telling anyone what to do, just making a suggestion. And for your information I could do both the model and texture. Thanks now shut up.

Is the debris specific to each model currently or just a generic set of props.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: pecenipicek on April 15, 2012, 04:43:02 pm
What the debris needs to have to sell the effect is to look like hull frame work with the skin peeled off. That would look really neat. Either have the debris retextured or remodeled.

Hey, this man has a point. When this effect makes it into trunk, it would look awesome when combined with framework debris models. It might be worth redoing the debris for the ships that blow up often, like Fenrises or Cains, and it's definitely something to keep in mind when making debris from scratch. Disembodied framework floating about...

What I'm wondering now is, how does the peeling effect look on more complicated geometry? The Orion explodes outward, that's easy, but what about say the Karuna with that hollow bow? It might look odd if the effect is not coded with this in mind.

Would it be possible to change the destruction mechanism a bit (optionally, of course), so that instead of turning into "debris" submodels, a destroyed ship would retain it's main mesh and all non-subsystem submodels (subsystem ones would turn into "destroyed" variant if there's one and disappear if there isn't), and change it's textures to a destroyed variant via shader? Combined with this effect, it could look really awesome, not to mention more realistic. Of course, it won't be used by Mediavps, but think of possibilities it'd open for mods.

Would a POF with a single debris piece accomplish this effect? Or does FSO really want to split a ship in half? (Ninja'd by zookeeper)
that is pretty much what i told him, but apparently "its worthless"
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: mjn.mixael on April 15, 2012, 04:49:24 pm
Valathil asked that we stay on topic and stop debating something that can be done perfectly fine with SEXPs (regardless of whether or not Dragon wants to do that much work.) If you guys want to keep discussing how to have ships burn into hulks, I recommend taking the discussion to Modding or a new thread.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 05:13:36 pm
A split could indeed be beneficial, but I don't think the split off thread should go to modding, as currently, there's no way to create the effect I wanted with SEXPs, contrary to what everyone seems to think (unless fancy transitions when changing ship classes and adding kills to player's scoreboard via SEXPs have been implemented and I haven't heard of it). Debris piece approach also has it's own problems.

As for OT, well, it's so awesome I don't have too many suggestions how to improve it. Kolgena already suggested the only improvement I can think of. Defining the noise texture on a per-ship basis would also be helpful.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: General Battuta on April 15, 2012, 05:34:56 pm
This is a thread for discussion of this badass amazing effect Valathil has created, not how to achieve black hunkage.

(easy enough to add kills to the player scoreboard on demand though)
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 15, 2012, 06:06:46 pm
But how do we discuss something everybody agrees on? :) The effect is awesome, the only possible suggestion had already been made on page 1 and seconded a hundred times. It's difficult to discuss something people seem to have consensus on (an amazingly rare occurance, but it happens). I could repost it on the Polish forum for FS though, then you'll get a heated discussion, tons of complaints and flaming in no time (I don't know how Poles do this, so don't ask me about it). :)
BTW, PM me about this scoreboard hack. It sound handy.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 16, 2012, 02:55:18 am
I know i said we cant replace the ship breaking up thing and all cause of legacy BUT: http://youtu.be/aSxQL-Qb8Y0?t=2m55s

dunno maybe hybrid break the ship in half for some time then blow up the 2 chunks?

DISCUSS!

PERFORMANCE ISSUES ? : -awesomeshipbooms
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 16, 2012, 06:24:23 am
i brought this up already but is there a way you could superimpose a cross section model into the gaping hole during the destruction sequence. im just seeing bits of space behind the explosions where bits of hull should be and it kinda looks odd. maybe render that section of the model to the stencil buffer in solid white with the polys flipped. and then maybe render some stuff (i mean it could just be a noise map, or geometry whatever) in the masked areas (probibly also checking the z buffer to differentiate foreground from background), so it doesnt look like space. maybe alternate a series of cross sections, and have it switched and repositioned with each large eruption, so it looks like the internal structure is getting blown out revealing another layer of destruction.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Sandwich on April 16, 2012, 07:37:29 am
I know i said we cant replace the ship breaking up thing and all cause of legacy BUT: http://youtu.be/aSxQL-Qb8Y0?t=2m55s

Heck yes. :yes:

Also, here's what I posted as a comment to your video, for the rest of the forumites to see:

Quote
Now that's neat! Like IC said, though, it is a bit clean for an explosion... hmm... is there anyway for an initial, rapid-travelling shockwave to do the peel effect, with the explosions following along slowly afterwards? The explosion in the Mythbuster's episode with the cement truck comes to mind (http://www.youtube.com/watch?v=Gxm_qpKh7Jw), where the initial blast is near-instant it's so fast, but the billowing cloud of dust expands slowly afterwards.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Valathil on April 16, 2012, 12:12:27 pm
i brought this up already but is there a way you could superimpose a cross section model into the gaping hole during the destruction sequence. im just seeing bits of space behind the explosions where bits of hull should be and it kinda looks odd. maybe render that section of the model to the stencil buffer in solid white with the polys flipped. and then maybe render some stuff (i mean it could just be a noise map, or geometry whatever) in the masked areas (probibly also checking the z buffer to differentiate foreground from background), so it doesnt look like space. maybe alternate a series of cross sections, and have it switched and repositioned with each large eruption, so it looks like the internal structure is getting blown out revealing another layer of destruction.

we could theoretically turn off culling for the blow up models so you get the reversed polies as well
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Kolgena on April 16, 2012, 02:57:10 pm
I think the only way to actually get good looking interior sections is to have tightly packed/large debris pieces with girders and superstructure as was suggested on page 2.

Yeah, that's a crapton of remodeling to do for every cap ship.

(Is there any way to make debris invulnerable, or at least with orders of magnitude more HP? It seems a big problem with tightly packed debris is that they bump into each other and blow each other up)

Does the erase effect have to start in the middle and work towards the front and back, or can its axis or orientation be different/randomized/scripted?
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Sandwich on April 16, 2012, 03:47:52 pm
Is it impossible to generate the effect of interior structure on the fly, as part of the shader somehow?
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: mjn.mixael on April 16, 2012, 03:49:10 pm
DANGER! DANGER!

This is where we start asking for variations of geomod, right?
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Mongoose on April 16, 2012, 03:51:12 pm
yus yus
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 16, 2012, 06:27:47 pm
To be fair, there were some quite serious discussions going quite far beyond "implement GeoMod somehow", so we may someday reach the point where it stops being just a running joke.
Is it impossible to generate the effect of interior structure on the fly, as part of the shader somehow?
AFAIK, shaders mostly affect textures and lighting, I'm not sure if they can change the actual mesh.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: sigtau on April 16, 2012, 06:33:04 pm
AFAIK, shaders mostly affect textures and lighting, I'm not sure if they can change the actual mesh.

http://en.wikipedia.org/wiki/Displacement_mapping

Scroll to the bottom.  If HLSL shaders can do displacement mapping, it is therefore possible for mesh modifications to be made via shaders.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: The E on April 16, 2012, 06:50:21 pm
Something like this has been discussed in a recent brainstorm on #scp. And yes, displacement mapping is trivial to implement in a shader.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 16, 2012, 07:02:32 pm
So, you're saying SCP could use this technology? That would be really, really interesting. Seems I keep underestimating shaders. :)
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 16, 2012, 07:36:13 pm
To be fair, there were some quite serious discussions going quite far beyond "implement GeoMod somehow", so we may someday reach the point where it stops being just a running joke.
Is it impossible to generate the effect of interior structure on the fly, as part of the shader somehow?
AFAIK, shaders mostly affect textures and lighting, I'm not sure if they can change the actual mesh.

there are geometry shaders actually, but they are fairly new, and i dont think the engine is set up for them just yet. we have given geomod some serious thought though, there was a thread in modding about it. the idea was to log your gashes to a data structure containing the dynamically generated gash mesh (this is just a few polies from the model and remapped), the position and normal of impact, what hole model to use, its transform data, etc. you use independent hole models, which could be defined by ship, by species, by weapon, etc.

a gash would contain a small subset of the surface polies that were intersected by the damage radius of a weapon, with a greyscale damage texture and planner uv projections (projected along the impact normal) applied. this would be rendered to the stencil buffer (i thought about using a sprite but it would look crappy). you would render the ship normally, and then you would render to the stencil buffer, and then you would place hole models in the logged impact locations, and using the stencil buffer as a mask, render the holes. the result is a composite of ship and hole models.

the holes would be manifold meshes, so when rendering them you would need some way to clip them, as parts would be sticking out of the model. i figure theres is some fragment shader magic that solves this problem. all i could think of was to use a second z buffer when rendering the holes (as you dont want to overwrite the z values for the hull). toss fragments behind closest hole model fragment (as usual) using the value from the second z buffer, but also toss fragments that are in front of the hull fragments (value from main z buffer). if these two conditions are met, render the fragment to the frame buffer, with regards to the stencil buffer. after ships and their holes are rendered, you somehow need to copy the second z buffer data into the stenciled area, after that you can reallocate the stencil and second z buffer to other uses. i dont know the details well enough to know if this will work, my opengl skills are still in the stone age, everything ive done thus far has been fixed function stuff.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Sandwich on April 16, 2012, 08:45:53 pm
*watches Nuke's post fly far, far above head*

Erm, yes, that. In any case, my thought regarding having the internal decks melting away was simply to have a cross-section surface that moved along the ship with the melting hull plating and explosions, and have the "texture" of said surface be a dynamically-generated mesh of glowing horizontal (and some vertical) lines.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Woolie Wool on April 16, 2012, 09:39:56 pm
One issue with procedurally generating interior structure is that the actual interior structure of a ship can vary widely. An Orion could be modeled as just a box frame with hull plating and decks stacked atop each other, but the Karuna, for instance, would have large voids, support structures that are completely solid, etc.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Mongoose on April 16, 2012, 09:55:38 pm
Yes, but you're talking about a region that's going to be mostly covered up by explosion animations and only visible for a few seconds anyway; I don't think anyone would begrudge structure that might not make sense for the specific class of ship.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 17, 2012, 01:19:57 am
it can be a pre-modeled set specific to whatever ship (or species of ship) happens to be blowing up. not necessarily part of the ship model. i mean this cross section can have girders sticking out, split open decks, etc, and can be textured and glow mapped as if it was melting or whatever. you use a set so you dont get bored looking at the same cross section each time another section of ship blows up. of course they would be visible for a very short period of time and you might not even notice with all the explosion goodness going on.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Sandwich on April 17, 2012, 08:20:45 am
Indeed; the potential cross-section would merely be there to prevent the dissolving ship hull from appearing hollow - the specific accuracy of the deck styles doesn't matter.

If you really care about it though, it makes sense to me to have faction-specific internal deck shader patterns. Terran ships could have the typical stack of decks with bulkheads scattered about; Vasudan ships might look more organic (see the Psamtik main hall); Shivans meanwhile would be all angular and hive-like (or whatever).
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: General Battuta on April 17, 2012, 08:49:13 am
Indeed; the potential cross-section would merely be there to prevent the dissolving ship hull from appearing hollow - the specific accuracy of the deck styles doesn't matter.

If you really care about it though, it makes sense to me to have faction-specific internal deck shader patterns. Terran ships could have the typical stack of decks with bulkheads scattered about; Vasudan ships might look more organic (see the Psamtik main hall); Shivans meanwhile would be all angular and hive-like (or whatever).

Again, though, don't you think it's going to look weird when ships with large internal cavities like UEF frigates or Cordi motherships suddenly turn solid when exploding?
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: LordMelvin on April 17, 2012, 09:39:27 am
<fanwank>The ship isn't turning solid, that's random debris from elsewhere in the hull that got blasted into the relevant internal cavities.</fanwank>
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Aardwolf on April 17, 2012, 02:15:48 pm
If anyone could get us geomod it would be Valathil.

There's already been some discussion in the "Visible damage on ships" thread (http://www.hard-light.net/forums/index.php?topic=80098.20)... Pottuvoi linked to a handful of papers on the stuff.

As Nuke and I have said, stencil buffer magicks. Well, here be wizards.  :yes:
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: pecenipicek on April 17, 2012, 05:52:14 pm
it can be a pre-modeled set specific to whatever ship (or species of ship) happens to be blowing up. not necessarily part of the ship model. i mean this cross section can have girders sticking out, split open decks, etc, and can be textured and glow mapped as if it was melting or whatever. you use a set so you dont get bored looking at the same cross section each time another section of ship blows up. of course they would be visible for a very short period of time and you might not even notice with all the explosion goodness going on.
stuff like blackwolf's (i think its his, dont kill me if it aint) modular girder/station pack might come in handy here actually.


still, i believe that the programatic part behind that will be a sodding mess to set up.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Bobboau on April 17, 2012, 10:29:57 pm
Again, though, don't you think it's going to look weird when ships with large internal cavities like UEF frigates or Cordi motherships suddenly turn solid when exploding?
yes, this would look weird, but less weird than them appearing to have no inside what so ever.

this problem could be partially addressed by having massive amounts of debris particles.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 17, 2012, 11:56:54 pm
actually with stincil buffer majics you could probbibly apply cross sections only to parts that arent modelled hollow. if your ship had a hollow center, it should be theoretically possible to only fill those areas that are not voids. as the polygons from the interior will be in front of areas that are supposed to be filled with the cross section, all the data you need for this should be in the z buffer and stencil buffer, fragment shader stuffs.
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Spoon on April 18, 2012, 08:23:07 am
Ya'll sound like backseat coders to me
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Dragon on April 18, 2012, 08:33:02 am
Both Nuke and Bobboau are coders, who brought a lot to the engine. Nuke improved particle system, Bobboau implemented animation code.
I don't see how they're "backseat coders".
Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Nuke on April 18, 2012, 06:55:06 pm
Ya'll sound like backseat coders to me

i admit that my code fu is not strong. i can do some opengl stuff, but nothing fancy, elaborate, or modern. i have done a few minor features and bug fixes within the engine as well. and i kind of loosely understand the techniques i have discussed. i however do not yet have the skills necessary to implement them. dont think of it as me demanding such and such feature. its more about stirring up discussion on techniques that may be used to improve the feature. this is more or less of a learning experience for me to have this kind of discussion with the wizards.

Title: Re: Shader Based Dissolve as Enhancement for Capship Explosion Clipplanes
Post by: Bobboau on April 19, 2012, 02:49:31 am
yeah, I only implemented the entier hardware transformation and lighting engine that is the foundation for everything going on here in this thread, granted that was like 7 years ago, and it wasn't great.