Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Render to Framebuffer

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Render to Framebuffer

Post by Griff »

Ha that's awesome! :D Just needs "Incoming missile" written in the style of those silent movie caption cards and we could claim Oolite came out before the BBC micro original
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1388
Joined: Thu Aug 27, 2015 4:24 pm

Re: Render to Framebuffer

Post by cbr »

another_commander wrote: Mon Aug 08, 2022 9:24 am
OK, now I am just fooling around with it, but this is awesome! It's crazy what this post-processing stuff can generate. Here is Oolite in old style silent film format:
Is there also an underwater mode? :)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

Not ready to call this a feature yet - it is still a bit buggy and very intense, affects the gui too and reminds me of the first 3D Prince of Persia game which was completely flooded by it. I think it may require bringing our shaders up to modern glsl grammar standards to get it fully under control, but hey, it's a start. It's blooming!

Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

cbr wrote: Tue Aug 09, 2022 10:59 am
Is there also an underwater mode? :)
Yessir!

Image
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16071
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Render to Framebuffer

Post by Cody »

Voyage to the Bottom of the Sea [ping] starring Richard Basehart [ping]
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
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1388
Joined: Thu Aug 27, 2015 4:24 pm

Re: Render to Framebuffer

Post by cbr »

another_commander wrote: Tue Aug 09, 2022 4:31 pm
Image
wow...

That would make (for) an interesting planet...

Are the effects only applicable to the entire view screen or also on individual objects?

:shock:
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

Entire screen.
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: Render to Framebuffer

Post by Slartibartfast »

Hello

I don't think this is "water"

probably "spacetime distortions" :wink:

cheers
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

Milestone achieved ladies and gents. Bloom is in!

I finally managed to get it to apply gently and subtly in the scene and is noticeable only when it is needed. It still affects the HUD (slightly), but that's something to worry about later. In the animations below you can see it in action. The video start with a pan of the camera to the left, where everything is set like up till now. Then the camera stops, bloom is activated and it pans back to the right. Notice the difference in specular reflections this time round?

Image

Image

For those who want to test it, I have uploaded a test package here. It contains:
- The changed source files.
- The latest version of the shaders reauired to run it.
- A patch file done against the latest trunk.
- Updated keyconfig2.plsit which contains the setting for the F9 key.
- A Windows test executable. You can use F9 to toggle bloom on and off. Note that, due to the complexity of calculations involved, bloom is an expensive operation. On one of my test systems, CPU usage goes from 50 to 88 percent when I activate it, but thankfully without change in fps or in GPU temperature. On the other, which is low-end, I see around 40% fps drop at the Extras detail level when I activate it.

And a few screenies showing a random scene without and with bloom. Notice the intensified glow at the parts of the ship reflecting light the most.

Image
Image


Image
Image


Image
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

An improved version of the bloom implementation has been uploaded here for anyone interested. It contains today's revisions of the files that were uploaded yesterday and, of course, a new Windows exe for those who would like to see it.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

I have uploaded a new test executable and shaders here for those who have already downloaded the previous message's package and are willing to follow the development of the feature as it moves ahead. Unzip the files to their corresponding locations, overwriting the previous ones.

In this episode:
  • The cloaking device has now been assigned a post processing effect all of its own. The effect is based on the night vision one, but renders in blue instead of green (remember, the codename of the cloaking device is "Blue Alert"). To test, just go out in space and activate / de-activate it normally.
  • Activation of post processing effects is now possible from scripts. In this first iteration, you can use the read/write JSGlobal object postFX to query and set the currently active effect. When setting an effect, you must assign postFX an integer value corresponding to the desired effect. Cuurently there are 5 available:
    1. Cloak vision
    2. Colorblindness correction (Protanopia)
    3. Colorblindness correction (Deuteranopia)
    4. Colorblindness correction (Tritanopia)
    5. Grayscale
    To set grayscale, for example, use postFX = 5. For cloak vision use 1 etc. Executing postFX = 0 will reset to normal rendering sans fx. Values out of range will reset to no fx too.
  • The default bloom has been raised just a tad.
  • Fixed a bug that would cause screen corruption when setting detail level below "Shaders Enabled".
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

We are almost ready to make this official. Pull request is up on github: https://github.com/OoliteProject/oolite/pull/407

Before the final merge, please test and ensure that the code in the above PR works and runs OK for you. This is basically for Lunux (and maybe Mac? anyone?) users, as testing on Windows seems to have produced no blockers. We'll let quite a few days for testing and if there are issues we'll hold the merge until resolved.

I should also note that, as far as Windows is concerned, the feature will be implemented only for 64-bit versions of the OS. I think it is time we retire the (obsolete, really) 32-bit version, which is not scheduled to receive any new features from now on, unless someone interested in maintaining it steps in.

I once again want to express my sincere thanks to both Mauiby de Fug, who made the first attempt at this and kept the flame burning, and tsoj, who bit the bullet and actually made the darn thing work. Evrything I added after that was just fluff, really :-). So, thank you guys, this is something I wanted to see for a long, long time!
User avatar
Cholmondely
Archivist
Archivist
Posts: 5068
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Render to Framebuffer

Post by Cholmondely »

another_commander wrote: Fri Aug 19, 2022 3:49 pm
We are almost ready to make this official. Pull request is up on github: https://github.com/OoliteProject/oolite/pull/407

Before the final merge, please test and ensure that the code in the above PR works and runs OK for you. This is basically for Lunux (and maybe Mac? anyone?) users, as testing on Windows seems to have produced no blockers. We'll let quite a few days for testing and if there are issues we'll hold the merge until resolved.

I should also note that, as far as Windows is concerned, the feature will be implemented only for 64-bit versions of the OS. I think it is time we retire the (obsolete, really) 32-bit version, which is not scheduled to receive any new features from now on, unless someone interested in maintaining it steps in.

I once again want to express my sincere thanks to both Mauiby de Fug, who made the first attempt at this and kept the flame burning, and tsoj, who bit the bullet and actually made the darn thing work. Evrything I added after that was just fluff, really :-). So, thank you guys, this is something I wanted to see for a long, long time!
I'd love to try it out. But how? I can't compile for toffee - I need an Apple version which I can just download...
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?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Render to Framebuffer

Post by another_commander »

Cholmondely wrote: Fri Aug 19, 2022 3:51 pm
I'd love to try it out. But how? I can't compile for toffee - I need an Apple version which I can just download...
Yeah, believe me I know... but that's exactly the problem...
User avatar
Cholmondely
Archivist
Archivist
Posts: 5068
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Render to Framebuffer

Post by Cholmondely »

another_commander wrote: Fri Aug 19, 2022 3:52 pm
Cholmondely wrote: Fri Aug 19, 2022 3:51 pm
I'd love to try it out. But how? I can't compile for toffee - I need an Apple version which I can just download...
Yeah, believe me I know... but that's exactly the problem...
Is there any way in which I could take over Getafix's transmogrification duties? What would I need? And how much would I need to know?
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?
Post Reply