[Release] System Features: Rings
Moderators: winston, another_commander
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: [Release] System Features: Rings
@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
The newest version is now available via the extension manager:
07/10/2018 - Version 2.9:
* better handling of the alpha channel
- RockDoctor
- ---- E L I T E ----
- Posts: 813
- Joined: Sat May 01, 2010 9:05 pm
- Location: Scotland
Re: [Release] System Features: Rings
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.Prester John wrote: ↑Sun Oct 07, 2018 6:00 pmYou just need a lot more memory on your PC, for all these graphics... Right?
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?
--
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")
Re: [Release] System Features: Rings
@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
2. Let's help the compiler to do the right thing.
could be simplified to
3. Another one to help the compiler.
doesn't need the
The value will never get negative. And most compilers will reuse the
4. You could also get rid of some branching
could become
A similiar approach could be used for the threshold calculations.
It's just a start, I know, but better than nothing.
Optimizations willtake eat time.
Edit: Optimized further, got rid of logical_if.
@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);
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);
max()
.
Code: Select all
r *= min(1.0, distance/5000000.0) - (1.0 - min(1.0, distance/5000000.0)) * sin(r2 * 3178.4 + phase);
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;
}
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;
It's just a start, I know, but better than nothing.
Optimizations will
Edit: Optimized further, got rid of logical_if.
Last edited by Svengali on Fri Oct 19, 2018 11:26 am, edited 2 times in total.
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: [Release] System Features: Rings
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.
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: [Release] System Features: Rings
I just made some more updates:
- more optimizations
- rings get more transparent when entering an atmosphere
- more optimizations
- rings get more transparent when entering an atmosphere
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: [Release] System Features: Rings
13/10/2018 - Version 2.10.2:
* some more minor optimizations
* some more minor optimizations
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: [Release] System Features: Rings
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...)
(unless, of course, this is my graphics card going crazy on me...)
- gsagostinho
- ---- E L I T E ----
- Posts: 573
- Joined: Sun Jul 19, 2015 1:09 pm
Re: [Release] System Features: Rings
Thanks, I think I know what happened and it should be fixed now. Could you please update your OXP and try again?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: [Release] System Features: Rings
Ah, much better! Thanks!
Re: [Release] System Features: Rings
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);
- RockDoctor
- ---- E L I T E ----
- Posts: 813
- Joined: Sat May 01, 2010 9:05 pm
- Location: Scotland
Re: [Release] System Features: Rings
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.
--
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")
Re: [Release] System Features: Rings
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.
- RockDoctor
- ---- E L I T E ----
- Posts: 813
- Joined: Sat May 01, 2010 9:05 pm
- Location: Scotland
Re: [Release] System Features: Rings
I've never used that one. Which makes it a potential target, straight off.
--
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")
Shooting aliens for fun and ... well, more fun.
"Speaking as an outsider, what do you think of the human race?" (John Cooper Clark - "I married a Space Alien")