A 3D ARPG relying on a pixel-art style with the help of custom post-processing and materials.
Describe the problem or limitation you are having in your project
I'm currently trying to implement a good way to have full edge detection without using an inverted hull method. For that purpose, I need the depth at and around the current fragment (already doable with DEPTH_TEXTURE) and the normals at and around the current fragment.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Ideally, having the normals directly accessible would save either performance or an unneeded first pass on 3D materials, and would be more accurate than reconstruction in a post-processing context.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The user would be able to sample NORMAL_TEXTURE the same way as SCREEN_TEXTURE and DEPTH_TEXTURE in fragment shaders.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I have currently found two workarounds, both with their limitations:
reconstructing the normals from depth in a quadmesh post-processing shader - which is slow, not necessarily accurate and unable to discern smooth edges from sharp ones
using NORMAL as ALBEDO in a material's first pass, and reading SCREEN_TEXTURE in the next one - which is cumbersome and finicky (since it deals with reading SCREEN_TEXTURE in a multiple passes material)
Is there a reason why this should be core and not an add-on in the asset library?
Mainly because it feels in line with the way existing input sampler2Ds are handled in Godot, and normals are a pretty important (in my eye) information to have.
Describe the project you are working on
A 3D ARPG relying on a pixel-art style with the help of custom post-processing and materials.
Describe the problem or limitation you are having in your project
I'm currently trying to implement a good way to have full edge detection without using an inverted hull method. For that purpose, I need the depth at and around the current fragment (already doable with
DEPTH_TEXTURE
) and the normals at and around the current fragment.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Ideally, having the normals directly accessible would save either performance or an unneeded first pass on 3D materials, and would be more accurate than reconstruction in a post-processing context.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The user would be able to sample
NORMAL_TEXTURE
the same way asSCREEN_TEXTURE
andDEPTH_TEXTURE
in fragment shaders.If this enhancement will not be used often, can it be worked around with a few lines of script?
I have currently found two workarounds, both with their limitations:
NORMAL
asALBEDO
in a material's first pass, and readingSCREEN_TEXTURE
in the next one - which is cumbersome and finicky (since it deals with readingSCREEN_TEXTURE
in a multiple passes material)Is there a reason why this should be core and not an add-on in the asset library?
Mainly because it feels in line with the way existing input sampler2Ds are handled in Godot, and normals are a pretty important (in my eye) information to have.