[Release] System Features: Rings

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: System Features: Rings - truncated planet

Post by gsagostinho »

Hi RockDoctor,
RockDoctor wrote: Tue Aug 15, 2017 9:49 am
I'm guessing that my laptop doesn't have a shader (enabled), and this truncation of half of the planet is being done by the ring code trying to do things which it can't do. According to the System Info Applet (Fed25) I've got an "Intel® Bay Trail" graphics chip. Is that shader-capable?
These images show that the shader code isn't working. Could you please post the contents of your Oolite's log? I believe you can also check in that file if shaders are enabled for you or not.

Edit: if shaders are supported by your video card, you should have the phrase "Shaders are supported." on the beginning of your log.
Shouldn't the code detect if there's not a shader (whatever one of those is) and fall back to the code that was working in version 1.x of the add-on?
Well, this is one of many OXPs which require shaders. If your card is not capable of using shader, then the easiest solution is not to install it. All changes I've made in the current version (when compared to 1.x) are cosmetic, and if the problem is that your card cannot handle the shaders then you should have the same black plane intersecting the planet with either version 1 or 2. But if you are telling me that this same card was capable of handling version 1.x but has issues with the current 2.4, then the problem should be something else.
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: System Features: Rings - truncated planet

Post by RockDoctor »

gsagostinho wrote: Tue Aug 15, 2017 12:04 pm
Edit: if shaders are supported by your video card, you should have the phrase "Shaders are supported." on the beginning of your log.
I've got the full logs zipped, but I'm about to travel for a couple of days, and not taking the laptop with me.
The first few lines of ~/.Oolite/Logs/Latest.log are

Code: Select all

Opening log for Oolite version 1.84 (x86-64) under Linux 4.11.9-200.fc25.x86_64 at 2017-08-15 01:38:58 +0100.
2 processors detected.
Build options: OpenAL, new planets.
Note that the contents of the log file can be adjusted by editing logcontrol.plist.
01:38:59.665 [display.mode.list.native]: X11 native resolution detected: 1366 x 768
01:39:00.369 [joystick.init]: Number of joysticks detected: 0
01:39:00.370 [rendering.opengl.version]: OpenGL renderer version: 3.0.0 ("3.0 Mesa 17.0.5"). Vendor: "Intel Open Source Technology Center". Renderer: "Mesa DRI Intel(R) Bay Trail ".
01:39:00.371 [rendering.opengl.extensions]: OpenGL extensions (226):(long list removed)
01:39:00.540 [rendering.opengl.shader.support]: Shaders are supported.
So, there should be shaders. (BTW, the complaints others have made about Moire fringing don't seem too bad to me.)

Boogie, boogisimo, boogisimos !
--
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")
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: [Release] System Features: Rings

Post by gsagostinho »

RockDoctor wrote:
01:39:00.540 [rendering.opengl.shader.support]: Shaders are supported.[/code]
So, there should be shaders.
Ok, so in that case you should be able to run this OXP without any issues. The problem is something else then.
I've got the full logs zipped, but I'm about to travel for a couple of days, and not taking the laptop with me.
No problems, but without your full log it's impossible to know what's going on. The log would contain any error messages caused by a shader. So no rush, but once you are back please send me your full log.
(BTW, the complaints others have made about Moire fringing don't seem too bad to me.)
That's very nice to know! But now I am having issues understanding your problem, so are you able to see the rings in some circunstances? I thought you only saw that black plane intersecting the planet.

Cheers,
Gilberto
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: [Release] System Features: Rings

Post by RockDoctor »

gsagostinho wrote: Tue Aug 15, 2017 8:15 pm
That's very nice to know! But now I am having issues understanding your problem, so are you able to see the rings in some circunstances? I thought you only saw that black plane intersecting the planet.
If you look at the screenshots I posted earlier, you'll see elliptical arcs of colour centred around something not-the-planet-centre. I don't know if that's the rings plotting in the wrong place. Overlaying that is the blackout-annular plane.
will try to figure out how to mail you the logs. My fickr account will probably object to non-image files.
--
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")
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: [Release] System Features: Rings

Post by Cody »

RockDoctor wrote: Wed Aug 16, 2017 11:01 pm
will try to figure out how to mail you the logs. My fickr account will probably object to non-image files.
Open a free Box account and host them there?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: [Release] System Features: Rings

Post by RockDoctor »

gsagostinho wrote: Tue Aug 15, 2017 8:15 pm
No problems, but without your full log it's impossible to know what's going on. The log would contain any error messages caused by a shader. So no rush, but once you are back please send me your full log.
Board's User-control-panel tells me I have no posted files (implying that I can post files ??), but I can't see how. My blog won't take non--images either. Need an email address?, or is there another technique?
--
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")
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: [Release] System Features: Rings

Post by gsagostinho »

RockDoctor wrote:
If you look at the screenshots I posted earlier, you'll see elliptical arcs of colour centred around something not-the-planet-centre.
That's really nothing, that's the same I see here if I make a mistake in the shader code and it fails to load. Basically, if the shader is broken, then you can see the plane where the rings are "printed upon". Those alliptical arcs are really just artifacts of how this plane gets illuminated, nothing to do with the shader code.
will try to figure out how to mail you the logs. My fickr account will probably object to non-image files.
Dropbox could be an option, or you can also post it here as code (see the button on the form). I am interested in any errors involving this OXP or shaders in general, anything to do with GLSL.
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: [Release] System Features: Rings

Post by RockDoctor »

Cody wrote: Wed Aug 16, 2017 11:06 pm
Open a free Box account and host them there?
URL for Box? (googling)
From www.box.com : Starter £3.5 per user/month
I get enough spam from Dropbox on my phone to trust them like something I don't trust.
--
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")
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: [Release] System Features: Rings

Post by Cody »

Copy and paste the log into a post, highlight it, and hit the Code button.

Free Box account here - minimal sign-up, no hassle.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: [Release] System Features: Rings

Post by gsagostinho »

@Cody thanks for the tips. Another option would be using some of these free services which saves text for "eternity" (allegedly), such as Just Paste It.
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: [Release] System Features: Rings

Post by RockDoctor »

gsagostinho wrote: Tue Aug 15, 2017 8:15 pm
No problems, but without your full log it's impossible to know what's going on. The log would contain any error messages caused by a shader. So no rush, but once you are back please send me your full log.
I hope this link dos it - ~/.Oolite/Logs/Latest.Log and Previous.Log in a zip file. https://app.box.com/s/j06i2kvbt2exuisdnf4cn4laro67bhpk
(Incidentally, zip, is about 50kb, but the logs themselves around 3x max post size here.)
--
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")
User avatar
phkb
Impressively Grand Sub-Admiral
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

Post by phkb »

Looks like the important bit is in the "previous.log" file.

Code: Select all

13:29:20.550 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for systemfeatures-rings.fragment:
>>>>> GLSL log:
0:80(26): error: no matching function for call to `pow(float, int)'; candidates are:
0:80(26): error:    float pow(float, float)
0:80(26): error:    vec2 pow(vec2, vec2)
0:80(26): error:    vec3 pow(vec3, vec3)
0:80(26): error:    vec4 pow(vec4, vec4)
0:80(19): error: operands to arithmetic operators must be numeric
0:80(12): error: operands to arithmetic operators must be numeric
0:80(12): error: operands to arithmetic operators must be numeric
0:89(6): warning: `r' used uninitialized


13:29:20.551 [shader.load.failed]: ***** ERROR: Could not build shader systemfeatures-rings.vertex/systemfeatures-rings.fragment.
13:29:22.828 [files.notFound]: ----- WARNING: Could not find texture file "systemfeatures-rings.png".
The thing is, I would have expected this error to be in both logs. It's like the shader compiled OK one time, but then failed on another.

Edit: (lightbulb) Unless, the shader code is only compiled if the player does a hold-shift-and-restart, otherwise the previous compiled (or in this case, uncompiled) version is in play.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: [Release] System Features: Rings

Post by another_commander »

The shaders are not cached. You can check this by changing any shader and running the game without Shift. The change is applied immediately. So not sure why the error is present only in one log, maybe the entire ring shader was not run at all in one case due to conditions applying to rings' appearance?

Anyway, the error seems to be this line here:

Code: Select all

float r = 0.15 + 0.05 * pow(sin(r2 * 20000.0), 8) + 0.4 * noise3; // smaller thin bands + noise (when closeup)
pow is invoked with two parameters, of which the second is an int, which is probably not casted to float by the glsl compiler. If this is the only error, then the fix could simply be

Code: Select all

float r = 0.15 + 0.05 * pow(sin(r2 * 20000.0), 8.0) + 0.4 * noise3; // smaller thin bands + noise (when closeup)
Try it and see if that makes the rings appear correctly again.
User avatar
RockDoctor
---- E L I T E ----
---- E L I T E ----
Posts: 813
Joined: Sat May 01, 2010 9:05 pm
Location: Scotland

Re: [Release] System Features: Rings

Post by RockDoctor »

phkb wrote: Thu Aug 17, 2017 12:25 am
Edit: (lightbulb) Unless, the shader code is only compiled if the player does a hold-shift-and-restart, otherwise the previous compiled (or in this case, uncompiled) version is in play.
I had been loading and unloading variants of the UPS Courier add-on previously, so there had been re-starts.
--
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")
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: [Release] System Features: Rings

Post by gsagostinho »

another_commander wrote:
Anyway, the error seems to be this line here:

Code: Select all

float r = 0.15 + 0.05 * pow(sin(r2 * 20000.0), 8) + 0.4 * noise3; // smaller thin bands + noise (when closeup)
pow is invoked with two parameters, of which the second is an int, which is probably not casted to float by the glsl compiler. If this is the only error, then the fix could simply be

Code: Select all

float r = 0.15 + 0.05 * pow(sin(r2 * 20000.0), 8.0) + 0.4 * noise3; // smaller thin bands + noise (when closeup)
Try it and see if that makes the rings appear correctly again.
Sigh. GLSL is such a pain, you make a mistake with types or range of values and a whole bunch of GPUs handle it as if nothing happen, just to find one that doesn't. Same story with those negative numbers inside of pow(), in theory the first argument of pow() should be always positive (that's the standard), but for some reason some drivers are written to also handle negative ones making troubleshooting absolutely maddening.

Anyway, thanks for spotting this, a fix is on its way. I will test on my ATI and Intel cards before updating it.
Post Reply