class_spatialmaterial.rst 138 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/SpatialMaterial.xml.
  6. .. _class_SpatialMaterial:
  7. SpatialMaterial
  8. ===============
  9. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Default 3D rendering material.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`../tutorials/3d/spatial_material`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  25. | :ref:`Color<class_Color>` | :ref:`albedo_color<class_SpatialMaterial_property_albedo_color>` | ``Color( 1, 1, 1, 1 )`` |
  26. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  27. | :ref:`Texture<class_Texture>` | :ref:`albedo_texture<class_SpatialMaterial_property_albedo_texture>` | |
  28. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  29. | :ref:`float<class_float>` | :ref:`anisotropy<class_SpatialMaterial_property_anisotropy>` | |
  30. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`anisotropy_enabled<class_SpatialMaterial_property_anisotropy_enabled>` | ``false`` |
  32. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  33. | :ref:`Texture<class_Texture>` | :ref:`anisotropy_flowmap<class_SpatialMaterial_property_anisotropy_flowmap>` | |
  34. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`ao_enabled<class_SpatialMaterial_property_ao_enabled>` | ``false`` |
  36. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  37. | :ref:`float<class_float>` | :ref:`ao_light_affect<class_SpatialMaterial_property_ao_light_affect>` | |
  38. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`ao_on_uv2<class_SpatialMaterial_property_ao_on_uv2>` | |
  40. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  41. | :ref:`Texture<class_Texture>` | :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>` | |
  42. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  43. | :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` | :ref:`ao_texture_channel<class_SpatialMaterial_property_ao_texture_channel>` | |
  44. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  45. | :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` | :ref:`async_mode<class_SpatialMaterial_property_async_mode>` | ``0`` |
  46. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  47. | :ref:`float<class_float>` | :ref:`clearcoat<class_SpatialMaterial_property_clearcoat>` | |
  48. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`clearcoat_enabled<class_SpatialMaterial_property_clearcoat_enabled>` | ``false`` |
  50. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  51. | :ref:`float<class_float>` | :ref:`clearcoat_gloss<class_SpatialMaterial_property_clearcoat_gloss>` | |
  52. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  53. | :ref:`Texture<class_Texture>` | :ref:`clearcoat_texture<class_SpatialMaterial_property_clearcoat_texture>` | |
  54. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`depth_deep_parallax<class_SpatialMaterial_property_depth_deep_parallax>` | |
  56. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`depth_enabled<class_SpatialMaterial_property_depth_enabled>` | ``false`` |
  58. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`depth_flip_binormal<class_SpatialMaterial_property_depth_flip_binormal>` | |
  60. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`depth_flip_tangent<class_SpatialMaterial_property_depth_flip_tangent>` | |
  62. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  63. | :ref:`int<class_int>` | :ref:`depth_max_layers<class_SpatialMaterial_property_depth_max_layers>` | |
  64. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  65. | :ref:`int<class_int>` | :ref:`depth_min_layers<class_SpatialMaterial_property_depth_min_layers>` | |
  66. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  67. | :ref:`float<class_float>` | :ref:`depth_scale<class_SpatialMaterial_property_depth_scale>` | |
  68. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  69. | :ref:`Texture<class_Texture>` | :ref:`depth_texture<class_SpatialMaterial_property_depth_texture>` | |
  70. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  71. | :ref:`Texture<class_Texture>` | :ref:`detail_albedo<class_SpatialMaterial_property_detail_albedo>` | |
  72. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  73. | :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` | :ref:`detail_blend_mode<class_SpatialMaterial_property_detail_blend_mode>` | |
  74. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`detail_enabled<class_SpatialMaterial_property_detail_enabled>` | ``false`` |
  76. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  77. | :ref:`Texture<class_Texture>` | :ref:`detail_mask<class_SpatialMaterial_property_detail_mask>` | |
  78. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  79. | :ref:`Texture<class_Texture>` | :ref:`detail_normal<class_SpatialMaterial_property_detail_normal>` | |
  80. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  81. | :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` | :ref:`detail_uv_layer<class_SpatialMaterial_property_detail_uv_layer>` | |
  82. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  83. | :ref:`float<class_float>` | :ref:`distance_fade_max_distance<class_SpatialMaterial_property_distance_fade_max_distance>` | |
  84. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  85. | :ref:`float<class_float>` | :ref:`distance_fade_min_distance<class_SpatialMaterial_property_distance_fade_min_distance>` | |
  86. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  87. | :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` | :ref:`distance_fade_mode<class_SpatialMaterial_property_distance_fade_mode>` | ``0`` |
  88. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`emission<class_SpatialMaterial_property_emission>` | |
  90. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  91. | :ref:`bool<class_bool>` | :ref:`emission_enabled<class_SpatialMaterial_property_emission_enabled>` | ``false`` |
  92. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  93. | :ref:`float<class_float>` | :ref:`emission_energy<class_SpatialMaterial_property_emission_energy>` | |
  94. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`emission_on_uv2<class_SpatialMaterial_property_emission_on_uv2>` | |
  96. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  97. | :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` | :ref:`emission_operator<class_SpatialMaterial_property_emission_operator>` | |
  98. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  99. | :ref:`Texture<class_Texture>` | :ref:`emission_texture<class_SpatialMaterial_property_emission_texture>` | |
  100. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  101. | :ref:`bool<class_bool>` | :ref:`flags_albedo_tex_force_srgb<class_SpatialMaterial_property_flags_albedo_tex_force_srgb>` | ``false`` |
  102. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  103. | :ref:`bool<class_bool>` | :ref:`flags_albedo_tex_msdf<class_SpatialMaterial_property_flags_albedo_tex_msdf>` | ``false`` |
  104. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`flags_disable_ambient_light<class_SpatialMaterial_property_flags_disable_ambient_light>` | ``false`` |
  106. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`flags_do_not_receive_shadows<class_SpatialMaterial_property_flags_do_not_receive_shadows>` | ``false`` |
  108. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  109. | :ref:`bool<class_bool>` | :ref:`flags_ensure_correct_normals<class_SpatialMaterial_property_flags_ensure_correct_normals>` | ``false`` |
  110. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`flags_fixed_size<class_SpatialMaterial_property_flags_fixed_size>` | ``false`` |
  112. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`flags_no_depth_test<class_SpatialMaterial_property_flags_no_depth_test>` | ``false`` |
  114. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  115. | :ref:`bool<class_bool>` | :ref:`flags_transparent<class_SpatialMaterial_property_flags_transparent>` | ``false`` |
  116. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  117. | :ref:`bool<class_bool>` | :ref:`flags_unshaded<class_SpatialMaterial_property_flags_unshaded>` | ``false`` |
  118. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  119. | :ref:`bool<class_bool>` | :ref:`flags_use_point_size<class_SpatialMaterial_property_flags_use_point_size>` | ``false`` |
  120. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  121. | :ref:`bool<class_bool>` | :ref:`flags_use_shadow_to_opacity<class_SpatialMaterial_property_flags_use_shadow_to_opacity>` | ``false`` |
  122. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  123. | :ref:`bool<class_bool>` | :ref:`flags_vertex_lighting<class_SpatialMaterial_property_flags_vertex_lighting>` | ``false`` |
  124. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  125. | :ref:`bool<class_bool>` | :ref:`flags_world_triplanar<class_SpatialMaterial_property_flags_world_triplanar>` | ``false`` |
  126. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  127. | :ref:`float<class_float>` | :ref:`metallic<class_SpatialMaterial_property_metallic>` | ``0.0`` |
  128. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  129. | :ref:`float<class_float>` | :ref:`metallic_specular<class_SpatialMaterial_property_metallic_specular>` | ``0.5`` |
  130. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  131. | :ref:`Texture<class_Texture>` | :ref:`metallic_texture<class_SpatialMaterial_property_metallic_texture>` | |
  132. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  133. | :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` | :ref:`metallic_texture_channel<class_SpatialMaterial_property_metallic_texture_channel>` | ``0`` |
  134. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`normal_enabled<class_SpatialMaterial_property_normal_enabled>` | ``false`` |
  136. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  137. | :ref:`float<class_float>` | :ref:`normal_scale<class_SpatialMaterial_property_normal_scale>` | |
  138. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  139. | :ref:`Texture<class_Texture>` | :ref:`normal_texture<class_SpatialMaterial_property_normal_texture>` | |
  140. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  141. | :ref:`float<class_float>` | :ref:`params_alpha_scissor_threshold<class_SpatialMaterial_property_params_alpha_scissor_threshold>` | |
  142. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  143. | :ref:`bool<class_bool>` | :ref:`params_billboard_keep_scale<class_SpatialMaterial_property_params_billboard_keep_scale>` | ``false`` |
  144. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  145. | :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` | :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>` | ``0`` |
  146. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  147. | :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` | :ref:`params_blend_mode<class_SpatialMaterial_property_params_blend_mode>` | ``0`` |
  148. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  149. | :ref:`CullMode<enum_SpatialMaterial_CullMode>` | :ref:`params_cull_mode<class_SpatialMaterial_property_params_cull_mode>` | ``0`` |
  150. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  151. | :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` | :ref:`params_depth_draw_mode<class_SpatialMaterial_property_params_depth_draw_mode>` | ``0`` |
  152. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  153. | :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` | :ref:`params_diffuse_mode<class_SpatialMaterial_property_params_diffuse_mode>` | ``0`` |
  154. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  155. | :ref:`bool<class_bool>` | :ref:`params_grow<class_SpatialMaterial_property_params_grow>` | ``false`` |
  156. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  157. | :ref:`float<class_float>` | :ref:`params_grow_amount<class_SpatialMaterial_property_params_grow_amount>` | |
  158. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  159. | :ref:`float<class_float>` | :ref:`params_line_width<class_SpatialMaterial_property_params_line_width>` | ``1.0`` |
  160. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  161. | :ref:`float<class_float>` | :ref:`params_point_size<class_SpatialMaterial_property_params_point_size>` | ``1.0`` |
  162. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  163. | :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` | :ref:`params_specular_mode<class_SpatialMaterial_property_params_specular_mode>` | ``0`` |
  164. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  165. | :ref:`bool<class_bool>` | :ref:`params_use_alpha_scissor<class_SpatialMaterial_property_params_use_alpha_scissor>` | ``false`` |
  166. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  167. | :ref:`int<class_int>` | :ref:`particles_anim_h_frames<class_SpatialMaterial_property_particles_anim_h_frames>` | |
  168. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  169. | :ref:`bool<class_bool>` | :ref:`particles_anim_loop<class_SpatialMaterial_property_particles_anim_loop>` | |
  170. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  171. | :ref:`int<class_int>` | :ref:`particles_anim_v_frames<class_SpatialMaterial_property_particles_anim_v_frames>` | |
  172. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  173. | :ref:`float<class_float>` | :ref:`proximity_fade_distance<class_SpatialMaterial_property_proximity_fade_distance>` | |
  174. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  175. | :ref:`bool<class_bool>` | :ref:`proximity_fade_enable<class_SpatialMaterial_property_proximity_fade_enable>` | ``false`` |
  176. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  177. | :ref:`bool<class_bool>` | :ref:`refraction_enabled<class_SpatialMaterial_property_refraction_enabled>` | ``false`` |
  178. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  179. | :ref:`float<class_float>` | :ref:`refraction_scale<class_SpatialMaterial_property_refraction_scale>` | |
  180. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  181. | :ref:`Texture<class_Texture>` | :ref:`refraction_texture<class_SpatialMaterial_property_refraction_texture>` | |
  182. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  183. | :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` | :ref:`refraction_texture_channel<class_SpatialMaterial_property_refraction_texture_channel>` | |
  184. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  185. | :ref:`float<class_float>` | :ref:`rim<class_SpatialMaterial_property_rim>` | |
  186. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  187. | :ref:`bool<class_bool>` | :ref:`rim_enabled<class_SpatialMaterial_property_rim_enabled>` | ``false`` |
  188. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  189. | :ref:`Texture<class_Texture>` | :ref:`rim_texture<class_SpatialMaterial_property_rim_texture>` | |
  190. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  191. | :ref:`float<class_float>` | :ref:`rim_tint<class_SpatialMaterial_property_rim_tint>` | |
  192. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  193. | :ref:`float<class_float>` | :ref:`roughness<class_SpatialMaterial_property_roughness>` | ``1.0`` |
  194. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  195. | :ref:`Texture<class_Texture>` | :ref:`roughness_texture<class_SpatialMaterial_property_roughness_texture>` | |
  196. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  197. | :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` | :ref:`roughness_texture_channel<class_SpatialMaterial_property_roughness_texture_channel>` | ``0`` |
  198. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  199. | :ref:`bool<class_bool>` | :ref:`subsurf_scatter_enabled<class_SpatialMaterial_property_subsurf_scatter_enabled>` | ``false`` |
  200. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  201. | :ref:`float<class_float>` | :ref:`subsurf_scatter_strength<class_SpatialMaterial_property_subsurf_scatter_strength>` | |
  202. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  203. | :ref:`Texture<class_Texture>` | :ref:`subsurf_scatter_texture<class_SpatialMaterial_property_subsurf_scatter_texture>` | |
  204. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  205. | :ref:`Color<class_Color>` | :ref:`transmission<class_SpatialMaterial_property_transmission>` | |
  206. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  207. | :ref:`bool<class_bool>` | :ref:`transmission_enabled<class_SpatialMaterial_property_transmission_enabled>` | ``false`` |
  208. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  209. | :ref:`Texture<class_Texture>` | :ref:`transmission_texture<class_SpatialMaterial_property_transmission_texture>` | |
  210. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  211. | :ref:`Vector3<class_Vector3>` | :ref:`uv1_offset<class_SpatialMaterial_property_uv1_offset>` | ``Vector3( 0, 0, 0 )`` |
  212. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  213. | :ref:`Vector3<class_Vector3>` | :ref:`uv1_scale<class_SpatialMaterial_property_uv1_scale>` | ``Vector3( 1, 1, 1 )`` |
  214. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  215. | :ref:`bool<class_bool>` | :ref:`uv1_triplanar<class_SpatialMaterial_property_uv1_triplanar>` | ``false`` |
  216. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  217. | :ref:`float<class_float>` | :ref:`uv1_triplanar_sharpness<class_SpatialMaterial_property_uv1_triplanar_sharpness>` | ``1.0`` |
  218. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  219. | :ref:`Vector3<class_Vector3>` | :ref:`uv2_offset<class_SpatialMaterial_property_uv2_offset>` | ``Vector3( 0, 0, 0 )`` |
  220. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  221. | :ref:`Vector3<class_Vector3>` | :ref:`uv2_scale<class_SpatialMaterial_property_uv2_scale>` | ``Vector3( 1, 1, 1 )`` |
  222. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  223. | :ref:`bool<class_bool>` | :ref:`uv2_triplanar<class_SpatialMaterial_property_uv2_triplanar>` | ``false`` |
  224. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  225. | :ref:`float<class_float>` | :ref:`uv2_triplanar_sharpness<class_SpatialMaterial_property_uv2_triplanar_sharpness>` | ``1.0`` |
  226. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  227. | :ref:`bool<class_bool>` | :ref:`vertex_color_is_srgb<class_SpatialMaterial_property_vertex_color_is_srgb>` | ``false`` |
  228. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  229. | :ref:`bool<class_bool>` | :ref:`vertex_color_use_as_albedo<class_SpatialMaterial_property_vertex_color_use_as_albedo>` | ``false`` |
  230. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+
  231. .. rst-class:: classref-reftable-group
  232. Methods
  233. -------
  234. .. table::
  235. :widths: auto
  236. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  237. | :ref:`bool<class_bool>` | :ref:`get_feature<class_SpatialMaterial_method_get_feature>` **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const| |
  238. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  239. | :ref:`bool<class_bool>` | :ref:`get_flag<class_SpatialMaterial_method_get_flag>` **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const| |
  240. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  241. | :ref:`Texture<class_Texture>` | :ref:`get_texture<class_SpatialMaterial_method_get_texture>` **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const| |
  242. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  243. | void | :ref:`set_feature<class_SpatialMaterial_method_set_feature>` **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)** |
  244. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  245. | void | :ref:`set_flag<class_SpatialMaterial_method_set_flag>` **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)** |
  246. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  247. | void | :ref:`set_texture<class_SpatialMaterial_method_set_texture>` **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)** |
  248. +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  249. .. rst-class:: classref-section-separator
  250. ----
  251. .. rst-class:: classref-descriptions-group
  252. Enumerations
  253. ------------
  254. .. _enum_SpatialMaterial_TextureParam:
  255. .. rst-class:: classref-enumeration
  256. enum **TextureParam**:
  257. .. _class_SpatialMaterial_constant_TEXTURE_ALBEDO:
  258. .. rst-class:: classref-enumeration-constant
  259. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_ALBEDO** = ``0``
  260. Texture specifying per-pixel color.
  261. .. _class_SpatialMaterial_constant_TEXTURE_METALLIC:
  262. .. rst-class:: classref-enumeration-constant
  263. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_METALLIC** = ``1``
  264. Texture specifying per-pixel metallic value.
  265. .. _class_SpatialMaterial_constant_TEXTURE_ROUGHNESS:
  266. .. rst-class:: classref-enumeration-constant
  267. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_ROUGHNESS** = ``2``
  268. Texture specifying per-pixel roughness value.
  269. .. _class_SpatialMaterial_constant_TEXTURE_EMISSION:
  270. .. rst-class:: classref-enumeration-constant
  271. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_EMISSION** = ``3``
  272. Texture specifying per-pixel emission color.
  273. .. _class_SpatialMaterial_constant_TEXTURE_NORMAL:
  274. .. rst-class:: classref-enumeration-constant
  275. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_NORMAL** = ``4``
  276. Texture specifying per-pixel normal vector.
  277. .. _class_SpatialMaterial_constant_TEXTURE_RIM:
  278. .. rst-class:: classref-enumeration-constant
  279. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_RIM** = ``5``
  280. Texture specifying per-pixel rim value.
  281. .. _class_SpatialMaterial_constant_TEXTURE_CLEARCOAT:
  282. .. rst-class:: classref-enumeration-constant
  283. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_CLEARCOAT** = ``6``
  284. Texture specifying per-pixel clearcoat value.
  285. .. _class_SpatialMaterial_constant_TEXTURE_FLOWMAP:
  286. .. rst-class:: classref-enumeration-constant
  287. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_FLOWMAP** = ``7``
  288. Texture specifying per-pixel flowmap direction for use with :ref:`anisotropy<class_SpatialMaterial_property_anisotropy>`.
  289. .. _class_SpatialMaterial_constant_TEXTURE_AMBIENT_OCCLUSION:
  290. .. rst-class:: classref-enumeration-constant
  291. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_AMBIENT_OCCLUSION** = ``8``
  292. Texture specifying per-pixel ambient occlusion value.
  293. .. _class_SpatialMaterial_constant_TEXTURE_DEPTH:
  294. .. rst-class:: classref-enumeration-constant
  295. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_DEPTH** = ``9``
  296. Texture specifying per-pixel depth.
  297. .. _class_SpatialMaterial_constant_TEXTURE_SUBSURFACE_SCATTERING:
  298. .. rst-class:: classref-enumeration-constant
  299. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_SUBSURFACE_SCATTERING** = ``10``
  300. Texture specifying per-pixel subsurface scattering.
  301. .. _class_SpatialMaterial_constant_TEXTURE_TRANSMISSION:
  302. .. rst-class:: classref-enumeration-constant
  303. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_TRANSMISSION** = ``11``
  304. Texture specifying per-pixel transmission color.
  305. .. _class_SpatialMaterial_constant_TEXTURE_REFRACTION:
  306. .. rst-class:: classref-enumeration-constant
  307. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_REFRACTION** = ``12``
  308. Texture specifying per-pixel refraction strength.
  309. .. _class_SpatialMaterial_constant_TEXTURE_DETAIL_MASK:
  310. .. rst-class:: classref-enumeration-constant
  311. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_DETAIL_MASK** = ``13``
  312. Texture specifying per-pixel detail mask blending value.
  313. .. _class_SpatialMaterial_constant_TEXTURE_DETAIL_ALBEDO:
  314. .. rst-class:: classref-enumeration-constant
  315. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_DETAIL_ALBEDO** = ``14``
  316. Texture specifying per-pixel detail color.
  317. .. _class_SpatialMaterial_constant_TEXTURE_DETAIL_NORMAL:
  318. .. rst-class:: classref-enumeration-constant
  319. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_DETAIL_NORMAL** = ``15``
  320. Texture specifying per-pixel detail normal.
  321. .. _class_SpatialMaterial_constant_TEXTURE_MAX:
  322. .. rst-class:: classref-enumeration-constant
  323. :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` **TEXTURE_MAX** = ``16``
  324. Represents the size of the :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` enum.
  325. .. rst-class:: classref-item-separator
  326. ----
  327. .. _enum_SpatialMaterial_DetailUV:
  328. .. rst-class:: classref-enumeration
  329. enum **DetailUV**:
  330. .. _class_SpatialMaterial_constant_DETAIL_UV_1:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` **DETAIL_UV_1** = ``0``
  333. Use ``UV`` with the detail texture.
  334. .. _class_SpatialMaterial_constant_DETAIL_UV_2:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` **DETAIL_UV_2** = ``1``
  337. Use ``UV2`` with the detail texture.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _enum_SpatialMaterial_Feature:
  341. .. rst-class:: classref-enumeration
  342. enum **Feature**:
  343. .. _class_SpatialMaterial_constant_FEATURE_TRANSPARENT:
  344. .. rst-class:: classref-enumeration-constant
  345. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_TRANSPARENT** = ``0``
  346. Constant for setting :ref:`flags_transparent<class_SpatialMaterial_property_flags_transparent>`.
  347. .. _class_SpatialMaterial_constant_FEATURE_EMISSION:
  348. .. rst-class:: classref-enumeration-constant
  349. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_EMISSION** = ``1``
  350. Constant for setting :ref:`emission_enabled<class_SpatialMaterial_property_emission_enabled>`.
  351. .. _class_SpatialMaterial_constant_FEATURE_NORMAL_MAPPING:
  352. .. rst-class:: classref-enumeration-constant
  353. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_NORMAL_MAPPING** = ``2``
  354. Constant for setting :ref:`normal_enabled<class_SpatialMaterial_property_normal_enabled>`.
  355. .. _class_SpatialMaterial_constant_FEATURE_RIM:
  356. .. rst-class:: classref-enumeration-constant
  357. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_RIM** = ``3``
  358. Constant for setting :ref:`rim_enabled<class_SpatialMaterial_property_rim_enabled>`.
  359. .. _class_SpatialMaterial_constant_FEATURE_CLEARCOAT:
  360. .. rst-class:: classref-enumeration-constant
  361. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_CLEARCOAT** = ``4``
  362. Constant for setting :ref:`clearcoat_enabled<class_SpatialMaterial_property_clearcoat_enabled>`.
  363. .. _class_SpatialMaterial_constant_FEATURE_ANISOTROPY:
  364. .. rst-class:: classref-enumeration-constant
  365. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_ANISOTROPY** = ``5``
  366. Constant for setting :ref:`anisotropy_enabled<class_SpatialMaterial_property_anisotropy_enabled>`.
  367. .. _class_SpatialMaterial_constant_FEATURE_AMBIENT_OCCLUSION:
  368. .. rst-class:: classref-enumeration-constant
  369. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_AMBIENT_OCCLUSION** = ``6``
  370. Constant for setting :ref:`ao_enabled<class_SpatialMaterial_property_ao_enabled>`.
  371. .. _class_SpatialMaterial_constant_FEATURE_DEPTH_MAPPING:
  372. .. rst-class:: classref-enumeration-constant
  373. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_DEPTH_MAPPING** = ``7``
  374. Constant for setting :ref:`depth_enabled<class_SpatialMaterial_property_depth_enabled>`.
  375. .. _class_SpatialMaterial_constant_FEATURE_SUBSURACE_SCATTERING:
  376. .. rst-class:: classref-enumeration-constant
  377. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_SUBSURACE_SCATTERING** = ``8``
  378. Constant for setting :ref:`subsurf_scatter_enabled<class_SpatialMaterial_property_subsurf_scatter_enabled>`.
  379. .. _class_SpatialMaterial_constant_FEATURE_TRANSMISSION:
  380. .. rst-class:: classref-enumeration-constant
  381. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_TRANSMISSION** = ``9``
  382. Constant for setting :ref:`transmission_enabled<class_SpatialMaterial_property_transmission_enabled>`.
  383. .. _class_SpatialMaterial_constant_FEATURE_REFRACTION:
  384. .. rst-class:: classref-enumeration-constant
  385. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_REFRACTION** = ``10``
  386. Constant for setting :ref:`refraction_enabled<class_SpatialMaterial_property_refraction_enabled>`.
  387. .. _class_SpatialMaterial_constant_FEATURE_DETAIL:
  388. .. rst-class:: classref-enumeration-constant
  389. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_DETAIL** = ``11``
  390. Constant for setting :ref:`detail_enabled<class_SpatialMaterial_property_detail_enabled>`.
  391. .. _class_SpatialMaterial_constant_FEATURE_MAX:
  392. .. rst-class:: classref-enumeration-constant
  393. :ref:`Feature<enum_SpatialMaterial_Feature>` **FEATURE_MAX** = ``12``
  394. Represents the size of the :ref:`Feature<enum_SpatialMaterial_Feature>` enum.
  395. .. rst-class:: classref-item-separator
  396. ----
  397. .. _enum_SpatialMaterial_BlendMode:
  398. .. rst-class:: classref-enumeration
  399. enum **BlendMode**:
  400. .. _class_SpatialMaterial_constant_BLEND_MODE_MIX:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **BLEND_MODE_MIX** = ``0``
  403. Default blend mode. The color of the object is blended over the background based on the object's alpha value.
  404. .. _class_SpatialMaterial_constant_BLEND_MODE_ADD:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **BLEND_MODE_ADD** = ``1``
  407. The color of the object is added to the background.
  408. .. _class_SpatialMaterial_constant_BLEND_MODE_SUB:
  409. .. rst-class:: classref-enumeration-constant
  410. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **BLEND_MODE_SUB** = ``2``
  411. The color of the object is subtracted from the background.
  412. .. _class_SpatialMaterial_constant_BLEND_MODE_MUL:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **BLEND_MODE_MUL** = ``3``
  415. The color of the object is multiplied by the background.
  416. .. rst-class:: classref-item-separator
  417. ----
  418. .. _enum_SpatialMaterial_DepthDrawMode:
  419. .. rst-class:: classref-enumeration
  420. enum **DepthDrawMode**:
  421. .. _class_SpatialMaterial_constant_DEPTH_DRAW_OPAQUE_ONLY:
  422. .. rst-class:: classref-enumeration-constant
  423. :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **DEPTH_DRAW_OPAQUE_ONLY** = ``0``
  424. Default depth draw mode. Depth is drawn only for opaque objects.
  425. .. _class_SpatialMaterial_constant_DEPTH_DRAW_ALWAYS:
  426. .. rst-class:: classref-enumeration-constant
  427. :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **DEPTH_DRAW_ALWAYS** = ``1``
  428. Depth draw is calculated for both opaque and transparent objects.
  429. .. _class_SpatialMaterial_constant_DEPTH_DRAW_DISABLED:
  430. .. rst-class:: classref-enumeration-constant
  431. :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **DEPTH_DRAW_DISABLED** = ``2``
  432. No depth draw.
  433. .. _class_SpatialMaterial_constant_DEPTH_DRAW_ALPHA_OPAQUE_PREPASS:
  434. .. rst-class:: classref-enumeration-constant
  435. :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **DEPTH_DRAW_ALPHA_OPAQUE_PREPASS** = ``3``
  436. For transparent objects, an opaque pass is made first with the opaque parts, then transparency is drawn.
  437. .. rst-class:: classref-item-separator
  438. ----
  439. .. _enum_SpatialMaterial_CullMode:
  440. .. rst-class:: classref-enumeration
  441. enum **CullMode**:
  442. .. _class_SpatialMaterial_constant_CULL_BACK:
  443. .. rst-class:: classref-enumeration-constant
  444. :ref:`CullMode<enum_SpatialMaterial_CullMode>` **CULL_BACK** = ``0``
  445. Default cull mode. The back of the object is culled when not visible.
  446. .. _class_SpatialMaterial_constant_CULL_FRONT:
  447. .. rst-class:: classref-enumeration-constant
  448. :ref:`CullMode<enum_SpatialMaterial_CullMode>` **CULL_FRONT** = ``1``
  449. The front of the object is culled when not visible.
  450. .. _class_SpatialMaterial_constant_CULL_DISABLED:
  451. .. rst-class:: classref-enumeration-constant
  452. :ref:`CullMode<enum_SpatialMaterial_CullMode>` **CULL_DISABLED** = ``2``
  453. No culling is performed.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _enum_SpatialMaterial_Flags:
  457. .. rst-class:: classref-enumeration
  458. enum **Flags**:
  459. .. _class_SpatialMaterial_constant_FLAG_UNSHADED:
  460. .. rst-class:: classref-enumeration-constant
  461. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_UNSHADED** = ``0``
  462. No lighting is used on the object. Color comes directly from ``ALBEDO``.
  463. .. _class_SpatialMaterial_constant_FLAG_USE_VERTEX_LIGHTING:
  464. .. rst-class:: classref-enumeration-constant
  465. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_USE_VERTEX_LIGHTING** = ``1``
  466. Lighting is calculated per-vertex rather than per-pixel. This can be used to increase the speed of the shader at the cost of quality.
  467. .. _class_SpatialMaterial_constant_FLAG_DISABLE_DEPTH_TEST:
  468. .. rst-class:: classref-enumeration-constant
  469. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_DISABLE_DEPTH_TEST** = ``2``
  470. Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
  471. .. _class_SpatialMaterial_constant_FLAG_ALBEDO_FROM_VERTEX_COLOR:
  472. .. rst-class:: classref-enumeration-constant
  473. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_ALBEDO_FROM_VERTEX_COLOR** = ``3``
  474. Set ``ALBEDO`` to the per-vertex color specified in the mesh.
  475. .. _class_SpatialMaterial_constant_FLAG_SRGB_VERTEX_COLOR:
  476. .. rst-class:: classref-enumeration-constant
  477. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_SRGB_VERTEX_COLOR** = ``4``
  478. Vertex color is in sRGB space and needs to be converted to linear. Only applies in the GLES3 renderer.
  479. .. _class_SpatialMaterial_constant_FLAG_USE_POINT_SIZE:
  480. .. rst-class:: classref-enumeration-constant
  481. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_USE_POINT_SIZE** = ``5``
  482. Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use ``POINT_COORD`` instead of ``UV``.
  483. .. _class_SpatialMaterial_constant_FLAG_FIXED_SIZE:
  484. .. rst-class:: classref-enumeration-constant
  485. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_FIXED_SIZE** = ``6``
  486. Object is scaled by depth so that it always appears the same size on screen.
  487. .. _class_SpatialMaterial_constant_FLAG_BILLBOARD_KEEP_SCALE:
  488. .. rst-class:: classref-enumeration-constant
  489. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_BILLBOARD_KEEP_SCALE** = ``7``
  490. Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>` is :ref:`BILLBOARD_ENABLED<class_SpatialMaterial_constant_BILLBOARD_ENABLED>`.
  491. .. _class_SpatialMaterial_constant_FLAG_UV1_USE_TRIPLANAR:
  492. .. rst-class:: classref-enumeration-constant
  493. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_UV1_USE_TRIPLANAR** = ``8``
  494. Use triplanar texture lookup for all texture lookups that would normally use ``UV``.
  495. .. _class_SpatialMaterial_constant_FLAG_UV2_USE_TRIPLANAR:
  496. .. rst-class:: classref-enumeration-constant
  497. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_UV2_USE_TRIPLANAR** = ``9``
  498. Use triplanar texture lookup for all texture lookups that would normally use ``UV2``.
  499. .. _class_SpatialMaterial_constant_FLAG_AO_ON_UV2:
  500. .. rst-class:: classref-enumeration-constant
  501. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_AO_ON_UV2** = ``11``
  502. Use ``UV2`` coordinates to look up from the :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>`.
  503. .. _class_SpatialMaterial_constant_FLAG_EMISSION_ON_UV2:
  504. .. rst-class:: classref-enumeration-constant
  505. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_EMISSION_ON_UV2** = ``12``
  506. Use ``UV2`` coordinates to look up from the :ref:`emission_texture<class_SpatialMaterial_property_emission_texture>`.
  507. .. _class_SpatialMaterial_constant_FLAG_USE_ALPHA_SCISSOR:
  508. .. rst-class:: classref-enumeration-constant
  509. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_USE_ALPHA_SCISSOR** = ``13``
  510. Use alpha scissor. Set by :ref:`params_use_alpha_scissor<class_SpatialMaterial_property_params_use_alpha_scissor>`.
  511. .. _class_SpatialMaterial_constant_FLAG_TRIPLANAR_USE_WORLD:
  512. .. rst-class:: classref-enumeration-constant
  513. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_TRIPLANAR_USE_WORLD** = ``10``
  514. Use world coordinates in the triplanar texture lookup instead of local coordinates.
  515. .. _class_SpatialMaterial_constant_FLAG_ALBEDO_TEXTURE_FORCE_SRGB:
  516. .. rst-class:: classref-enumeration-constant
  517. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_ALBEDO_TEXTURE_FORCE_SRGB** = ``14``
  518. Forces the shader to convert albedo from sRGB space to linear space.
  519. .. _class_SpatialMaterial_constant_FLAG_DONT_RECEIVE_SHADOWS:
  520. .. rst-class:: classref-enumeration-constant
  521. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_DONT_RECEIVE_SHADOWS** = ``15``
  522. Disables receiving shadows from other objects.
  523. .. _class_SpatialMaterial_constant_FLAG_DISABLE_AMBIENT_LIGHT:
  524. .. rst-class:: classref-enumeration-constant
  525. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_DISABLE_AMBIENT_LIGHT** = ``17``
  526. Disables receiving ambient light.
  527. .. _class_SpatialMaterial_constant_FLAG_ENSURE_CORRECT_NORMALS:
  528. .. rst-class:: classref-enumeration-constant
  529. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_ENSURE_CORRECT_NORMALS** = ``16``
  530. Ensures that normals appear correct, even with non-uniform scaling.
  531. .. _class_SpatialMaterial_constant_FLAG_USE_SHADOW_TO_OPACITY:
  532. .. rst-class:: classref-enumeration-constant
  533. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_USE_SHADOW_TO_OPACITY** = ``18``
  534. Enables the shadow to opacity feature.
  535. .. _class_SpatialMaterial_constant_FLAG_ALBEDO_TEXTURE_SDF:
  536. .. rst-class:: classref-enumeration-constant
  537. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_ALBEDO_TEXTURE_SDF** = ``19``
  538. Enables signed distance field rendering shader.
  539. .. _class_SpatialMaterial_constant_FLAG_MAX:
  540. .. rst-class:: classref-enumeration-constant
  541. :ref:`Flags<enum_SpatialMaterial_Flags>` **FLAG_MAX** = ``20``
  542. Represents the size of the :ref:`Flags<enum_SpatialMaterial_Flags>` enum.
  543. .. rst-class:: classref-item-separator
  544. ----
  545. .. _enum_SpatialMaterial_DiffuseMode:
  546. .. rst-class:: classref-enumeration
  547. enum **DiffuseMode**:
  548. .. _class_SpatialMaterial_constant_DIFFUSE_BURLEY:
  549. .. rst-class:: classref-enumeration-constant
  550. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **DIFFUSE_BURLEY** = ``0``
  551. Default diffuse scattering algorithm.
  552. .. _class_SpatialMaterial_constant_DIFFUSE_LAMBERT:
  553. .. rst-class:: classref-enumeration-constant
  554. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **DIFFUSE_LAMBERT** = ``1``
  555. Diffuse scattering ignores roughness.
  556. .. _class_SpatialMaterial_constant_DIFFUSE_LAMBERT_WRAP:
  557. .. rst-class:: classref-enumeration-constant
  558. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **DIFFUSE_LAMBERT_WRAP** = ``2``
  559. Extends Lambert to cover more than 90 degrees when roughness increases.
  560. .. _class_SpatialMaterial_constant_DIFFUSE_OREN_NAYAR:
  561. .. rst-class:: classref-enumeration-constant
  562. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **DIFFUSE_OREN_NAYAR** = ``3``
  563. Attempts to use roughness to emulate microsurfacing.
  564. .. _class_SpatialMaterial_constant_DIFFUSE_TOON:
  565. .. rst-class:: classref-enumeration-constant
  566. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **DIFFUSE_TOON** = ``4``
  567. Uses a hard cut for lighting, with smoothing affected by roughness.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _enum_SpatialMaterial_SpecularMode:
  571. .. rst-class:: classref-enumeration
  572. enum **SpecularMode**:
  573. .. _class_SpatialMaterial_constant_SPECULAR_SCHLICK_GGX:
  574. .. rst-class:: classref-enumeration-constant
  575. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **SPECULAR_SCHLICK_GGX** = ``0``
  576. Default specular blob.
  577. .. _class_SpatialMaterial_constant_SPECULAR_BLINN:
  578. .. rst-class:: classref-enumeration-constant
  579. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **SPECULAR_BLINN** = ``1``
  580. Older specular algorithm, included for compatibility.
  581. .. _class_SpatialMaterial_constant_SPECULAR_PHONG:
  582. .. rst-class:: classref-enumeration-constant
  583. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **SPECULAR_PHONG** = ``2``
  584. Older specular algorithm, included for compatibility.
  585. .. _class_SpatialMaterial_constant_SPECULAR_TOON:
  586. .. rst-class:: classref-enumeration-constant
  587. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **SPECULAR_TOON** = ``3``
  588. Toon blob which changes size based on roughness.
  589. .. _class_SpatialMaterial_constant_SPECULAR_DISABLED:
  590. .. rst-class:: classref-enumeration-constant
  591. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **SPECULAR_DISABLED** = ``4``
  592. No specular blob.
  593. .. rst-class:: classref-item-separator
  594. ----
  595. .. _enum_SpatialMaterial_BillboardMode:
  596. .. rst-class:: classref-enumeration
  597. enum **BillboardMode**:
  598. .. _class_SpatialMaterial_constant_BILLBOARD_DISABLED:
  599. .. rst-class:: classref-enumeration-constant
  600. :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **BILLBOARD_DISABLED** = ``0``
  601. Billboard mode is disabled.
  602. .. _class_SpatialMaterial_constant_BILLBOARD_ENABLED:
  603. .. rst-class:: classref-enumeration-constant
  604. :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **BILLBOARD_ENABLED** = ``1``
  605. The object's Z axis will always face the camera.
  606. .. _class_SpatialMaterial_constant_BILLBOARD_FIXED_Y:
  607. .. rst-class:: classref-enumeration-constant
  608. :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **BILLBOARD_FIXED_Y** = ``2``
  609. The object's X axis will always face the camera.
  610. .. _class_SpatialMaterial_constant_BILLBOARD_PARTICLES:
  611. .. rst-class:: classref-enumeration-constant
  612. :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **BILLBOARD_PARTICLES** = ``3``
  613. Used for particle systems when assigned to :ref:`Particles<class_Particles>` and :ref:`CPUParticles<class_CPUParticles>` nodes. Enables ``particles_anim_*`` properties.
  614. The :ref:`ParticlesMaterial.anim_speed<class_ParticlesMaterial_property_anim_speed>` or :ref:`CPUParticles.anim_speed<class_CPUParticles_property_anim_speed>` should also be set to a positive value for the animation to play.
  615. .. rst-class:: classref-item-separator
  616. ----
  617. .. _enum_SpatialMaterial_TextureChannel:
  618. .. rst-class:: classref-enumeration
  619. enum **TextureChannel**:
  620. .. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_RED:
  621. .. rst-class:: classref-enumeration-constant
  622. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **TEXTURE_CHANNEL_RED** = ``0``
  623. Used to read from the red channel of a texture.
  624. .. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_GREEN:
  625. .. rst-class:: classref-enumeration-constant
  626. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **TEXTURE_CHANNEL_GREEN** = ``1``
  627. Used to read from the green channel of a texture.
  628. .. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_BLUE:
  629. .. rst-class:: classref-enumeration-constant
  630. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **TEXTURE_CHANNEL_BLUE** = ``2``
  631. Used to read from the blue channel of a texture.
  632. .. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_ALPHA:
  633. .. rst-class:: classref-enumeration-constant
  634. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **TEXTURE_CHANNEL_ALPHA** = ``3``
  635. Used to read from the alpha channel of a texture.
  636. .. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_GRAYSCALE:
  637. .. rst-class:: classref-enumeration-constant
  638. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **TEXTURE_CHANNEL_GRAYSCALE** = ``4``
  639. Currently unused.
  640. .. rst-class:: classref-item-separator
  641. ----
  642. .. _enum_SpatialMaterial_EmissionOperator:
  643. .. rst-class:: classref-enumeration
  644. enum **EmissionOperator**:
  645. .. _class_SpatialMaterial_constant_EMISSION_OP_ADD:
  646. .. rst-class:: classref-enumeration-constant
  647. :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` **EMISSION_OP_ADD** = ``0``
  648. Adds the emission color to the color from the emission texture.
  649. .. _class_SpatialMaterial_constant_EMISSION_OP_MULTIPLY:
  650. .. rst-class:: classref-enumeration-constant
  651. :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` **EMISSION_OP_MULTIPLY** = ``1``
  652. Multiplies the emission color by the color from the emission texture.
  653. .. rst-class:: classref-item-separator
  654. ----
  655. .. _enum_SpatialMaterial_DistanceFadeMode:
  656. .. rst-class:: classref-enumeration
  657. enum **DistanceFadeMode**:
  658. .. _class_SpatialMaterial_constant_DISTANCE_FADE_DISABLED:
  659. .. rst-class:: classref-enumeration-constant
  660. :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **DISTANCE_FADE_DISABLED** = ``0``
  661. Do not use distance fade.
  662. .. _class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_ALPHA:
  663. .. rst-class:: classref-enumeration-constant
  664. :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **DISTANCE_FADE_PIXEL_ALPHA** = ``1``
  665. Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel.
  666. .. _class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_DITHER:
  667. .. rst-class:: classref-enumeration-constant
  668. :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **DISTANCE_FADE_PIXEL_DITHER** = ``2``
  669. Smoothly fades the object out based on each pixel's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than :ref:`DISTANCE_FADE_PIXEL_ALPHA<class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_ALPHA>`.
  670. .. _class_SpatialMaterial_constant_DISTANCE_FADE_OBJECT_DITHER:
  671. .. rst-class:: classref-enumeration-constant
  672. :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **DISTANCE_FADE_OBJECT_DITHER** = ``3``
  673. Smoothly fades the object out based on the object's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than :ref:`DISTANCE_FADE_PIXEL_ALPHA<class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_ALPHA>`.
  674. .. rst-class:: classref-item-separator
  675. ----
  676. .. _enum_SpatialMaterial_AsyncMode:
  677. .. rst-class:: classref-enumeration
  678. enum **AsyncMode**:
  679. .. _class_SpatialMaterial_constant_ASYNC_MODE_VISIBLE:
  680. .. rst-class:: classref-enumeration-constant
  681. :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` **ASYNC_MODE_VISIBLE** = ``0``
  682. The real conditioned shader needed on each situation will be sent for background compilation. In the meantime, a very complex shader that adapts to every situation will be used ("ubershader"). This ubershader is much slower to render, but will keep the game running without stalling to compile. Once shader compilation is done, the ubershader is replaced by the traditional optimized shader.
  683. .. _class_SpatialMaterial_constant_ASYNC_MODE_HIDDEN:
  684. .. rst-class:: classref-enumeration-constant
  685. :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` **ASYNC_MODE_HIDDEN** = ``1``
  686. Anything with this material applied won't be rendered while this material's shader is being compiled.
  687. This is useful for optimization, in cases where the visuals won't suffer from having certain non-essential elements missing during the short time their shaders are being compiled.
  688. .. rst-class:: classref-section-separator
  689. ----
  690. .. rst-class:: classref-descriptions-group
  691. Property Descriptions
  692. ---------------------
  693. .. _class_SpatialMaterial_property_albedo_color:
  694. .. rst-class:: classref-property
  695. :ref:`Color<class_Color>` **albedo_color** = ``Color( 1, 1, 1, 1 )``
  696. .. rst-class:: classref-property-setget
  697. - void **set_albedo** **(** :ref:`Color<class_Color>` value **)**
  698. - :ref:`Color<class_Color>` **get_albedo** **(** **)**
  699. The material's base color.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_SpatialMaterial_property_albedo_texture:
  703. .. rst-class:: classref-property
  704. :ref:`Texture<class_Texture>` **albedo_texture**
  705. .. rst-class:: classref-property-setget
  706. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  707. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  708. Texture to multiply by :ref:`albedo_color<class_SpatialMaterial_property_albedo_color>`. Used for basic texturing of objects.
  709. .. rst-class:: classref-item-separator
  710. ----
  711. .. _class_SpatialMaterial_property_anisotropy:
  712. .. rst-class:: classref-property
  713. :ref:`float<class_float>` **anisotropy**
  714. .. rst-class:: classref-property-setget
  715. - void **set_anisotropy** **(** :ref:`float<class_float>` value **)**
  716. - :ref:`float<class_float>` **get_anisotropy** **(** **)**
  717. The strength of the anisotropy effect. This is multiplied by :ref:`anisotropy_flowmap<class_SpatialMaterial_property_anisotropy_flowmap>`'s alpha channel if a texture is defined there and the texture contains an alpha channel.
  718. .. rst-class:: classref-item-separator
  719. ----
  720. .. _class_SpatialMaterial_property_anisotropy_enabled:
  721. .. rst-class:: classref-property
  722. :ref:`bool<class_bool>` **anisotropy_enabled** = ``false``
  723. .. rst-class:: classref-property-setget
  724. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  725. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  726. If ``true``, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections.
  727. \ **Note:** Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken.
  728. \ **Note:** Material anisotropy should not to be confused with anisotropic texture filtering. Anisotropic texture filtering can be enabled by selecting a texture in the FileSystem dock, going to the Import dock, checking the **Anisotropic** checkbox then clicking **Reimport**. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/quality/filters/anisotropic_filter_level<class_ProjectSettings_property_rendering/quality/filters/anisotropic_filter_level>`.
  729. .. rst-class:: classref-item-separator
  730. ----
  731. .. _class_SpatialMaterial_property_anisotropy_flowmap:
  732. .. rst-class:: classref-property
  733. :ref:`Texture<class_Texture>` **anisotropy_flowmap**
  734. .. rst-class:: classref-property-setget
  735. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  736. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  737. Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion.
  738. If present, the texture's alpha channel will be used to multiply the strength of the :ref:`anisotropy<class_SpatialMaterial_property_anisotropy>` effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored.
  739. .. rst-class:: classref-item-separator
  740. ----
  741. .. _class_SpatialMaterial_property_ao_enabled:
  742. .. rst-class:: classref-property
  743. :ref:`bool<class_bool>` **ao_enabled** = ``false``
  744. .. rst-class:: classref-property-setget
  745. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  746. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  747. If ``true``, ambient occlusion is enabled. Ambient occlusion darkens areas based on the :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>`.
  748. .. rst-class:: classref-item-separator
  749. ----
  750. .. _class_SpatialMaterial_property_ao_light_affect:
  751. .. rst-class:: classref-property
  752. :ref:`float<class_float>` **ao_light_affect**
  753. .. rst-class:: classref-property-setget
  754. - void **set_ao_light_affect** **(** :ref:`float<class_float>` value **)**
  755. - :ref:`float<class_float>` **get_ao_light_affect** **(** **)**
  756. Amount that ambient occlusion affects lighting from lights. If ``0``, ambient occlusion only affects ambient light. If ``1``, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic.
  757. .. rst-class:: classref-item-separator
  758. ----
  759. .. _class_SpatialMaterial_property_ao_on_uv2:
  760. .. rst-class:: classref-property
  761. :ref:`bool<class_bool>` **ao_on_uv2**
  762. .. rst-class:: classref-property-setget
  763. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  764. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  765. If ``true``, use ``UV2`` coordinates to look up from the :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>`.
  766. .. rst-class:: classref-item-separator
  767. ----
  768. .. _class_SpatialMaterial_property_ao_texture:
  769. .. rst-class:: classref-property
  770. :ref:`Texture<class_Texture>` **ao_texture**
  771. .. rst-class:: classref-property-setget
  772. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  773. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  774. Texture that defines the amount of ambient occlusion for a given point on the object.
  775. .. rst-class:: classref-item-separator
  776. ----
  777. .. _class_SpatialMaterial_property_ao_texture_channel:
  778. .. rst-class:: classref-property
  779. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **ao_texture_channel**
  780. .. rst-class:: classref-property-setget
  781. - void **set_ao_texture_channel** **(** :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` value **)**
  782. - :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **get_ao_texture_channel** **(** **)**
  783. Specifies the channel of the :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>` in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
  784. .. rst-class:: classref-item-separator
  785. ----
  786. .. _class_SpatialMaterial_property_async_mode:
  787. .. rst-class:: classref-property
  788. :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` **async_mode** = ``0``
  789. .. rst-class:: classref-property-setget
  790. - void **set_async_mode** **(** :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` value **)**
  791. - :ref:`AsyncMode<enum_SpatialMaterial_AsyncMode>` **get_async_mode** **(** **)**
  792. If :ref:`ProjectSettings.rendering/gles3/shaders/shader_compilation_mode<class_ProjectSettings_property_rendering/gles3/shaders/shader_compilation_mode>` is ``Synchronous`` (with or without cache), this determines how this material must behave in regards to asynchronous shader compilation.
  793. \ :ref:`ASYNC_MODE_VISIBLE<class_SpatialMaterial_constant_ASYNC_MODE_VISIBLE>` is the default and the best for most cases.
  794. .. rst-class:: classref-item-separator
  795. ----
  796. .. _class_SpatialMaterial_property_clearcoat:
  797. .. rst-class:: classref-property
  798. :ref:`float<class_float>` **clearcoat**
  799. .. rst-class:: classref-property-setget
  800. - void **set_clearcoat** **(** :ref:`float<class_float>` value **)**
  801. - :ref:`float<class_float>` **get_clearcoat** **(** **)**
  802. Sets the strength of the clearcoat effect. Setting to ``0`` looks the same as disabling the clearcoat effect.
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_SpatialMaterial_property_clearcoat_enabled:
  806. .. rst-class:: classref-property
  807. :ref:`bool<class_bool>` **clearcoat_enabled** = ``false``
  808. .. rst-class:: classref-property-setget
  809. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  810. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  811. If ``true``, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough.
  812. \ **Note:** Clearcoat rendering is not visible if the material has :ref:`flags_unshaded<class_SpatialMaterial_property_flags_unshaded>` set to ``true``.
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_SpatialMaterial_property_clearcoat_gloss:
  816. .. rst-class:: classref-property
  817. :ref:`float<class_float>` **clearcoat_gloss**
  818. .. rst-class:: classref-property-setget
  819. - void **set_clearcoat_gloss** **(** :ref:`float<class_float>` value **)**
  820. - :ref:`float<class_float>` **get_clearcoat_gloss** **(** **)**
  821. Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.
  822. .. rst-class:: classref-item-separator
  823. ----
  824. .. _class_SpatialMaterial_property_clearcoat_texture:
  825. .. rst-class:: classref-property
  826. :ref:`Texture<class_Texture>` **clearcoat_texture**
  827. .. rst-class:: classref-property-setget
  828. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  829. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  830. Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel.
  831. .. rst-class:: classref-item-separator
  832. ----
  833. .. _class_SpatialMaterial_property_depth_deep_parallax:
  834. .. rst-class:: classref-property
  835. :ref:`bool<class_bool>` **depth_deep_parallax**
  836. .. rst-class:: classref-property-setget
  837. - void **set_depth_deep_parallax** **(** :ref:`bool<class_bool>` value **)**
  838. - :ref:`bool<class_bool>` **is_depth_deep_parallax_enabled** **(** **)**
  839. If ``true``, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_SpatialMaterial_property_depth_enabled:
  843. .. rst-class:: classref-property
  844. :ref:`bool<class_bool>` **depth_enabled** = ``false``
  845. .. rst-class:: classref-property-setget
  846. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  847. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  848. If ``true``, depth mapping is enabled (also called "parallax mapping" or "height mapping"). See also :ref:`normal_enabled<class_SpatialMaterial_property_normal_enabled>`.
  849. \ **Note:** Depth mapping is not supported if triplanar mapping is used on the same material. The value of :ref:`depth_enabled<class_SpatialMaterial_property_depth_enabled>` will be ignored if :ref:`uv1_triplanar<class_SpatialMaterial_property_uv1_triplanar>` is enabled.
  850. .. rst-class:: classref-item-separator
  851. ----
  852. .. _class_SpatialMaterial_property_depth_flip_binormal:
  853. .. rst-class:: classref-property
  854. :ref:`bool<class_bool>` **depth_flip_binormal**
  855. .. rst-class:: classref-property-setget
  856. - void **set_depth_deep_parallax_flip_binormal** **(** :ref:`bool<class_bool>` value **)**
  857. - :ref:`bool<class_bool>` **get_depth_deep_parallax_flip_binormal** **(** **)**
  858. If ``true``, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect.
  859. .. rst-class:: classref-item-separator
  860. ----
  861. .. _class_SpatialMaterial_property_depth_flip_tangent:
  862. .. rst-class:: classref-property
  863. :ref:`bool<class_bool>` **depth_flip_tangent**
  864. .. rst-class:: classref-property-setget
  865. - void **set_depth_deep_parallax_flip_tangent** **(** :ref:`bool<class_bool>` value **)**
  866. - :ref:`bool<class_bool>` **get_depth_deep_parallax_flip_tangent** **(** **)**
  867. If ``true``, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect.
  868. .. rst-class:: classref-item-separator
  869. ----
  870. .. _class_SpatialMaterial_property_depth_max_layers:
  871. .. rst-class:: classref-property
  872. :ref:`int<class_int>` **depth_max_layers**
  873. .. rst-class:: classref-property-setget
  874. - void **set_depth_deep_parallax_max_layers** **(** :ref:`int<class_int>` value **)**
  875. - :ref:`int<class_int>` **get_depth_deep_parallax_max_layers** **(** **)**
  876. Number of layers to use when using :ref:`depth_deep_parallax<class_SpatialMaterial_property_depth_deep_parallax>` and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
  877. .. rst-class:: classref-item-separator
  878. ----
  879. .. _class_SpatialMaterial_property_depth_min_layers:
  880. .. rst-class:: classref-property
  881. :ref:`int<class_int>` **depth_min_layers**
  882. .. rst-class:: classref-property-setget
  883. - void **set_depth_deep_parallax_min_layers** **(** :ref:`int<class_int>` value **)**
  884. - :ref:`int<class_int>` **get_depth_deep_parallax_min_layers** **(** **)**
  885. Number of layers to use when using :ref:`depth_deep_parallax<class_SpatialMaterial_property_depth_deep_parallax>` and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
  886. .. rst-class:: classref-item-separator
  887. ----
  888. .. _class_SpatialMaterial_property_depth_scale:
  889. .. rst-class:: classref-property
  890. :ref:`float<class_float>` **depth_scale**
  891. .. rst-class:: classref-property-setget
  892. - void **set_depth_scale** **(** :ref:`float<class_float>` value **)**
  893. - :ref:`float<class_float>` **get_depth_scale** **(** **)**
  894. Scales the depth offset effect. A higher number will create a larger depth.
  895. .. rst-class:: classref-item-separator
  896. ----
  897. .. _class_SpatialMaterial_property_depth_texture:
  898. .. rst-class:: classref-property
  899. :ref:`Texture<class_Texture>` **depth_texture**
  900. .. rst-class:: classref-property-setget
  901. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  902. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  903. Texture used to determine depth at a given pixel. Depth is always stored in the red channel.
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_SpatialMaterial_property_detail_albedo:
  907. .. rst-class:: classref-property
  908. :ref:`Texture<class_Texture>` **detail_albedo**
  909. .. rst-class:: classref-property-setget
  910. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  911. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  912. Texture that specifies the color of the detail overlay.
  913. .. rst-class:: classref-item-separator
  914. ----
  915. .. _class_SpatialMaterial_property_detail_blend_mode:
  916. .. rst-class:: classref-property
  917. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **detail_blend_mode**
  918. .. rst-class:: classref-property-setget
  919. - void **set_detail_blend_mode** **(** :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` value **)**
  920. - :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **get_detail_blend_mode** **(** **)**
  921. Specifies how the :ref:`detail_albedo<class_SpatialMaterial_property_detail_albedo>` should blend with the current ``ALBEDO``. See :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` for options.
  922. .. rst-class:: classref-item-separator
  923. ----
  924. .. _class_SpatialMaterial_property_detail_enabled:
  925. .. rst-class:: classref-property
  926. :ref:`bool<class_bool>` **detail_enabled** = ``false``
  927. .. rst-class:: classref-property-setget
  928. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  929. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  930. If ``true``, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on :ref:`detail_mask<class_SpatialMaterial_property_detail_mask>`. This can be used to add variation to objects, or to blend between two different albedo/normal textures.
  931. .. rst-class:: classref-item-separator
  932. ----
  933. .. _class_SpatialMaterial_property_detail_mask:
  934. .. rst-class:: classref-property
  935. :ref:`Texture<class_Texture>` **detail_mask**
  936. .. rst-class:: classref-property-setget
  937. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  938. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  939. Texture used to specify how the detail textures get blended with the base textures.
  940. .. rst-class:: classref-item-separator
  941. ----
  942. .. _class_SpatialMaterial_property_detail_normal:
  943. .. rst-class:: classref-property
  944. :ref:`Texture<class_Texture>` **detail_normal**
  945. .. rst-class:: classref-property-setget
  946. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  947. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  948. Texture that specifies the per-pixel normal of the detail overlay.
  949. \ **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates>`__ for a comparison of normal map coordinates expected by popular engines.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_SpatialMaterial_property_detail_uv_layer:
  953. .. rst-class:: classref-property
  954. :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` **detail_uv_layer**
  955. .. rst-class:: classref-property-setget
  956. - void **set_detail_uv** **(** :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` value **)**
  957. - :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` **get_detail_uv** **(** **)**
  958. Specifies whether to use ``UV`` or ``UV2`` for the detail layer. See :ref:`DetailUV<enum_SpatialMaterial_DetailUV>` for options.
  959. .. rst-class:: classref-item-separator
  960. ----
  961. .. _class_SpatialMaterial_property_distance_fade_max_distance:
  962. .. rst-class:: classref-property
  963. :ref:`float<class_float>` **distance_fade_max_distance**
  964. .. rst-class:: classref-property-setget
  965. - void **set_distance_fade_max_distance** **(** :ref:`float<class_float>` value **)**
  966. - :ref:`float<class_float>` **get_distance_fade_max_distance** **(** **)**
  967. Distance at which the object appears fully opaque.
  968. \ **Note:** If ``distance_fade_max_distance`` is less than ``distance_fade_min_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``.
  969. .. rst-class:: classref-item-separator
  970. ----
  971. .. _class_SpatialMaterial_property_distance_fade_min_distance:
  972. .. rst-class:: classref-property
  973. :ref:`float<class_float>` **distance_fade_min_distance**
  974. .. rst-class:: classref-property-setget
  975. - void **set_distance_fade_min_distance** **(** :ref:`float<class_float>` value **)**
  976. - :ref:`float<class_float>` **get_distance_fade_min_distance** **(** **)**
  977. Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
  978. \ **Note:** If ``distance_fade_min_distance`` is greater than ``distance_fade_max_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``.
  979. .. rst-class:: classref-item-separator
  980. ----
  981. .. _class_SpatialMaterial_property_distance_fade_mode:
  982. .. rst-class:: classref-property
  983. :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **distance_fade_mode** = ``0``
  984. .. rst-class:: classref-property-setget
  985. - void **set_distance_fade** **(** :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` value **)**
  986. - :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>` **get_distance_fade** **(** **)**
  987. Specifies which type of fade to use. Can be any of the :ref:`DistanceFadeMode<enum_SpatialMaterial_DistanceFadeMode>`\ s.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_SpatialMaterial_property_emission:
  991. .. rst-class:: classref-property
  992. :ref:`Color<class_Color>` **emission**
  993. .. rst-class:: classref-property-setget
  994. - void **set_emission** **(** :ref:`Color<class_Color>` value **)**
  995. - :ref:`Color<class_Color>` **get_emission** **(** **)**
  996. The emitted light's color. See :ref:`emission_enabled<class_SpatialMaterial_property_emission_enabled>`.
  997. .. rst-class:: classref-item-separator
  998. ----
  999. .. _class_SpatialMaterial_property_emission_enabled:
  1000. .. rst-class:: classref-property
  1001. :ref:`bool<class_bool>` **emission_enabled** = ``false``
  1002. .. rst-class:: classref-property-setget
  1003. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1004. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1005. If ``true``, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a :ref:`GIProbe<class_GIProbe>` or :ref:`BakedLightmap<class_BakedLightmap>` is used and this object is used in baked lighting.
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_SpatialMaterial_property_emission_energy:
  1009. .. rst-class:: classref-property
  1010. :ref:`float<class_float>` **emission_energy**
  1011. .. rst-class:: classref-property-setget
  1012. - void **set_emission_energy** **(** :ref:`float<class_float>` value **)**
  1013. - :ref:`float<class_float>` **get_emission_energy** **(** **)**
  1014. The emitted light's strength. See :ref:`emission_enabled<class_SpatialMaterial_property_emission_enabled>`.
  1015. .. rst-class:: classref-item-separator
  1016. ----
  1017. .. _class_SpatialMaterial_property_emission_on_uv2:
  1018. .. rst-class:: classref-property
  1019. :ref:`bool<class_bool>` **emission_on_uv2**
  1020. .. rst-class:: classref-property-setget
  1021. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1022. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1023. Use ``UV2`` to read from the :ref:`emission_texture<class_SpatialMaterial_property_emission_texture>`.
  1024. .. rst-class:: classref-item-separator
  1025. ----
  1026. .. _class_SpatialMaterial_property_emission_operator:
  1027. .. rst-class:: classref-property
  1028. :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` **emission_operator**
  1029. .. rst-class:: classref-property-setget
  1030. - void **set_emission_operator** **(** :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` value **)**
  1031. - :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` **get_emission_operator** **(** **)**
  1032. Sets how :ref:`emission<class_SpatialMaterial_property_emission>` interacts with :ref:`emission_texture<class_SpatialMaterial_property_emission_texture>`. Can either add or multiply. See :ref:`EmissionOperator<enum_SpatialMaterial_EmissionOperator>` for options.
  1033. .. rst-class:: classref-item-separator
  1034. ----
  1035. .. _class_SpatialMaterial_property_emission_texture:
  1036. .. rst-class:: classref-property
  1037. :ref:`Texture<class_Texture>` **emission_texture**
  1038. .. rst-class:: classref-property-setget
  1039. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1040. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1041. Texture that specifies how much surface emits light at a given point.
  1042. .. rst-class:: classref-item-separator
  1043. ----
  1044. .. _class_SpatialMaterial_property_flags_albedo_tex_force_srgb:
  1045. .. rst-class:: classref-property
  1046. :ref:`bool<class_bool>` **flags_albedo_tex_force_srgb** = ``false``
  1047. .. rst-class:: classref-property-setget
  1048. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1049. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1050. Forces a conversion of the :ref:`albedo_texture<class_SpatialMaterial_property_albedo_texture>` from sRGB space to linear space.
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_SpatialMaterial_property_flags_albedo_tex_msdf:
  1054. .. rst-class:: classref-property
  1055. :ref:`bool<class_bool>` **flags_albedo_tex_msdf** = ``false``
  1056. .. rst-class:: classref-property-setget
  1057. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1058. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1059. Enables signed distance field rendering shader.
  1060. .. rst-class:: classref-item-separator
  1061. ----
  1062. .. _class_SpatialMaterial_property_flags_disable_ambient_light:
  1063. .. rst-class:: classref-property
  1064. :ref:`bool<class_bool>` **flags_disable_ambient_light** = ``false``
  1065. .. rst-class:: classref-property-setget
  1066. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1067. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1068. If ``true``, the object receives no ambient light.
  1069. .. rst-class:: classref-item-separator
  1070. ----
  1071. .. _class_SpatialMaterial_property_flags_do_not_receive_shadows:
  1072. .. rst-class:: classref-property
  1073. :ref:`bool<class_bool>` **flags_do_not_receive_shadows** = ``false``
  1074. .. rst-class:: classref-property-setget
  1075. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1076. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1077. If ``true``, the object receives no shadow that would otherwise be cast onto it.
  1078. .. rst-class:: classref-item-separator
  1079. ----
  1080. .. _class_SpatialMaterial_property_flags_ensure_correct_normals:
  1081. .. rst-class:: classref-property
  1082. :ref:`bool<class_bool>` **flags_ensure_correct_normals** = ``false``
  1083. .. rst-class:: classref-property-setget
  1084. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1085. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1086. If ``true``, the shader will compute extra operations to make sure the normal stays correct when using a non-uniform scale. Only enable if using non-uniform scaling.
  1087. .. rst-class:: classref-item-separator
  1088. ----
  1089. .. _class_SpatialMaterial_property_flags_fixed_size:
  1090. .. rst-class:: classref-property
  1091. :ref:`bool<class_bool>` **flags_fixed_size** = ``false``
  1092. .. rst-class:: classref-property-setget
  1093. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1094. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1095. If ``true``, the object is rendered at the same size regardless of distance.
  1096. .. rst-class:: classref-item-separator
  1097. ----
  1098. .. _class_SpatialMaterial_property_flags_no_depth_test:
  1099. .. rst-class:: classref-property
  1100. :ref:`bool<class_bool>` **flags_no_depth_test** = ``false``
  1101. .. rst-class:: classref-property-setget
  1102. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1103. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1104. If ``true``, depth testing is disabled and the object will be drawn in render order.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_SpatialMaterial_property_flags_transparent:
  1108. .. rst-class:: classref-property
  1109. :ref:`bool<class_bool>` **flags_transparent** = ``false``
  1110. .. rst-class:: classref-property-setget
  1111. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1112. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1113. If ``true``, transparency is enabled on the body. See also :ref:`params_blend_mode<class_SpatialMaterial_property_params_blend_mode>`.
  1114. .. rst-class:: classref-item-separator
  1115. ----
  1116. .. _class_SpatialMaterial_property_flags_unshaded:
  1117. .. rst-class:: classref-property
  1118. :ref:`bool<class_bool>` **flags_unshaded** = ``false``
  1119. .. rst-class:: classref-property-setget
  1120. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1121. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1122. If ``true``, the object is unaffected by lighting.
  1123. .. rst-class:: classref-item-separator
  1124. ----
  1125. .. _class_SpatialMaterial_property_flags_use_point_size:
  1126. .. rst-class:: classref-property
  1127. :ref:`bool<class_bool>` **flags_use_point_size** = ``false``
  1128. .. rst-class:: classref-property-setget
  1129. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1130. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1131. If ``true``, render point size can be changed.
  1132. \ **Note:** This is only effective for objects whose geometry is point-based rather than triangle-based. See also :ref:`params_point_size<class_SpatialMaterial_property_params_point_size>`.
  1133. .. rst-class:: classref-item-separator
  1134. ----
  1135. .. _class_SpatialMaterial_property_flags_use_shadow_to_opacity:
  1136. .. rst-class:: classref-property
  1137. :ref:`bool<class_bool>` **flags_use_shadow_to_opacity** = ``false``
  1138. .. rst-class:: classref-property-setget
  1139. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1140. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1141. If ``true``, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.
  1142. .. rst-class:: classref-item-separator
  1143. ----
  1144. .. _class_SpatialMaterial_property_flags_vertex_lighting:
  1145. .. rst-class:: classref-property
  1146. :ref:`bool<class_bool>` **flags_vertex_lighting** = ``false``
  1147. .. rst-class:: classref-property-setget
  1148. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1149. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1150. If ``true``, lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices, especially for meshes with a lower polygon count. The downside is that shading becomes much less accurate, with visible linear interpolation between vertices that are joined together. This can be compensated by ensuring meshes have a sufficient level of subdivision (but not too much, to avoid reducing performance). Some material features are also not supported when vertex shading is enabled.
  1151. See also :ref:`ProjectSettings.rendering/quality/shading/force_vertex_shading<class_ProjectSettings_property_rendering/quality/shading/force_vertex_shading>` which can globally enable vertex shading on all materials.
  1152. \ **Note:** By default, vertex shading is enforced on mobile platforms by :ref:`ProjectSettings.rendering/quality/shading/force_vertex_shading<class_ProjectSettings_property_rendering/quality/shading/force_vertex_shading>`'s ``mobile`` override.
  1153. \ **Note:** :ref:`flags_vertex_lighting<class_SpatialMaterial_property_flags_vertex_lighting>` has no effect if :ref:`flags_unshaded<class_SpatialMaterial_property_flags_unshaded>` is ``true``.
  1154. .. rst-class:: classref-item-separator
  1155. ----
  1156. .. _class_SpatialMaterial_property_flags_world_triplanar:
  1157. .. rst-class:: classref-property
  1158. :ref:`bool<class_bool>` **flags_world_triplanar** = ``false``
  1159. .. rst-class:: classref-property-setget
  1160. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1161. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1162. If ``true``, triplanar mapping is calculated in world space rather than object local space. See also :ref:`uv1_triplanar<class_SpatialMaterial_property_uv1_triplanar>`.
  1163. .. rst-class:: classref-item-separator
  1164. ----
  1165. .. _class_SpatialMaterial_property_metallic:
  1166. .. rst-class:: classref-property
  1167. :ref:`float<class_float>` **metallic** = ``0.0``
  1168. .. rst-class:: classref-property-setget
  1169. - void **set_metallic** **(** :ref:`float<class_float>` value **)**
  1170. - :ref:`float<class_float>` **get_metallic** **(** **)**
  1171. A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between ``0`` and ``1`` should only be used for blending between metal and non-metal sections. To alter the amount of reflection use :ref:`roughness<class_SpatialMaterial_property_roughness>`.
  1172. .. rst-class:: classref-item-separator
  1173. ----
  1174. .. _class_SpatialMaterial_property_metallic_specular:
  1175. .. rst-class:: classref-property
  1176. :ref:`float<class_float>` **metallic_specular** = ``0.5``
  1177. .. rst-class:: classref-property-setget
  1178. - void **set_specular** **(** :ref:`float<class_float>` value **)**
  1179. - :ref:`float<class_float>` **get_specular** **(** **)**
  1180. Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.
  1181. \ **Note:** Unlike :ref:`metallic<class_SpatialMaterial_property_metallic>`, this is not energy-conserving, so it should be left at ``0.5`` in most cases. See also :ref:`roughness<class_SpatialMaterial_property_roughness>`.
  1182. .. rst-class:: classref-item-separator
  1183. ----
  1184. .. _class_SpatialMaterial_property_metallic_texture:
  1185. .. rst-class:: classref-property
  1186. :ref:`Texture<class_Texture>` **metallic_texture**
  1187. .. rst-class:: classref-property-setget
  1188. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1189. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1190. Texture used to specify metallic for an object. This is multiplied by :ref:`metallic<class_SpatialMaterial_property_metallic>`.
  1191. .. rst-class:: classref-item-separator
  1192. ----
  1193. .. _class_SpatialMaterial_property_metallic_texture_channel:
  1194. .. rst-class:: classref-property
  1195. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **metallic_texture_channel** = ``0``
  1196. .. rst-class:: classref-property-setget
  1197. - void **set_metallic_texture_channel** **(** :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` value **)**
  1198. - :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **get_metallic_texture_channel** **(** **)**
  1199. Specifies the channel of the :ref:`metallic_texture<class_SpatialMaterial_property_metallic_texture>` in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
  1200. .. rst-class:: classref-item-separator
  1201. ----
  1202. .. _class_SpatialMaterial_property_normal_enabled:
  1203. .. rst-class:: classref-property
  1204. :ref:`bool<class_bool>` **normal_enabled** = ``false``
  1205. .. rst-class:: classref-property-setget
  1206. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1207. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1208. If ``true``, normal mapping is enabled.
  1209. .. rst-class:: classref-item-separator
  1210. ----
  1211. .. _class_SpatialMaterial_property_normal_scale:
  1212. .. rst-class:: classref-property
  1213. :ref:`float<class_float>` **normal_scale**
  1214. .. rst-class:: classref-property-setget
  1215. - void **set_normal_scale** **(** :ref:`float<class_float>` value **)**
  1216. - :ref:`float<class_float>` **get_normal_scale** **(** **)**
  1217. The strength of the normal map's effect.
  1218. .. rst-class:: classref-item-separator
  1219. ----
  1220. .. _class_SpatialMaterial_property_normal_texture:
  1221. .. rst-class:: classref-property
  1222. :ref:`Texture<class_Texture>` **normal_texture**
  1223. .. rst-class:: classref-property-setget
  1224. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1225. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1226. Texture used to specify the normal at a given pixel. The ``normal_texture`` only uses the red and green channels; the blue and alpha channels are ignored. The normal read from ``normal_texture`` is oriented around the surface normal provided by the :ref:`Mesh<class_Mesh>`.
  1227. \ **Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with :ref:`SurfaceTool<class_SurfaceTool>`, you can use :ref:`SurfaceTool.generate_normals<class_SurfaceTool_method_generate_normals>` and :ref:`SurfaceTool.generate_tangents<class_SurfaceTool_method_generate_tangents>` to automatically generate normals and tangents respectively.
  1228. \ **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page <http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates>`__ for a comparison of normal map coordinates expected by popular engines.
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_SpatialMaterial_property_params_alpha_scissor_threshold:
  1232. .. rst-class:: classref-property
  1233. :ref:`float<class_float>` **params_alpha_scissor_threshold**
  1234. .. rst-class:: classref-property-setget
  1235. - void **set_alpha_scissor_threshold** **(** :ref:`float<class_float>` value **)**
  1236. - :ref:`float<class_float>` **get_alpha_scissor_threshold** **(** **)**
  1237. Threshold at which the alpha scissor will discard values.
  1238. .. rst-class:: classref-item-separator
  1239. ----
  1240. .. _class_SpatialMaterial_property_params_billboard_keep_scale:
  1241. .. rst-class:: classref-property
  1242. :ref:`bool<class_bool>` **params_billboard_keep_scale** = ``false``
  1243. .. rst-class:: classref-property-setget
  1244. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1245. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1246. If ``true``, the shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>` is :ref:`BILLBOARD_ENABLED<class_SpatialMaterial_constant_BILLBOARD_ENABLED>`.
  1247. .. rst-class:: classref-item-separator
  1248. ----
  1249. .. _class_SpatialMaterial_property_params_billboard_mode:
  1250. .. rst-class:: classref-property
  1251. :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **params_billboard_mode** = ``0``
  1252. .. rst-class:: classref-property-setget
  1253. - void **set_billboard_mode** **(** :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` value **)**
  1254. - :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **get_billboard_mode** **(** **)**
  1255. Controls how the object faces the camera. See :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>`.
  1256. \ **Note:** Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See `GitHub issue #41567 <https://github.com/godotengine/godot/issues/41567>`__ for details.
  1257. .. rst-class:: classref-item-separator
  1258. ----
  1259. .. _class_SpatialMaterial_property_params_blend_mode:
  1260. .. rst-class:: classref-property
  1261. :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **params_blend_mode** = ``0``
  1262. .. rst-class:: classref-property-setget
  1263. - void **set_blend_mode** **(** :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` value **)**
  1264. - :ref:`BlendMode<enum_SpatialMaterial_BlendMode>` **get_blend_mode** **(** **)**
  1265. The material's blend mode.
  1266. \ **Note:** Values other than ``Mix`` force the object into the transparent pipeline. See :ref:`BlendMode<enum_SpatialMaterial_BlendMode>`.
  1267. .. rst-class:: classref-item-separator
  1268. ----
  1269. .. _class_SpatialMaterial_property_params_cull_mode:
  1270. .. rst-class:: classref-property
  1271. :ref:`CullMode<enum_SpatialMaterial_CullMode>` **params_cull_mode** = ``0``
  1272. .. rst-class:: classref-property-setget
  1273. - void **set_cull_mode** **(** :ref:`CullMode<enum_SpatialMaterial_CullMode>` value **)**
  1274. - :ref:`CullMode<enum_SpatialMaterial_CullMode>` **get_cull_mode** **(** **)**
  1275. Which side of the object is not drawn when backfaces are rendered. See :ref:`CullMode<enum_SpatialMaterial_CullMode>`.
  1276. .. rst-class:: classref-item-separator
  1277. ----
  1278. .. _class_SpatialMaterial_property_params_depth_draw_mode:
  1279. .. rst-class:: classref-property
  1280. :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **params_depth_draw_mode** = ``0``
  1281. .. rst-class:: classref-property-setget
  1282. - void **set_depth_draw_mode** **(** :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` value **)**
  1283. - :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>` **get_depth_draw_mode** **(** **)**
  1284. Determines when depth rendering takes place. See :ref:`DepthDrawMode<enum_SpatialMaterial_DepthDrawMode>`. See also :ref:`flags_transparent<class_SpatialMaterial_property_flags_transparent>`.
  1285. .. rst-class:: classref-item-separator
  1286. ----
  1287. .. _class_SpatialMaterial_property_params_diffuse_mode:
  1288. .. rst-class:: classref-property
  1289. :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **params_diffuse_mode** = ``0``
  1290. .. rst-class:: classref-property-setget
  1291. - void **set_diffuse_mode** **(** :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` value **)**
  1292. - :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>` **get_diffuse_mode** **(** **)**
  1293. The algorithm used for diffuse light scattering. See :ref:`DiffuseMode<enum_SpatialMaterial_DiffuseMode>`.
  1294. .. rst-class:: classref-item-separator
  1295. ----
  1296. .. _class_SpatialMaterial_property_params_grow:
  1297. .. rst-class:: classref-property
  1298. :ref:`bool<class_bool>` **params_grow** = ``false``
  1299. .. rst-class:: classref-property-setget
  1300. - void **set_grow_enabled** **(** :ref:`bool<class_bool>` value **)**
  1301. - :ref:`bool<class_bool>` **is_grow_enabled** **(** **)**
  1302. If ``true``, enables the vertex grow setting. See :ref:`params_grow_amount<class_SpatialMaterial_property_params_grow_amount>`.
  1303. .. rst-class:: classref-item-separator
  1304. ----
  1305. .. _class_SpatialMaterial_property_params_grow_amount:
  1306. .. rst-class:: classref-property
  1307. :ref:`float<class_float>` **params_grow_amount**
  1308. .. rst-class:: classref-property-setget
  1309. - void **set_grow** **(** :ref:`float<class_float>` value **)**
  1310. - :ref:`float<class_float>` **get_grow** **(** **)**
  1311. Grows object vertices in the direction of their normals.
  1312. .. rst-class:: classref-item-separator
  1313. ----
  1314. .. _class_SpatialMaterial_property_params_line_width:
  1315. .. rst-class:: classref-property
  1316. :ref:`float<class_float>` **params_line_width** = ``1.0``
  1317. .. rst-class:: classref-property-setget
  1318. - void **set_line_width** **(** :ref:`float<class_float>` value **)**
  1319. - :ref:`float<class_float>` **get_line_width** **(** **)**
  1320. Currently unimplemented in Godot.
  1321. .. rst-class:: classref-item-separator
  1322. ----
  1323. .. _class_SpatialMaterial_property_params_point_size:
  1324. .. rst-class:: classref-property
  1325. :ref:`float<class_float>` **params_point_size** = ``1.0``
  1326. .. rst-class:: classref-property-setget
  1327. - void **set_point_size** **(** :ref:`float<class_float>` value **)**
  1328. - :ref:`float<class_float>` **get_point_size** **(** **)**
  1329. The point size in pixels. See :ref:`flags_use_point_size<class_SpatialMaterial_property_flags_use_point_size>`.
  1330. .. rst-class:: classref-item-separator
  1331. ----
  1332. .. _class_SpatialMaterial_property_params_specular_mode:
  1333. .. rst-class:: classref-property
  1334. :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **params_specular_mode** = ``0``
  1335. .. rst-class:: classref-property-setget
  1336. - void **set_specular_mode** **(** :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` value **)**
  1337. - :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>` **get_specular_mode** **(** **)**
  1338. The method for rendering the specular blob. See :ref:`SpecularMode<enum_SpatialMaterial_SpecularMode>`.
  1339. .. rst-class:: classref-item-separator
  1340. ----
  1341. .. _class_SpatialMaterial_property_params_use_alpha_scissor:
  1342. .. rst-class:: classref-property
  1343. :ref:`bool<class_bool>` **params_use_alpha_scissor** = ``false``
  1344. .. rst-class:: classref-property-setget
  1345. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1346. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1347. If ``true``, the shader will discard all pixels that have an alpha value less than :ref:`params_alpha_scissor_threshold<class_SpatialMaterial_property_params_alpha_scissor_threshold>`.
  1348. .. rst-class:: classref-item-separator
  1349. ----
  1350. .. _class_SpatialMaterial_property_particles_anim_h_frames:
  1351. .. rst-class:: classref-property
  1352. :ref:`int<class_int>` **particles_anim_h_frames**
  1353. .. rst-class:: classref-property-setget
  1354. - void **set_particles_anim_h_frames** **(** :ref:`int<class_int>` value **)**
  1355. - :ref:`int<class_int>` **get_particles_anim_h_frames** **(** **)**
  1356. The number of horizontal frames in the particle sprite sheet. Only enabled when using :ref:`BILLBOARD_PARTICLES<class_SpatialMaterial_constant_BILLBOARD_PARTICLES>`. See :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>`.
  1357. .. rst-class:: classref-item-separator
  1358. ----
  1359. .. _class_SpatialMaterial_property_particles_anim_loop:
  1360. .. rst-class:: classref-property
  1361. :ref:`bool<class_bool>` **particles_anim_loop**
  1362. .. rst-class:: classref-property-setget
  1363. - void **set_particles_anim_loop** **(** :ref:`bool<class_bool>` value **)**
  1364. - :ref:`bool<class_bool>` **get_particles_anim_loop** **(** **)**
  1365. If ``true``, particle animations are looped. Only enabled when using :ref:`BILLBOARD_PARTICLES<class_SpatialMaterial_constant_BILLBOARD_PARTICLES>`. See :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>`.
  1366. .. rst-class:: classref-item-separator
  1367. ----
  1368. .. _class_SpatialMaterial_property_particles_anim_v_frames:
  1369. .. rst-class:: classref-property
  1370. :ref:`int<class_int>` **particles_anim_v_frames**
  1371. .. rst-class:: classref-property-setget
  1372. - void **set_particles_anim_v_frames** **(** :ref:`int<class_int>` value **)**
  1373. - :ref:`int<class_int>` **get_particles_anim_v_frames** **(** **)**
  1374. The number of vertical frames in the particle sprite sheet. Only enabled when using :ref:`BILLBOARD_PARTICLES<class_SpatialMaterial_constant_BILLBOARD_PARTICLES>`. See :ref:`params_billboard_mode<class_SpatialMaterial_property_params_billboard_mode>`.
  1375. .. rst-class:: classref-item-separator
  1376. ----
  1377. .. _class_SpatialMaterial_property_proximity_fade_distance:
  1378. .. rst-class:: classref-property
  1379. :ref:`float<class_float>` **proximity_fade_distance**
  1380. .. rst-class:: classref-property-setget
  1381. - void **set_proximity_fade_distance** **(** :ref:`float<class_float>` value **)**
  1382. - :ref:`float<class_float>` **get_proximity_fade_distance** **(** **)**
  1383. Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
  1384. .. rst-class:: classref-item-separator
  1385. ----
  1386. .. _class_SpatialMaterial_property_proximity_fade_enable:
  1387. .. rst-class:: classref-property
  1388. :ref:`bool<class_bool>` **proximity_fade_enable** = ``false``
  1389. .. rst-class:: classref-property-setget
  1390. - void **set_proximity_fade** **(** :ref:`bool<class_bool>` value **)**
  1391. - :ref:`bool<class_bool>` **is_proximity_fade_enabled** **(** **)**
  1392. If ``true``, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
  1393. .. rst-class:: classref-item-separator
  1394. ----
  1395. .. _class_SpatialMaterial_property_refraction_enabled:
  1396. .. rst-class:: classref-property
  1397. :ref:`bool<class_bool>` **refraction_enabled** = ``false``
  1398. .. rst-class:: classref-property-setget
  1399. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1400. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1401. If ``true``, the refraction effect is enabled. Refraction distorts transparency based on light from behind the object. When using the GLES3 backend, the material's roughness value will affect the blurriness of the refraction. Higher roughness values will make the refraction look blurrier.
  1402. .. rst-class:: classref-item-separator
  1403. ----
  1404. .. _class_SpatialMaterial_property_refraction_scale:
  1405. .. rst-class:: classref-property
  1406. :ref:`float<class_float>` **refraction_scale**
  1407. .. rst-class:: classref-property-setget
  1408. - void **set_refraction** **(** :ref:`float<class_float>` value **)**
  1409. - :ref:`float<class_float>` **get_refraction** **(** **)**
  1410. The strength of the refraction effect. Higher values result in a more distorted appearance for the refraction.
  1411. .. rst-class:: classref-item-separator
  1412. ----
  1413. .. _class_SpatialMaterial_property_refraction_texture:
  1414. .. rst-class:: classref-property
  1415. :ref:`Texture<class_Texture>` **refraction_texture**
  1416. .. rst-class:: classref-property-setget
  1417. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1418. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1419. Texture that controls the strength of the refraction per-pixel. Multiplied by :ref:`refraction_scale<class_SpatialMaterial_property_refraction_scale>`.
  1420. .. rst-class:: classref-item-separator
  1421. ----
  1422. .. _class_SpatialMaterial_property_refraction_texture_channel:
  1423. .. rst-class:: classref-property
  1424. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **refraction_texture_channel**
  1425. .. rst-class:: classref-property-setget
  1426. - void **set_refraction_texture_channel** **(** :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` value **)**
  1427. - :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **get_refraction_texture_channel** **(** **)**
  1428. Specifies the channel of the :ref:`refraction_texture<class_SpatialMaterial_property_refraction_texture>` in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
  1429. .. rst-class:: classref-item-separator
  1430. ----
  1431. .. _class_SpatialMaterial_property_rim:
  1432. .. rst-class:: classref-property
  1433. :ref:`float<class_float>` **rim**
  1434. .. rst-class:: classref-property-setget
  1435. - void **set_rim** **(** :ref:`float<class_float>` value **)**
  1436. - :ref:`float<class_float>` **get_rim** **(** **)**
  1437. Sets the strength of the rim lighting effect.
  1438. .. rst-class:: classref-item-separator
  1439. ----
  1440. .. _class_SpatialMaterial_property_rim_enabled:
  1441. .. rst-class:: classref-property
  1442. :ref:`bool<class_bool>` **rim_enabled** = ``false``
  1443. .. rst-class:: classref-property-setget
  1444. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1445. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1446. If ``true``, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.
  1447. \ **Note:** Rim lighting is not visible if the material has :ref:`flags_unshaded<class_SpatialMaterial_property_flags_unshaded>` set to ``true``.
  1448. .. rst-class:: classref-item-separator
  1449. ----
  1450. .. _class_SpatialMaterial_property_rim_texture:
  1451. .. rst-class:: classref-property
  1452. :ref:`Texture<class_Texture>` **rim_texture**
  1453. .. rst-class:: classref-property-setget
  1454. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1455. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1456. Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by :ref:`rim<class_SpatialMaterial_property_rim>`.
  1457. .. rst-class:: classref-item-separator
  1458. ----
  1459. .. _class_SpatialMaterial_property_rim_tint:
  1460. .. rst-class:: classref-property
  1461. :ref:`float<class_float>` **rim_tint**
  1462. .. rst-class:: classref-property-setget
  1463. - void **set_rim_tint** **(** :ref:`float<class_float>` value **)**
  1464. - :ref:`float<class_float>` **get_rim_tint** **(** **)**
  1465. The amount of to blend light and albedo color when rendering rim effect. If ``0`` the light color is used, while ``1`` means albedo color is used. An intermediate value generally works best.
  1466. .. rst-class:: classref-item-separator
  1467. ----
  1468. .. _class_SpatialMaterial_property_roughness:
  1469. .. rst-class:: classref-property
  1470. :ref:`float<class_float>` **roughness** = ``1.0``
  1471. .. rst-class:: classref-property-setget
  1472. - void **set_roughness** **(** :ref:`float<class_float>` value **)**
  1473. - :ref:`float<class_float>` **get_roughness** **(** **)**
  1474. Surface reflection. A value of ``0`` represents a perfect mirror while a value of ``1`` completely blurs the reflection. See also :ref:`metallic<class_SpatialMaterial_property_metallic>`.
  1475. .. rst-class:: classref-item-separator
  1476. ----
  1477. .. _class_SpatialMaterial_property_roughness_texture:
  1478. .. rst-class:: classref-property
  1479. :ref:`Texture<class_Texture>` **roughness_texture**
  1480. .. rst-class:: classref-property-setget
  1481. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1482. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1483. Texture used to control the roughness per-pixel. Multiplied by :ref:`roughness<class_SpatialMaterial_property_roughness>`.
  1484. .. rst-class:: classref-item-separator
  1485. ----
  1486. .. _class_SpatialMaterial_property_roughness_texture_channel:
  1487. .. rst-class:: classref-property
  1488. :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **roughness_texture_channel** = ``0``
  1489. .. rst-class:: classref-property-setget
  1490. - void **set_roughness_texture_channel** **(** :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` value **)**
  1491. - :ref:`TextureChannel<enum_SpatialMaterial_TextureChannel>` **get_roughness_texture_channel** **(** **)**
  1492. Specifies the channel of the :ref:`ao_texture<class_SpatialMaterial_property_ao_texture>` in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
  1493. .. rst-class:: classref-item-separator
  1494. ----
  1495. .. _class_SpatialMaterial_property_subsurf_scatter_enabled:
  1496. .. rst-class:: classref-property
  1497. :ref:`bool<class_bool>` **subsurf_scatter_enabled** = ``false``
  1498. .. rst-class:: classref-property-setget
  1499. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1500. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1501. If ``true``, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges.
  1502. .. rst-class:: classref-item-separator
  1503. ----
  1504. .. _class_SpatialMaterial_property_subsurf_scatter_strength:
  1505. .. rst-class:: classref-property
  1506. :ref:`float<class_float>` **subsurf_scatter_strength**
  1507. .. rst-class:: classref-property-setget
  1508. - void **set_subsurface_scattering_strength** **(** :ref:`float<class_float>` value **)**
  1509. - :ref:`float<class_float>` **get_subsurface_scattering_strength** **(** **)**
  1510. The strength of the subsurface scattering effect.
  1511. .. rst-class:: classref-item-separator
  1512. ----
  1513. .. _class_SpatialMaterial_property_subsurf_scatter_texture:
  1514. .. rst-class:: classref-property
  1515. :ref:`Texture<class_Texture>` **subsurf_scatter_texture**
  1516. .. rst-class:: classref-property-setget
  1517. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1518. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1519. Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by :ref:`subsurf_scatter_strength<class_SpatialMaterial_property_subsurf_scatter_strength>`.
  1520. .. rst-class:: classref-item-separator
  1521. ----
  1522. .. _class_SpatialMaterial_property_transmission:
  1523. .. rst-class:: classref-property
  1524. :ref:`Color<class_Color>` **transmission**
  1525. .. rst-class:: classref-property-setget
  1526. - void **set_transmission** **(** :ref:`Color<class_Color>` value **)**
  1527. - :ref:`Color<class_Color>` **get_transmission** **(** **)**
  1528. The color used by the transmission effect. Represents the light passing through an object.
  1529. .. rst-class:: classref-item-separator
  1530. ----
  1531. .. _class_SpatialMaterial_property_transmission_enabled:
  1532. .. rst-class:: classref-property
  1533. :ref:`bool<class_bool>` **transmission_enabled** = ``false``
  1534. .. rst-class:: classref-property-setget
  1535. - void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1536. - :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1537. If ``true``, the transmission effect is enabled.
  1538. .. rst-class:: classref-item-separator
  1539. ----
  1540. .. _class_SpatialMaterial_property_transmission_texture:
  1541. .. rst-class:: classref-property
  1542. :ref:`Texture<class_Texture>` **transmission_texture**
  1543. .. rst-class:: classref-property-setget
  1544. - void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1545. - :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1546. Texture used to control the transmission effect per-pixel. Added to :ref:`transmission<class_SpatialMaterial_property_transmission>`.
  1547. .. rst-class:: classref-item-separator
  1548. ----
  1549. .. _class_SpatialMaterial_property_uv1_offset:
  1550. .. rst-class:: classref-property
  1551. :ref:`Vector3<class_Vector3>` **uv1_offset** = ``Vector3( 0, 0, 0 )``
  1552. .. rst-class:: classref-property-setget
  1553. - void **set_uv1_offset** **(** :ref:`Vector3<class_Vector3>` value **)**
  1554. - :ref:`Vector3<class_Vector3>` **get_uv1_offset** **(** **)**
  1555. How much to offset the ``UV`` coordinates. This amount will be added to ``UV`` in the vertex function. This can be used to offset a texture.
  1556. .. rst-class:: classref-item-separator
  1557. ----
  1558. .. _class_SpatialMaterial_property_uv1_scale:
  1559. .. rst-class:: classref-property
  1560. :ref:`Vector3<class_Vector3>` **uv1_scale** = ``Vector3( 1, 1, 1 )``
  1561. .. rst-class:: classref-property-setget
  1562. - void **set_uv1_scale** **(** :ref:`Vector3<class_Vector3>` value **)**
  1563. - :ref:`Vector3<class_Vector3>` **get_uv1_scale** **(** **)**
  1564. How much to scale the ``UV`` coordinates. This is multiplied by ``UV`` in the vertex function.
  1565. .. rst-class:: classref-item-separator
  1566. ----
  1567. .. _class_SpatialMaterial_property_uv1_triplanar:
  1568. .. rst-class:: classref-property
  1569. :ref:`bool<class_bool>` **uv1_triplanar** = ``false``
  1570. .. rst-class:: classref-property-setget
  1571. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1572. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1573. If ``true``, instead of using ``UV`` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.
  1574. .. rst-class:: classref-item-separator
  1575. ----
  1576. .. _class_SpatialMaterial_property_uv1_triplanar_sharpness:
  1577. .. rst-class:: classref-property
  1578. :ref:`float<class_float>` **uv1_triplanar_sharpness** = ``1.0``
  1579. .. rst-class:: classref-property-setget
  1580. - void **set_uv1_triplanar_blend_sharpness** **(** :ref:`float<class_float>` value **)**
  1581. - :ref:`float<class_float>` **get_uv1_triplanar_blend_sharpness** **(** **)**
  1582. A lower number blends the texture more softly while a higher number blends the texture more sharply.
  1583. .. rst-class:: classref-item-separator
  1584. ----
  1585. .. _class_SpatialMaterial_property_uv2_offset:
  1586. .. rst-class:: classref-property
  1587. :ref:`Vector3<class_Vector3>` **uv2_offset** = ``Vector3( 0, 0, 0 )``
  1588. .. rst-class:: classref-property-setget
  1589. - void **set_uv2_offset** **(** :ref:`Vector3<class_Vector3>` value **)**
  1590. - :ref:`Vector3<class_Vector3>` **get_uv2_offset** **(** **)**
  1591. How much to offset the ``UV2`` coordinates. This amount will be added to ``UV2`` in the vertex function. This can be used to offset a texture.
  1592. .. rst-class:: classref-item-separator
  1593. ----
  1594. .. _class_SpatialMaterial_property_uv2_scale:
  1595. .. rst-class:: classref-property
  1596. :ref:`Vector3<class_Vector3>` **uv2_scale** = ``Vector3( 1, 1, 1 )``
  1597. .. rst-class:: classref-property-setget
  1598. - void **set_uv2_scale** **(** :ref:`Vector3<class_Vector3>` value **)**
  1599. - :ref:`Vector3<class_Vector3>` **get_uv2_scale** **(** **)**
  1600. How much to scale the ``UV2`` coordinates. This is multiplied by ``UV2`` in the vertex function.
  1601. .. rst-class:: classref-item-separator
  1602. ----
  1603. .. _class_SpatialMaterial_property_uv2_triplanar:
  1604. .. rst-class:: classref-property
  1605. :ref:`bool<class_bool>` **uv2_triplanar** = ``false``
  1606. .. rst-class:: classref-property-setget
  1607. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1608. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1609. If ``true``, instead of using ``UV2`` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.
  1610. .. rst-class:: classref-item-separator
  1611. ----
  1612. .. _class_SpatialMaterial_property_uv2_triplanar_sharpness:
  1613. .. rst-class:: classref-property
  1614. :ref:`float<class_float>` **uv2_triplanar_sharpness** = ``1.0``
  1615. .. rst-class:: classref-property-setget
  1616. - void **set_uv2_triplanar_blend_sharpness** **(** :ref:`float<class_float>` value **)**
  1617. - :ref:`float<class_float>` **get_uv2_triplanar_blend_sharpness** **(** **)**
  1618. A lower number blends the texture more softly while a higher number blends the texture more sharply.
  1619. .. rst-class:: classref-item-separator
  1620. ----
  1621. .. _class_SpatialMaterial_property_vertex_color_is_srgb:
  1622. .. rst-class:: classref-property
  1623. :ref:`bool<class_bool>` **vertex_color_is_srgb** = ``false``
  1624. .. rst-class:: classref-property-setget
  1625. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1626. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1627. If ``true``, the model's vertex colors are processed as sRGB mode.
  1628. .. rst-class:: classref-item-separator
  1629. ----
  1630. .. _class_SpatialMaterial_property_vertex_color_use_as_albedo:
  1631. .. rst-class:: classref-property
  1632. :ref:`bool<class_bool>` **vertex_color_use_as_albedo** = ``false``
  1633. .. rst-class:: classref-property-setget
  1634. - void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1635. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1636. If ``true``, the vertex color is used as albedo color.
  1637. .. rst-class:: classref-section-separator
  1638. ----
  1639. .. rst-class:: classref-descriptions-group
  1640. Method Descriptions
  1641. -------------------
  1642. .. _class_SpatialMaterial_method_get_feature:
  1643. .. rst-class:: classref-method
  1644. :ref:`bool<class_bool>` **get_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature **)** |const|
  1645. Returns ``true``, if the specified :ref:`Feature<enum_SpatialMaterial_Feature>` is enabled.
  1646. .. rst-class:: classref-item-separator
  1647. ----
  1648. .. _class_SpatialMaterial_method_get_flag:
  1649. .. rst-class:: classref-method
  1650. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag **)** |const|
  1651. Returns ``true``, if the specified flag is enabled. See :ref:`Flags<enum_SpatialMaterial_Flags>` enumerator for options.
  1652. .. rst-class:: classref-item-separator
  1653. ----
  1654. .. _class_SpatialMaterial_method_get_texture:
  1655. .. rst-class:: classref-method
  1656. :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param **)** |const|
  1657. Returns the :ref:`Texture<class_Texture>` associated with the specified :ref:`TextureParam<enum_SpatialMaterial_TextureParam>`.
  1658. .. rst-class:: classref-item-separator
  1659. ----
  1660. .. _class_SpatialMaterial_method_set_feature:
  1661. .. rst-class:: classref-method
  1662. void **set_feature** **(** :ref:`Feature<enum_SpatialMaterial_Feature>` feature, :ref:`bool<class_bool>` enable **)**
  1663. If ``true``, enables the specified :ref:`Feature<enum_SpatialMaterial_Feature>`. Many features that are available in **SpatialMaterial**\ s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to ``true``.
  1664. .. rst-class:: classref-item-separator
  1665. ----
  1666. .. _class_SpatialMaterial_method_set_flag:
  1667. .. rst-class:: classref-method
  1668. void **set_flag** **(** :ref:`Flags<enum_SpatialMaterial_Flags>` flag, :ref:`bool<class_bool>` enable **)**
  1669. If ``true``, enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to ``true``. See :ref:`Flags<enum_SpatialMaterial_Flags>` enumerator for options.
  1670. .. rst-class:: classref-item-separator
  1671. ----
  1672. .. _class_SpatialMaterial_method_set_texture:
  1673. .. rst-class:: classref-method
  1674. void **set_texture** **(** :ref:`TextureParam<enum_SpatialMaterial_TextureParam>` param, :ref:`Texture<class_Texture>` texture **)**
  1675. Sets the :ref:`Texture<class_Texture>` to be used by the specified :ref:`TextureParam<enum_SpatialMaterial_TextureParam>`. This function is called when setting members ending in ``*_texture``.
  1676. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1677. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1678. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1679. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`