Redspear - any chance of your repeating what you just wrote in language that this dumb pilot has a chance of understanding?
Shaders’ Outpost
Moderators: winston, another_commander
- Cholmondely
- Archivist
- Posts: 5251
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Shaders’ Outpost
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Shaders’ Outpost
I think maybe a version of a 'fog' shader might do the trick but insteading of mixing in the 'sky colour' we'd mix in our glowmap texture
I did have a go trying to cobble together a simple oxp & shader to do this last night but i just couldn't get it working, the shader compiled OK but the glow effect was always being mixed in 100% no matter how close i got the camera to the test object so i clearly had something wrong in the distance calculating bit, i tried this guys method:
OpenGL 3D Game Tutorial 16: Fog
https://www.youtube.com/watch?v=qslBNLeSPUc
but then i found this example a bit later on just as i wa giving up
https://vicrucann.github.io/tutorials/osg-shader-fog/
might try and adapt that, it talks about needing the camera position and passing it as an uniform to the shader, i think we might be able to get away with just using the camera position as vec3(0.0, 0.0, 0.0) as i think the player camera view is fixed at that point as it's the rest of the universe that moves around them in game?
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
- Redspear
- ---- E L I T E ----
- Posts: 2658
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Shaders’ Outpost
A ship model isn't fully dressed without a texture and such forms of attire often constitute multiple parts, some more conventional (the pants if you like) and others more optional (a hat for example).Cholmondely wrote: ↑Mon May 15, 2023 9:51 pmRedspear - any chance of your repeating what you just wrote in language that this dumb pilot has a chance of understanding?
A glowmap is like adorning a texture with lights. In the absence of shaders (mobile lighting, makeup and camera crew) they are just on, always on and with no dimmer switch, as in my screenshot example (the glowmap is the layer of the texture that is illuminating the wireframe).
What I've been wittering on about lately is how such a feature might be aligned to a shader, so that it is made much more obvious in some situations (e.g. far from player ship) and much less so in others (close to player ship). How to adequately express this desire to the photography team (shaders) is very much the question.
Yes, or at least that's my understanding.
Thanks so much for looking into this!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Shaders’ Outpost
Distance dependant glow texture effect:
Ha, well I've made a bit of progress, except the effect is working in reverse at the moment
, it fades IN the closer the player gets to the object, and the effect in/out range needs scaling out a lot more as at the moment the effect only kicks in when the player is eally close to the object
Work in progress OXP here:
https://drive.google.com/file/d/1SZUCS2 ... share_link
With the OXP installed - when you launch from a station it will spawn 4 sidewinders (with dumbAI) around the immediate area, fly up to one to see the effect, and i mean you have to get quite close, plus i've only tested using the regular forward view i'm just assuming in the shader that the player camera position is always 0,0,0 - not sure if external views will change that?
edit: smoothstep fixed the problem with the effect working in reverse, had to experiment with the smoothstep upper and lower range values, 1.0-0.0 nmeant the effect wouldn;t fade out near the player, 0.5-0.0 and it fades out just as the playeris alongside it, decided to go with 0.4-0.0 so it fades out a few meters before the player,lower the 0.4 to fade it out earlier (line 162 in fragment shader)
edit:
Arg, I've just realised i'm REPLACING the ship colour texture with the glow grid as you get closer, to be more in line with Redspears concept where the glow lines are overlayed on top of the texture, edit the fragment shader and swap out this vec4 FinalColwithGlow... bit
// get a vec4 to store our final colour and mix in glow effect
vec4 FinalColwithGlow = mix(totalColor, GlowGrid, visibility);
for this:
// get a vec4 to store our final colour and mix in glow effect
vec4 FinalColwithGlow = totalColor + mix(vec4(0), GlowGrid, visibility);
Ha, well I've made a bit of progress, except the effect is working in reverse at the moment
![Laughing :lol:](./images/smilies/icon_lol.gif)
Work in progress OXP here:
https://drive.google.com/file/d/1SZUCS2 ... share_link
With the OXP installed - when you launch from a station it will spawn 4 sidewinders (with dumbAI) around the immediate area, fly up to one to see the effect, and i mean you have to get quite close, plus i've only tested using the regular forward view i'm just assuming in the shader that the player camera position is always 0,0,0 - not sure if external views will change that?
edit: smoothstep fixed the problem with the effect working in reverse, had to experiment with the smoothstep upper and lower range values, 1.0-0.0 nmeant the effect wouldn;t fade out near the player, 0.5-0.0 and it fades out just as the playeris alongside it, decided to go with 0.4-0.0 so it fades out a few meters before the player,lower the 0.4 to fade it out earlier (line 162 in fragment shader)
Arg, I've just realised i'm REPLACING the ship colour texture with the glow grid as you get closer, to be more in line with Redspears concept where the glow lines are overlayed on top of the texture, edit the fragment shader and swap out this vec4 FinalColwithGlow... bit
// get a vec4 to store our final colour and mix in glow effect
vec4 FinalColwithGlow = mix(totalColor, GlowGrid, visibility);
for this:
// get a vec4 to store our final colour and mix in glow effect
vec4 FinalColwithGlow = totalColor + mix(vec4(0), GlowGrid, visibility);
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
- Redspear
- ---- E L I T E ----
- Posts: 2658
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Shaders’ Outpost
Griff, thanks so much
![Very Happy :D](./images/smilies/icon_biggrin.gif)
The following has to be said I believe:
I don't own it so I can't upload it but...
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Shaders’ Outpost
I've made a small change to the shaders in the posglow test OXP, I borrowed some of the code from Oolite's planet shader and used it to just limit the glowing wireframe to the unlit sides of the object - the previous shaders that didn't do this are also in the download if we don't like the effect ew can always go back, it might have been the orange of the texture and the green of the glow effect but it was putting a weird looking yellow grid on the ship when it was in bright sunlight and close enough to the camera for the effect to start fading but not close enough for it not to be drawn, I wanted to see if i could get rid of that
@Redspear, is there a link to this cobraIII and the wireframe texture it has on it? - like in your screenshot...
![Image](https://i.postimg.cc/3x3Wp8TS/oolite-419.png)
.. would be nice to try the shader on a proper ship now instead of the test sidewinder, see if we can get it to look like this![Very Happy :D](./images/smilies/icon_biggrin.gif)
@Redspear, is there a link to this cobraIII and the wireframe texture it has on it? - like in your screenshot...
![Image](https://i.postimg.cc/3x3Wp8TS/oolite-419.png)
.. would be nice to try the shader on a proper ship now instead of the test sidewinder, see if we can get it to look like this
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
Re: Shaders’ Outpost
![Image](https://i.postimg.cc/jj17hdNd/oolite-107.png)
Perhaps You are already there
![Wink ;)](./images/smilies/icon_wink.gif)
Here I replaced the grid with a 'line-art' conversion of the 512p diffusemap.
( extra experiment I partially removed the color in the diffusemap to view its influence on the shader at distance )
The downside will be finding shader magic to perform the line art conversion...
![Cool 8)](./images/smilies/icon_cool.gif)
- Redspear
- ---- E L I T E ----
- Posts: 2658
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Shaders’ Outpost
Sort of...
It's from Simon B's
![[EliteWiki]](/images/elitewikismall.png)
I've included (and removed the partial transparency from) the tweaked glowmap for the cobra 3 below:
![Image](https://i.postimg.cc/2645yqzy/cobra3-r2-glows-intense.png)
Given the new strategy of fading at close range, it should probably have thicker wireframe lines but then it was a proof of concept with largely hand/mouse drawn lines.
As I tried to say before but failed...
You, Sir...
Thanks so much for your help with this Griff
![Very Happy :D](./images/smilies/icon_biggrin.gif)
The irrepressible cbr!
![Cool 8)](./images/smilies/icon_cool.gif)
Re: Shaders’ Outpost
![Image](https://i.postimg.cc/hPQtKzK1/oolite-112.png)
A thicker glow_frame with a subdued hexagon pattern, adjusted color(?) in shader to white...
- Redspear
- ---- E L I T E ----
- Posts: 2658
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Shaders’ Outpost
Nice. Those lines look about right in terms of thickness.
Are the hexagons there to make it more obvious that it is meant to be imposed by your ship's computer rather than actually present on the ship's surface?
Different colours have always been part of my plan
![Cool 8)](./images/smilies/icon_cool.gif)
Not tried it yet but think it's a great idea
![Very Happy :D](./images/smilies/icon_biggrin.gif)
I tried to achieve this previously and this is why the original wireframe was partially transparent - to make it less obvious when the ship was lit. That was always a compromise however (when lit less was more, when unlit more was more), so I removed the transparency from the glowmap that I posted above to better work with your superior method.
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Shaders’ Outpost
I was just looking at the latest posts and it got me wondering what if we built the actual wireframe out of real glowing polygons around the object? a couple of polys for each 'wireframe edge' scaled up from the ship model a small amount so it draws over the ship hull underneath? would be pretty light in terms of poly count if we base it on the original 8 bit elite ship geometry?
Wireframes could be subentities with their own shader to do the effect so just a model.dat for each ship wireframe model and a subentity for it added to the parent shipentry in shipdata.plist? Might be possible to add this as a shipdata-overrides.plist in a seperate oxp?
Pros: less textures used, wireframe drawn much higher res on screen
Cons: more polygons, won't be able to fade out the wireframe based on distance, instead it will have to either be 'on' or 'off' depending on how close the object is to the camera but we could maybe gradually dim the wireframe glow towards black dependant on distance before switching it off totally to make the change less jarring?
Or we could have a combination of stuff, wireframe as a seperate model and the texture effect like cbr's hexagons as well?
Wireframes could be subentities with their own shader to do the effect so just a model.dat for each ship wireframe model and a subentity for it added to the parent shipentry in shipdata.plist? Might be possible to add this as a shipdata-overrides.plist in a seperate oxp?
Pros: less textures used, wireframe drawn much higher res on screen
Cons: more polygons, won't be able to fade out the wireframe based on distance, instead it will have to either be 'on' or 'off' depending on how close the object is to the camera but we could maybe gradually dim the wireframe glow towards black dependant on distance before switching it off totally to make the change less jarring?
Or we could have a combination of stuff, wireframe as a seperate model and the texture effect like cbr's hexagons as well?
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
Re: Shaders’ Outpost
![Image](https://i.postimg.cc/BvZh5t51/oolite-119.gif)
If we are thinking out of the box, if it were possible to access the wireframe mode from oolite at the same time?
Then we could have this ( simulated ) effect.. Pros ( it's calculated ) Cons ( A_C says no )
![Wink :wink:](./images/smilies/icon_wink.gif)
![Cool 8)](./images/smilies/icon_cool.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Btw the shader seems to work in wireframe mode too
![Laughing :lol:](./images/smilies/icon_lol.gif)
- Redspear
- ---- E L I T E ----
- Posts: 2658
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Shaders’ Outpost
![Shocked :shock:](./images/smilies/icon_eek.gif)
It might be easier to find the best 'solution' if the 'problem' is made explicit (at least for me).
Check out thie 'In shadow' images of the python docking.
Can't see a damn thing, even when ambient light is ramped up. Both a waste of a good ship model/texture and makes combat/gameplay trickier/less satisfying.
My idea of having the wireframe fade with distance was mainly because I didn't know how to have it merely illuminate on the unlit areas;
thus the cobra image upthread experimentng with transparency. In that image the wireframe is more obvious on the unlit parts - I did try increasing transparency further but with limited gains.
Sounds greatGriff wrote: ↑Sat May 20, 2023 6:39 pmI was just looking at the latest posts and it got me wondering what if we built the actual wireframe out of real glowing polygons around the object? a couple of polys for each 'wireframe edge' scaled up from the ship model a small amount so it draws over the ship hull underneath? would be pretty light in terms of poly count if we base it on the original 8 bit elite ship geometry?
Wireframes could be subentities with their own shader to do the effect so just a model.dat for each ship wireframe model and a subentity for it added to the parent shipentry in shipdata.plist? Might be possible to add this as a shipdata-overrides.plist in a seperate oxp?
![Very Happy :D](./images/smilies/icon_biggrin.gif)
I remember being quite disappointed when I first tried wireframe mode in oolite because it showed every line including the ones that elite didn't.
If on/off could corresponded to lit/unlit then that could be awesome, and the fact that there was no fading needn't be a problemGriff wrote: ↑Sat May 20, 2023 6:39 pmCons: more polygons, won't be able to fade out the wireframe based on distance, instead it will have to either be 'on' or 'off' depending on how close the object is to the camera but we could maybe gradually dim the wireframe glow towards black dependant on distance before switching it off totally to make the change less jarring?
![Very Happy :D](./images/smilies/icon_biggrin.gif)
cbr's hexagon idea is definitely growing on me. Shows how well designed it was that I instinctively guessed the intention behind it.
If we can achieve the 'unlit surface/area = wireframe on' look, then the hexagons might help at close range to remind the player that it is a solid object. Subtle enough to be a reminder rather than overwhelming.
With regards colours, it would probably be better to make freighters blue (lighter for visibilty but not enough to mistake for cyan) and stations red.
- Then (using the RGB model)
- All non alien ships would contain an element of blue (blue, cyan, magenta)
All system hazards/features would contain some red (red, magenta, yellow)
Leaving green for the thargoids
And white for debris/unknown
- All non alien ships would contain an element of blue (blue, cyan, magenta)
- Griff
- Oolite 2 Art Director
- Posts: 2479
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Shaders’ Outpost
doing the wireframe with some extra polygon geometry turned out to look rubbish
I've uploaded it into the WIP .zip as a second OXP since it works so might as well, but it doesn't look great
I've modified the texture based method so the glow colour is now in the shipdata.plist, edit the values there to change the glow colour, plus
I found a guide online on how to bake out a wireframe texure map based on the boundaries of the UV islands in the model, so i've switched that generic grid texture i was using for this new texture map which follows redspears concept a lot closer
![Sad :(](./images/smilies/icon_sad.gif)
I've modified the texture based method so the glow colour is now in the shipdata.plist, edit the values there to change the glow colour, plus
I found a guide online on how to bake out a wireframe texure map based on the boundaries of the UV islands in the model, so i've switched that generic grid texture i was using for this new texture map which follows redspears concept a lot closer
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries