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
This commit is contained in:
@ -1153,7 +1153,8 @@ void CopyEffects::cubemap_roughness(RID p_source_rd_texture, RID p_dest_texture,
|
||||
memset(&roughness.push_constant, 0, sizeof(CubemapRoughnessPushConstant));
|
||||
|
||||
roughness.push_constant.face_id = p_face_id > 9 ? 0 : p_face_id;
|
||||
roughness.push_constant.roughness = p_roughness * p_roughness; // Shader expects roughness, not perceptual roughness, so multiply before passing in.
|
||||
// Remap to perceptual-roughness^2 to create more detail in lower mips and match the mapping of cubemap_filter.
|
||||
roughness.push_constant.roughness = p_roughness * p_roughness;
|
||||
roughness.push_constant.sample_count = p_sample_count;
|
||||
roughness.push_constant.use_direct_write = p_roughness == 0.0;
|
||||
roughness.push_constant.face_size = p_size;
|
||||
|
||||
Reference in New Issue
Block a user