Author Topic: Adjusting bloom and blur in-mission  (Read 3405 times)

0 Members and 1 Guest are viewing this topic.

Adjusting bloom and blur in-mission
So I've been talking with Goober about the possibilty to adjust the bloom and blur values in-mission; either via set-post-effect SEXP or a scripted equivalent. However, I was told that this requires custom shaders; and hence somebody with the skill (and time) to write them, as of currently the can only be configured via the command line settings.

While that kind of effect is not essential, I think it would be a good gimmick for Scroll and probably other mods; but I have no clue about coding related things... anybody willing to help out?

 
Re: Adjusting bloom and blur in-mission
Hmmm... If nobody wants to work on this right now, could somebody at least tell me who wrote the in-game shaders for the current FSO builts? In particular I'd like to know who did those used for the cloak/uncloak effect.

 

Offline m!m

  • 211
Re: Adjusting bloom and blur in-mission
What exactly do you want to achieve? I could give you some pointers towards the correct parts of the code base if I know what you want to do.

 
Re: Adjusting bloom and blur in-mission
We (on behalf of Scroll) wanted to have some advanced effects that could be accessed either via SEXP or scripting.

The envisioned features are as following:
-Adjusting further Post processing values in-mission than currently possible, in particular the bloom and blur values; at best fluently. Currently this can only be done by closing the game and modifying the config files, what is pretty much the opposite.
-Adjusting the rendering of maps in-mission. This is something similar to what you can do in the F3 techroom where you can adjust the rendering of the available maps such as base map, glow map etc. This could be used for 2 effects:
1. For a cutscene effect it would be cool if models could be semi-transparent at first and later faded out. There was such an effect in the old F3 lab before The_E... removed it (but it was only a static effect, we were thinking about something that could be adjusted dynamical). There's also such a thing with the PBR map overrides in the current F3 lab.
2. A derivate of this for the custom mission with the subspace Sathanas - it would be good to modify the rendering of specific maps, in this case the Sathanas glow maps. Currently it is possible to turn them off entirely (and on) on the entire modell, but it looks rather dull to the point it's better without using the effect. (While not discussed, I think that if something like that was made it would be good to have an option where only a specified map would be affected).

I think both 1 and 2 are related, 1 fades out/in all maps; 2 affects only the glow map. The effect would be slightly different from the current cloak/uncloak effect, however.

This function could be accessed via a single action where the ship (and optionally, the specific map) are altered over a specified time, or as a series of SEXPs where the map is given the rendering "90", "80"... etc.

I talked with Goober about that, but he said that this would require new shaders in addition to/replacing the current built-in shaders, and he doesn't know how to write such things. Therefore we require somebody from the community who volunteers to do that. I haven't any clue about coding, leave along complex things such as shaders.

 

Offline m!m

  • 211
Re: Adjusting bloom and blur in-mission
Adjusting further Post processing values in-mission than currently possible, in particular the bloom and blur values; at best fluently. Currently this can only be done by closing the game and modifying the config files, what is pretty much the opposite.
I don't know what you mean by "blur" since that is not a value that can be adjusted by a command line option. Adjusting the bloom intensity via a script should be possible by introducing a scaling factor which can be set via a scripting API function. This scaling factor could then be applied to Cmdline_bloom_intensity / 100.0f in gropenglprocessing.cpp:188. By using a scaling factor the final value would still depend on the setting the user specified.

-Adjusting the rendering of maps in-mission. This is something similar to what you can do in the F3 techroom where you can adjust the rendering of the available maps such as base map, glow map etc. This could be used for 2 effects:
1. For a cutscene effect it would be cool if models could be semi-transparent at first and later faded out. There was such an effect in the old F3 lab before The_E... removed it (but it was only a static effect, we were thinking about something that could be adjusted dynamical). There's also such a thing with the PBR map overrides in the current F3 lab.
You should be able to achieve this by adding a new ship effect and then adding a handler for it in main-f.sdr somewhere around line 418. In the effect it should be as easy as setting baseColor.a to something less than zero depending on anim_timer.

2. A derivate of this for the custom mission with the subspace Sathanas - it would be good to modify the rendering of specific maps, in this case the Sathanas glow maps. Currently it is possible to turn them off entirely (and on) on the entire modell, but it looks rather dull to the point it's better without using the effect. (While not discussed, I think that if something like that was made it would be good to have an option where only a specified map would be affected).
This is a bit more involved but still possible by introducing a few scaling factors for the various texture maps. In the shader uniform two new vec3 variables need to be added. The alignment here is a bit hard to understand so let me know when you do that and I can handle that for you. Then you simply multiply those values onto the texture colors after they have been fetched from the texture object and you should be good to go. The more involved part will be getting the values to the shader since that requires changing the two model rendering classes model_render_params and model_material and the you need to track the current scaling value in the ship class to make the effect persistent.

I think both 1 and 2 are related, 1 fades out/in all maps; 2 affects only the glow map. The effect would be slightly different from the current cloak/uncloak effect, however.
As always when dealing with graphics operations and shaders, that is not the case. The alpha channel (or opacity) is special since anything that is not completely opaque requires a special rendering path while simply changing the colors of the textures can be done in the normal deferred rendering path.

 
Re: Adjusting bloom and blur in-mission
Thanks a lot for your help! :)

I'm trying to clarify what was meant with blur (if it's the same as bloom or not).

Now we only have to find somebody who can do this...

 
Re: Adjusting bloom and blur in-mission
So here is - in Goobers words - the difference between bloom and blur:

Quote
Blur and bloom are separate effects.  Bloom is how much "glow" a ship has.  A post-processing effect to white-out the screen would gradually increase bloom until every object is so bright that they all blend together.

Blur is just like any other blurry image, or trying to view something with glasses off.  A post-processing effect to blur everything on the screen would just show everything out of focus.

So the blur effect would be a new thing that would have to be made from scratch.

 

Offline m!m

  • 211
Re: Adjusting bloom and blur in-mission
The engine already uses a blur effect on parts of the scene since that is required for actually achieving the bloom effect. That could could be reused to add the blur post-processing effect but it will require some additional code since it can't be integrated into the existing post processing shader because the blur needs to be done in two stages and the post processing shader only has one.

 
Re: Adjusting bloom and blur in-mission
Thank you for your advices m!m. :)
I really wish I could pay you for your efforts with some cool new features soon, but unless some shader-code magician appears there probably won't be becoming much of this. :(

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Adjusting bloom and blur in-mission
:bump:

How would one enable gaussian blur?  There is a blur-f.sdr file, but no corresponding gaussian_blur entry in post_processing.tbl.  I looked at the wiki page but it did not make things any clearer.

 

Offline m!m

  • 211
Re: Adjusting bloom and blur in-mission
That is because blur-f.sdr is meant to be used with the bloom effect. Making it compatible with the post processing system would actually involve a bit more work since the effect can not be included in the standard post processing effects due to how blur is typically implemented in graphics engines.