Re: Shaders’ Outpost
Posted: Mon Sep 10, 2018 8:09 pm
@another_commander thank you so much!
For information and discussion about Oolite.
https://bb.oolite.space/
Hi, I'm new here, and I am reviving a topic that's more than a year old, but perhaps it will be interesting anyway. I have spent some time working on rings in my own open source space game, and I can describe what I did for that. Perhaps some of it will be useful in Oolite as well. I was largely inspired by this amazing video: https://www.youtube.com/watch?v=UgxWkOXcdZU which is supposedly made from photographs of Saturn taken by the Cassini probe, which is to say, it's not CGI.gsagostinho wrote: ↑Tue Jul 18, 2017 12:26 pmAs some of you know, I have been working on an update for the System Features Rings OXP and there were some discussion about it in the Screenshots thread starting with this post. Because the discussion was out of topic over there (sorry again!), I thought of continuing it here. I currently have three issues that I would like to solve/improve and I would greatly appreciate some advice:
- drawing distance seems to be set at 2.7 OU, at which points the rings pop out of existance. Apparently this would have to be modified in the core code of the game.
- applying opacity < 1.0 to rings: no matter what value I use as the last argument of gl_FragColor. Some people told me that I can't have transparency in Oolite. Others told me to look at the atmosphere fragment shader, but I can't understand why the transparency works there and not with the rings shader. I have also read online that one must enable blending in order to work with opacity, but I am an utter complete GLSL noob and I don't know what that means nor how to accomplish it.
- a minor thing, but would someone here perhaps know how to improve the Moire patterns that the rings display?
Code: Select all
vec4 x = max(vec4(0.0), totalColor - 0.004);
totalColor = (x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06);
It's based on a quote from Ahruman back in 2006/7, with bits added.Terminology
A normal texture specifies a single property of the model’s material at each point – specifically, its diffuse colour, or albedo. Specular maps, glow maps (eg for the engine exhaust glows) and other effect maps are auxiliary textures specifying additional material properties. Extra detail can be added into the alpha layer/channel (eg for the city night lights for planets in Oolite v.1.90: the illumination map should get embedded in the alpha channel of the planet's diffuse map).
See Shaders in Oolite for explanations of vertex shaders, fragment shaders and uniforms.
the 'normal texture' mentioned in the quote is just a 'normal texture' in the sense that back in the day 'normally' oolite would just read in the one texture map (an image file in png format) which it wrapped around the polygon geometry of the game model to give it some surface colour and detail, eg the texture looked like metal plates for the ship hull or dusty rocks for the asteroid modelTerminology
A normal texture specifies a single property of the model’s material at each point – specifically, its diffuse colour, or albedo.
Agreed, the main confusion for the "normal texture" definition above comes from the existence of a "normal map" texture (which is a very specific type of texture, which is used in Oolite as well). I'd guess the best short description for the above definition would be either "normal (i.e. regular) texture" or "normal/regular texture" (in order to keep the previous wording as is).Griff wrote: ↑Mon Jan 02, 2023 4:57 pm[...]the 'normal texture' mentioned in the quote is just a normal texture in the sense that back in the day 'normally' oolite would just read in the one texture map (an image file in png format) which it wrapped around the polygon geometry of the game model to give it some surface colour and detail, eg the texture looked like metal plates for the ship hull or dusty rocks for the asteroid modelTerminology
A normal texture specifies a single property of the model’s material at each point – specifically, its diffuse colour, or albedo.
[...]
Ooh, yeah, that's the sort of thing I'm after...
I was thinking (quite possibly naively) of distance as a percentage of scanner range = percentage opacity of effect, where there is a cap of 100%.