You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a stylized 3D JRPG game. This game will make use of post-process to achieve effects such as outline.
Describe the problem or limitation you are having in your project
I need to access normal (and other arbitrary data) to find edge between overlapping objects (ocean and land).
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It will be extremely helpful if shaders can write to arbitrary buffers that post-process shaders can access. For example, I can create an int buffer that stores object IDs. Post-process can easily identify which pixel belongs to which object and we can easily outline around some, but not others. We can also darken some, but not others. The possibilities are endless. A very popular way of creating outline is the convex hull method which essentially draws the object twice (doesn't scale up well). But at the memory cost of buffers, we can achieve not only a nicer and more controlled effect, but also (I believe) at lower GPU cost. I am actually getting a nice outline around some parts of my geo using depth. But depth doesn't work for all of my needs. I will need to access normal or ideally arbitrary buffers.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If I wanted to export surface normal and access in post-process, I would do this...
shader code allows export(vec3, "normal", NORMAL); in fragment()
post-process fragment() allows vec3 normal = import(vec3, "normal", SCREEN_UV);
If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I understand, access to normal and arbitrary buffers is not possible.
Is there a reason why this should be core and not an add-on in the asset library?
I am not sure if add-ons can offer this functionality in shader/post-process.
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
arbitrary buffers that are accessible in post-process
Add arbitrary buffers that are accessible in post-processing shaders
Apr 30, 2021
Describe the project you are working on
I am working on a stylized 3D JRPG game. This game will make use of post-process to achieve effects such as outline.
Describe the problem or limitation you are having in your project
I need to access normal (and other arbitrary data) to find edge between overlapping objects (ocean and land).
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It will be extremely helpful if shaders can write to arbitrary buffers that post-process shaders can access. For example, I can create an int buffer that stores object IDs. Post-process can easily identify which pixel belongs to which object and we can easily outline around some, but not others. We can also darken some, but not others. The possibilities are endless. A very popular way of creating outline is the convex hull method which essentially draws the object twice (doesn't scale up well). But at the memory cost of buffers, we can achieve not only a nicer and more controlled effect, but also (I believe) at lower GPU cost. I am actually getting a nice outline around some parts of my geo using depth. But depth doesn't work for all of my needs. I will need to access normal or ideally arbitrary buffers.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If I wanted to export surface normal and access in post-process, I would do this...
shader code allows export(vec3, "normal", NORMAL); in fragment()
post-process fragment() allows vec3 normal = import(vec3, "normal", SCREEN_UV);
If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I understand, access to normal and arbitrary buffers is not possible.
Is there a reason why this should be core and not an add-on in the asset library?
I am not sure if add-ons can offer this functionality in shader/post-process.
The text was updated successfully, but these errors were encountered: