Modding, Mission Design, and Coding > FS2 Open Coding - The Source Code Project (SCP)

Adjusting bloom and blur in-mission

(1/3) > >>

Nightmare:
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?

Nightmare:
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.

m!m:
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.

Nightmare:
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.

m!m:

--- Quote from: Nightmare on September 23, 2018, 11:07:13 pm ---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.

--- End quote ---
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.


--- Quote from: Nightmare on September 23, 2018, 11:07:13 pm ----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.

--- End quote ---
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.


--- Quote from: Nightmare on September 23, 2018, 11:07:13 pm ---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).

--- End quote ---
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.


--- Quote from: Nightmare on September 23, 2018, 11:07:13 pm ---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.

--- End quote ---
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.

Navigation

[0] Message Index

[#] Next page

Go to full version