Page 12 of 12
Re: [Release] System Features: Rings
Posted: Sun Oct 07, 2018 11:05 pm
by gsagostinho
@phkb Thank you so much!
The newest version is now available via the extension manager:
07/10/2018 - Version 2.9:
* better handling of the alpha channel
Re: [Release] System Features: Rings
Posted: Tue Oct 09, 2018 6:32 pm
by RockDoctor
Prester John wrote: ↑Sun Oct 07, 2018 6:00 pm
You just need a lot more memory on your PC, for all these graphics...
Right?
I'm not really sure. I know that (some) of these effects are done using "shaders", which somehow offloads the processing required to a graphics sub-system away from the general processing unit. And I recall (from when I last paid attention to such matters, in the 1990s) that graphics cards sometimes (generally? I dunno) have separate memory to the main processor. But how all that adds up, or what bits go where is just a black hole to me.
If I've got work to do on the laptop, it involves text, and occasionally changing the font of the text (but generally, it's the words that matter, not the appearance), so as long as my computer does that, the rest is someone else's problem. Where's my Perilomatic (R) Sunglasses?
Re: [Release] System Features: Rings
Posted: Tue Oct 09, 2018 8:46 pm
by Svengali
@RockDoctor: °sigh°
@Prester John: Not so much memory. It's more a graphics card which can handle this.
@gsagostinho:The rings are looking great now, gsagostinho!
And after taking a look at the shader - some ideas:
1. It could be worth using Oolites
fogUniform
for the atmosphere instead. Then you can get rid of quite a bunch of instructions easily. Shift the work to Oolite .-)
2. Let's help the compiler to do the right thing.
Code: Select all
vec3 offset = (up * uFloat2 * -y * 2.0) + (right * uFloat2 * x * 2.0);
could be simplified to
Code: Select all
vec3 offset = ((up * -y) + (right * x)) * uFloat2 * 2.0;
3. Another one to help the compiler.
Code: Select all
r *= min(1.0, distance/5000000.0) - max(0.0, 1.0 - min(1.0, distance/5000000.0)) * sin(r2 * 3178.4 + phase);
doesn't need the
max()
.
Code: Select all
r *= min(1.0, distance/5000000.0) - (1.0 - min(1.0, distance/5000000.0)) * sin(r2 * 3178.4 + phase);
The value will never get negative. And most compilers will reuse the
min(1.0, distance/5000000.0)
, so I left it in. But there's no guarantee that the compiler will reuse it... <mumbles something about stupid things>
4. You could also get rid of some branching
Code: Select all
if (det < 1.0 && dist > 0.0) {
float dp = (det - 0.8) * 5.0;
if (dp < 0.2) {
dp = 0.2;
}
r *= dp * 0.25;
g *= dp * 0.25;
b *= dp * 0.25;
}
could become
Code: Select all
float dark = float(det < 1.0) * float(dist > 0.0);
float dp = max(0.05,(det * 1.25) - 1.0);
dp = (dp * dark) + (1.0 - dark);
r *= dp;
g *= dp;
b *= dp;
A similiar approach could be used for the threshold calculations.
It's just a start, I know, but better than nothing.
Optimizations will
take eat time.
Edit: Optimized further, got rid of logical_if.
Re: [Release] System Features: Rings
Posted: Tue Oct 09, 2018 9:21 pm
by gsagostinho
Thank you SO much, Svengali! Really appreciate this, I have just incorporated your suggestions and they work exactly as they should, so I just made a new release.
Re: [Release] System Features: Rings
Posted: Tue Oct 09, 2018 11:11 pm
by gsagostinho
I just made some more updates:
- more optimizations
- rings get more transparent when entering an atmosphere
Re: [Release] System Features: Rings
Posted: Sat Oct 13, 2018 10:30 pm
by gsagostinho
13/10/2018 - Version 2.10.2:
* some more minor optimizations
Re: [Release] System Features: Rings
Posted: Tue Oct 16, 2018 12:56 pm
by phkb
There seems to be a fault in the latest version. Here's a shot using a plain 1.86 and just the System Rings OXP (so no chance of any conflicts), at Riedquat (G1)
(unless, of course, this is my graphics card going crazy on me...)
Re: [Release] System Features: Rings
Posted: Tue Oct 16, 2018 8:59 pm
by gsagostinho
Thanks, I think I know what happened and it should be fixed now. Could you please update your OXP and try again?
Re: [Release] System Features: Rings
Posted: Tue Oct 16, 2018 10:44 pm
by phkb
Ah, much better! Thanks!
Re: [Release] System Features: Rings
Posted: Fri Jun 19, 2020 4:07 pm
by Milo
After having my ship destroyed, I got the following exception:
Warning: removeFrameCallback(): invalid tracking ID.
Active script: System Features Ring effect script 2.10.3
systemfeatures-rings-effectScript.js, line 30:
removeFrameCallback(this.$fcb);
Re: [Release] System Features: Rings
Posted: Fri Jun 19, 2020 8:51 pm
by RockDoctor
Milo wrote: ↑Fri Jun 19, 2020 4:07 pm
After having my ship destroyed, I got the following exception:
Warning: removeFrameCallback(): invalid tracking ID.
Active script: System Features Ring effect script 2.10.3
systemfeatures-rings-effectScript.js, line 30:
removeFrameCallback(this.$fcb);
What did you do? (So I can not-do that.)
I've never
had a problem with pelting through a ring at torus drive speeds or under full military injectors - but I always flinch as I get the ground-rush which BASE jumpers describe.
Re: [Release] System Features: Rings
Posted: Fri Jun 19, 2020 9:13 pm
by Milo
I haven't looked into it yet, but it seems to be happening around the time I arrive at the station after my ship is destroyed (I'm testing shields so this is happening a lot...). I can more consistently reproduce it now by loading a saved game after being returned to the station after getting my ship destroyed. I'm using Ship Repurchase, unsure if that makes a difference.
Re: [Release] System Features: Rings
Posted: Sat Jun 20, 2020 8:13 pm
by RockDoctor
Milo wrote: ↑Fri Jun 19, 2020 9:13 pm
I'm using Ship Repurchase, unsure if that makes a difference.
I've never used that one. Which makes it a potential target, straight off.