Proposal for the extension of PostEffect class to allow custom GLSL shaders

Hi. This is a proposal for a change to the PostEffect class.

Currently, it is impossible to create some custom effects in post processing that would prove beneficial to certain environments and atmospheres some games wish to offer. When ROBLOX first proposed the Post Processing it was clear that they had many more options to pick from, but now we only have four base options.

The change I wish to see is not for roblox to add more stock effects, but instead add new API to allow developers to write their own GLSL shaders. These shaders would function on the post-render level (aka treating the screen like an image texture). They would function like real GLSL shaders in that the vec4 effect function is called on every pixel (Note: While this may sound performance degrading, all post-processing effects use this method and do not lag as one may think.).

This would allow developers to do just about anything in the aspect of post processing.

What are some limitations?

  • The GLSL shader would have to be compiled pre-runtime similar to collision models due to where it runs.
  • Developers may need to write multiple shaders almost like a level-of-detail system so that older machines may work, and this is not something that is generally put into our control.
    • This could also prove beneficial since it may permit us to use effects on low quality settings that are currently unavailable.
  • Newer developers may not be familiar with GLSL or may expect it to be written in a more lua-like fashion rather than its native C form. This also extends to the fact that running it in Lua would absolutely not be a viable solution.
  • How would UI drawing be handled? Would it require adding an extra step in? (Draw 3D → Custom Post-Effects → Draw UI)

What’s everybody’s opinion on something like this? Anything to add or change? Thanks.

16 Likes

I can’t find the thread where it was mentioned, but this was suggested on one of the postprocessing threads and a ROBLOX engineer replied that they did not want to add custom shaders due to the limitations you mentioned.

2 Likes

Alright. Let me go see if I can find that thread.

Edit: I found it here → Post-processing effects - #33 by zeuxcg

@Lilly_S Could you lock/hide/delete this thread since it was already covered elsewhere?

1 Like

I believe the official term is ‘Lilly please lock this’ :slight_smile:

However, if later down ROBLOX decide to go down a more developer-modifiable client route, this would be excellent. :+1:

3 Likes