New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hull heating shader effect #2550
Conversation
…l.h so that we don't need to include gl2 headers. Also clean the model materials of their heat gradient specialParameter0 settings.
Neat! |
@nozmajner Not with this one, this commit is just for heating due to being slammed through an atmosphere. |
Instead of having the parameters be a member of each instance of a ship I've just made them a class static. I have to change and set the value for each ship anyway so it makes no discernable difference. |
Cool, I will look! |
…e I'm already doing material setup!
Hmm, this still needs some work. |
…it's not being setup.
…sult is incorrect but at least it's not view dependent!
I think |
I'm wondering if I'm actually passing through the direction correctly but I need to figure it out :) |
…verse of the ships viewTransform. Thus getting it into the models local space (I think that's right!).
@shadmar tada! it seems to work for me now :) |
oO, I used 3 hours yesterday scratching my everything, even found my matrices book. I will have a look :) |
Nice! works very well, I changed one line to produce the effect earlier abit earlier so atmosphere shielded ships also get a nice effect.
|
Some of this code might be useful and could be recycled for an shield directional impact also later on (both heat and hits) |
The shield already has a simple directional hit effect. Open a ship like the deneb (on the Shields branch) in the modelviewer and click the "Hit me!" button to see it in action :) |
RE: |
|
Yep and it's pretty looking. Wanna code it? ;) I kinda know how to do it, but we have the slight problem that you can enter atmosphere facing any orientation. That means the profile from which you extend the heat shock geometry from changes as your orientation does. I don't know how to resolve that. This is just being a step in the right direction rather than the best-ever-re-entry-effect :) |
Actually if you can think of any way to do it then let me know and I'll try to implement it. |
If you want to do it with a mesh like that then it looks very closely related to shadow volumes, so descriptions you can find of how to construct the geometry for a shadow volume should be applicable to this. I've never implemented shadow volumes myself; I'm not sure how difficult it is to generate them robustly. If we had a worthwhile particle system implementation then we might be able to use that instead, although you still have to decide where to emit the particles... perhaps just put them on the 'leading' end of an ellipsoid around the ship. It wouldn't look the same, but it might look just as good with the right particle sprite(s) and parameters. |
@johnbartholomew good point, lets move this to the dev forum though, even if find time to do something for it I don't want it to impact this PR. |
Updated to master |
Looks very nice. Would be suitable to show off on http://pioneerspacesim.net/ |
Yeah, it's very much a start rather than an end :) |
Description:
Apply a simple heating shader effect based on the hull temperature and direction of travel.
It adds one texture which controls the heat gradient coloring. If you want to make it fade in later than squash the gradient further up and extand the black section towards the middle. Vice versa with the white end if you want it to ramp up earlier.
@shadmar you're a shader Ninja :) any advice on the shader itself?
Testing:
The best way to test is to launch with a powerful ship like the PumpkinSeed and make sure it hasn't got any atmospheric shielding. It's pretty clear when it's getting toasty!
Andy
@robn / @johnbartholomew - this is no longer WIP so is ready for review whenever there's opportunity. Check it out as it's quite a nice effect I think :) Wish I'd done it sooner!