summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/shaders/effects
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2022-12-02 15:39:20 -0800
committerclayjohn <claynjohn@gmail.com>2022-12-02 15:39:20 -0800
commitb2b89d7294ebb0824ce85b8bad59357caf5ec14f (patch)
tree2425bf04162163488441a0975837e0ab924229b5 /servers/rendering/renderer_rd/shaders/effects
parentcdd99e9bec16db60efd894a06826f6fea139d00d (diff)
Properly remap roughness when reading from radiance map
This ensures that we consistently use perceptual roughness which matches the behaviour of most other PBR renderers like Blender, Ue4 and Godot 3
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/effects')
-rw-r--r--servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_inc.glsl11
1 files changed, 0 insertions, 11 deletions
diff --git a/servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_inc.glsl b/servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_inc.glsl
index 1bee428a6f..c0597fe3f3 100644
--- a/servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_inc.glsl
+++ b/servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_inc.glsl
@@ -70,17 +70,6 @@ float DistributionGGX(float NdotH, float roughness4) {
return roughness4 / denom;
}
-// https://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html
-float GGX(float NdotV, float a) {
- float k = a / 2.0;
- return NdotV / (NdotV * (1.0 - k) + k);
-}
-
-// https://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html
-float G_Smith(float a, float nDotV, float nDotL) {
- return GGX(nDotL, a * a) * GGX(nDotV, a * a);
-}
-
float radicalInverse_VdC(uint bits) {
bits = (bits << 16u) | (bits >> 16u);
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);