Screenshots

General discussion for players of Oolite.

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: Screenshots

Post by gsagostinho »

Messing around with the System Features Rings OXP, trying to get more variety in ring size, thickness, allowing large planets also to NOT have rings, etc.:

Image

Image

Image

Image

Questions:
- does anyone know why the rings disappear after a certain distance (around 2.7 OU). This is particularly noticeable for people using distant suns, extra planets and/or torus to sun oxp's.
- if the rings could be set to 0.7-0.8 opacity they probably would look much better, but I found no way of having semi-transparent objects in Oolite. Is that possible, and if so is this documented somewhere?
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Screenshots

Post by Norby »

gsagostinho wrote: Sun Jul 16, 2017 4:53 pm
semi-transparent objects in Oolite
There is a way using shaders as in Flying Dutchman OXP:
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Screenshots

Post by another_commander »

Check also the atmosphere shaders in the current trunk builds. Atmospheres fade out if you are too close or too far from the planet and this is done by adjusting the alpha of the atmosphere drawable entity.
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Screenshots

Post by gsagostinho »

Thanks guys, I will check it out and see if I manage to solve the issues.
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Screenshots

Post by gsagostinho »

@another_commander if I understand correctly the atmosphere shader, you are basically using a variable named newOpacity to control opacity, ranging between 0.0 and 1.0. This variable is then used together with a vector of 3 elements to give the final 4 element vector gl_FragColor = vec4(totalColor, newOpacity); is that correct? If so, then I don't get why I am running into troubles because I tried something very similar: in the end of the fragment shader's code used by the Rings OXP, after all calculations for each of the three RGB components is done, we have gl_FragColor = vec4(r,g,b,1.0);. Changing r g and b does change the colour of the rings, but changing the last value to something lower than 1.0 does NOT change the opacity of the rings. Is there something else I need to check for this to work?

@Norby as for the Flying Dutchman OXP, that work does not use half-transparency, it uses either full transparency or full opacity.
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: Screenshots

Post by Cody »

I have an extra line in the atmosphere shader - newOpacity *= 0.6; and adjust the 0.6 to my taste, inserted thus:

Code: Select all

float dp = abs(dot(nvEyeVector, vec3(0.0,0.0,1.0)));
		if (dp > 0.16) {
			newOpacity = min(1.0, pow(0.16/dp,2.0)) * quant;
		}
		else
		{
			newOpacity = pow(dp/0.16,5.0) * quant;
		}
		newOpacity *= 0.6;
	}

	gl_FragColor = vec4(totalColor, newOpacity);
}
Does that provide a clue, or am I missing the point?
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: Screenshots

Post by gsagostinho »

@Cody Thanks but unfortunately I don't think that helps either. You are simply multiplying the opacity value by a constant as to get more transparency, but the point is that the effect is working so that's why you can scale it with that multiplication. The issue with the ring's shader is that no matter what I use as the 4th input to of gl_FragColor, e.g. gl_FragColor = vec4(r,g,b,0.2);, I always get full opacity, as if the last component was a 1.0.
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Screenshots

Post by gsagostinho »

Managed to apply ambient light to the rings:

Image

Image

Image
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: Screenshots

Post by phkb »

gsagostinho wrote:
Managed to apply ambient light to the rings:
Awesome! Is this an easy-to-apply tweak?
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Screenshots

Post by gsagostinho »

phkb wrote: Mon Jul 17, 2017 4:36 am
gsagostinho wrote:
Managed to apply ambient light to the rings:
Awesome! Is this an easy-to-apply tweak?
It actually is. The last statement in systemfeatures-rings.fragment is

Code: Select all

                    gl_FragColor = vec4(r,g,b,1.0);
Simply replace it with:

Code: Select all

                    vec3 diffuseColor = gl_LightSource[1].diffuse.rgb; // Diffuse light

                    vec3 totalColor = vec3(0);
                    totalColor += vec3(r,g,b) * diffuseColor;

                    gl_FragColor = vec4(totalColor, 1.0);
That said, I do plan to release these modifications if cim finds them interesting. I am just waiting for his answer, as well as trying to figure out the ring transparency and draw distance issues.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Screenshots

Post by spara »

I don't think you can do much about the drawing distance. To my understanding it's a built-in limitation.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Screenshots

Post by Norby »

gsagostinho wrote: Mon Jul 17, 2017 12:21 pm
ring transparency and draw distance issues.
Just an idea against the sudden appearance when you enter into the distance limit: start at full transparency and reduce slowly to the final opacity when you come closer.
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Screenshots

Post by gsagostinho »

spara wrote:
I don't think you can do much about the drawing distance. To my understanding it's a built-in limitation.
Yes, I am also afraid that will be the case. But that said, I have the impression that certain objects are visible much further away. I have to test this, but I have the impression that those solar stations from WildShips can be spotted much further away than that (even with the Distant Suns OXP, you can see their silhouette against the sun). But perhaps I am wrong and the stations aren't that far away. If that's the case, then nothing to be done.
Norby wrote:
gsagostinho wrote: Mon Jul 17, 2017 12:21 pm
ring transparency and draw distance issues.
Just an idea against the sudden appearance when you enter into the distance limit: start at full transparency and reduce slowly to the final opacity when you come closer.
Yes, that's a great idea. If I manage to find a solution for this transparency issue then this could be a possible solution :)
User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

Re: Screenshots

Post by Tichy »

Wow this is a great improvement over the older rings! :o
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: Screenshots

Post by Commander_X »

gsagostinho wrote:
Yes, that's a great idea. If I manage to find a solution for this transparency issue then this could be a possible solution :)
I guess one of the issues you're facing in not being able to use the alpha component of the colour is that the material for rings doesn't consider alpha.
I am not sure how/where is the rings material spawned from, although I've been trying to tweak the rings a while ago (with an attempt to get rid of these Moire patterns) -- I left that at an "in-work" status :roll: .
Post Reply