Oolite Bulletins

For information and discussion about Oolite.
It is currently Tue Nov 21, 2017 4:43 am

All times are UTC




Post new topic  Reply to topic  [ 5167 posts ]  Go to page Previous 1332 333 334 335 336345 Next
Author Message
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 4:53 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
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?


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 6:28 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2424
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
semi-transparent objects in Oolite
There is a way using shaders as in Flying Dutchman OXP:
Image

_________________
OXPs by Norby


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 6:38 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5015
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.


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 7:30 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Thanks guys, I will check it out and see if I manage to solve the issues.


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 7:54 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
@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.


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 8:02 pm 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
I have an extra line in the atmosphere shader - newOpacity *= 0.6; and adjust the 0.6 to my taste, inserted thus:
Code:
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?

_________________
The only good fnord is a dead fnord!


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 8:20 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
@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.


Top
   
 Post subject: Re: Screenshots
PostPosted: Sun Jul 16, 2017 10:33 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Managed to apply ambient light to the rings:

Image

Image

Image


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 4:36 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1804
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
Managed to apply ambient light to the rings:
Awesome! Is this an easy-to-apply tweak?

_________________
My OXP's


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 12:21 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Quote:
Quote:
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:
                    gl_FragColor = vec4(r,g,b,1.0);
Simply replace it with:
Code:
                    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.


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 12:41 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2469
Location: Finland
I don't think you can do much about the drawing distance. To my understanding it's a built-in limitation.


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 12:53 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2424
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
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.

_________________
OXPs by Norby


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 1:01 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Quote:
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.
Quote:
Quote:
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 :)


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 5:30 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 342
Wow this is a great improvement over the older rings! :o


Top
   
 Post subject: Re: Screenshots
PostPosted: Mon Jul 17, 2017 6:55 pm 
Offline
Deadly
Deadly

Joined: Sat Aug 09, 2014 4:16 pm
Posts: 169
Quote:
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: .


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5167 posts ]  Go to page Previous 1332 333 334 335 336345 Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited