Răsfoiți Sursa

Merge pull request #61883 from Calinou/material-tweak-default-alpha-scissor-threshold

Improve documentation for BaseMaterial3D's alpha scissor threshold
Rémi Verschelde 3 ani în urmă
părinte
comite
80831fc21f
2 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 1 1
      doc/classes/BaseMaterial3D.xml
  2. 2 0
      scene/resources/material.cpp

+ 1 - 1
doc/classes/BaseMaterial3D.xml

@@ -82,7 +82,7 @@
 			The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code].
 		</member>
 		<member name="alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold">
-			Threshold at which the alpha scissor will discard values.
+			Threshold at which the alpha scissor will discard values. Higher values will result in more pixels being discarded. If the material becomes too opaque at a distance, try increasing [member alpha_scissor_threshold]. If the material disappears at a distance, try decreasing [member alpha_scissor_threshold].
 		</member>
 		<member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" default="0.0">
 			The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel.

+ 2 - 0
scene/resources/material.cpp

@@ -2971,6 +2971,8 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) :
 
 	set_transparency(TRANSPARENCY_DISABLED);
 	set_alpha_antialiasing(ALPHA_ANTIALIASING_OFF);
+	// Alpha scissor threshold of 0.5 matches the glTF specification and Label3D default.
+	// <https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#_material_alphacutoff>
 	set_alpha_scissor_threshold(0.5);
 	set_alpha_hash_scale(1.0);
 	set_alpha_antialiasing_edge(0.3);