Light.cs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Light.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho
  18. {
  19. /// <summary>
  20. /// %Light component.
  21. /// </summary>
  22. public unsafe partial class Light : Drawable
  23. {
  24. unsafe partial void OnLightCreated ();
  25. [Preserve]
  26. public Light (IntPtr handle) : base (handle)
  27. {
  28. OnLightCreated ();
  29. }
  30. [Preserve]
  31. protected Light (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnLightCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Light_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Light_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Light_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Light_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Light_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Light));
  54. return new StringHash (Light_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Light_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Light));
  61. return Marshal.PtrToStringAnsi (Light_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public Light () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr Light_Light (IntPtr context);
  69. [Preserve]
  70. public Light (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(Light));
  73. handle = Light_Light ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnLightCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void Light_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory. Drawable must be registered first.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(Light));
  85. Light_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void Light_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  89. /// <summary>
  90. /// Visualize the component as debug geometry.
  91. /// </summary>
  92. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. Light_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void Light_SetLightType (IntPtr handle, LightType type);
  99. /// <summary>
  100. /// Set light type.
  101. /// </summary>
  102. private void SetLightType (LightType type)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. Light_SetLightType (handle, type);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void Light_SetPerVertex (IntPtr handle, bool enable);
  109. /// <summary>
  110. /// Set vertex lighting mode.
  111. /// </summary>
  112. private void SetPerVertex (bool enable)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. Light_SetPerVertex (handle, enable);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void Light_SetColor (IntPtr handle, ref Urho.Color color);
  119. /// <summary>
  120. /// Set color.
  121. /// </summary>
  122. private void SetColor (Urho.Color color)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. Light_SetColor (handle, ref color);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void Light_SetTemperature (IntPtr handle, float temperature);
  129. /// <summary>
  130. /// Set temperature of the light in Kelvin. Modulates the light color when "use physical values" is enabled.
  131. /// </summary>
  132. private void SetTemperature (float temperature)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. Light_SetTemperature (handle, temperature);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void Light_SetRadius (IntPtr handle, float radius);
  139. /// <summary>
  140. /// Set area light radius. Greater than zero activates area light mode. Works only with PBR shaders.
  141. /// </summary>
  142. private void SetRadius (float radius)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. Light_SetRadius (handle, radius);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void Light_SetLength (IntPtr handle, float length);
  149. /// <summary>
  150. /// Set tube area light length. Works only with PBR shaders.
  151. /// </summary>
  152. private void SetLength (float length)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. Light_SetLength (handle, length);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void Light_SetUsePhysicalValues (IntPtr handle, bool enable);
  159. /// <summary>
  160. /// Set use physical light values.
  161. /// </summary>
  162. private void SetUsePhysicalValues (bool enable)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. Light_SetUsePhysicalValues (handle, enable);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void Light_SetSpecularIntensity (IntPtr handle, float intensity);
  169. /// <summary>
  170. /// Set specular intensity. Zero disables specular calculations.
  171. /// </summary>
  172. private void SetSpecularIntensity (float intensity)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. Light_SetSpecularIntensity (handle, intensity);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void Light_SetBrightness (IntPtr handle, float brightness);
  179. /// <summary>
  180. /// Set light brightness multiplier. Both the color and specular intensity are multiplied with this. When "use physical values" is enabled, the value is specified in lumens.
  181. /// </summary>
  182. private void SetBrightness (float brightness)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. Light_SetBrightness (handle, brightness);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void Light_SetRange (IntPtr handle, float range);
  189. /// <summary>
  190. /// Set range.
  191. /// </summary>
  192. private void SetRange (float range)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. Light_SetRange (handle, range);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void Light_SetFov (IntPtr handle, float fov);
  199. /// <summary>
  200. /// Set spotlight field of view.
  201. /// </summary>
  202. private void SetFov (float fov)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. Light_SetFov (handle, fov);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void Light_SetAspectRatio (IntPtr handle, float aspectRatio);
  209. /// <summary>
  210. /// Set spotlight aspect ratio.
  211. /// </summary>
  212. private void SetAspectRatio (float aspectRatio)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. Light_SetAspectRatio (handle, aspectRatio);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void Light_SetFadeDistance (IntPtr handle, float distance);
  219. /// <summary>
  220. /// Set fade out start distance.
  221. /// </summary>
  222. private void SetFadeDistance (float distance)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. Light_SetFadeDistance (handle, distance);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void Light_SetShadowFadeDistance (IntPtr handle, float distance);
  229. /// <summary>
  230. /// Set shadow fade out start distance. Only has effect if shadow distance is also non-zero.
  231. /// </summary>
  232. private void SetShadowFadeDistance (float distance)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. Light_SetShadowFadeDistance (handle, distance);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void Light_SetShadowBias (IntPtr handle, ref BiasParameters parameters);
  239. /// <summary>
  240. /// Set shadow depth bias parameters.
  241. /// </summary>
  242. private void SetShadowBias (BiasParameters parameters)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. Light_SetShadowBias (handle, ref parameters);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void Light_SetShadowConstantBias (IntPtr handle, float constantBias);
  249. /// <summary>
  250. /// Set shadow constant bias.
  251. /// </summary>
  252. private void SetShadowConstantBias (float constantBias)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. Light_SetShadowConstantBias (handle, constantBias);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern void Light_SetShadowSlopeScaledBias (IntPtr handle, float slopeScaledBias);
  259. /// <summary>
  260. /// Set shadow slope scaled bias.
  261. /// </summary>
  262. private void SetShadowSlopeScaledBias (float slopeScaledBias)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. Light_SetShadowSlopeScaledBias (handle, slopeScaledBias);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void Light_SetShadowNormalOffset (IntPtr handle, float normalOffset);
  269. /// <summary>
  270. /// Set shadow normal offset multiplier.
  271. /// </summary>
  272. private void SetShadowNormalOffset (float normalOffset)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. Light_SetShadowNormalOffset (handle, normalOffset);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void Light_SetShadowCascade (IntPtr handle, ref CascadeParameters parameters);
  279. /// <summary>
  280. /// Set directional light cascaded shadow parameters.
  281. /// </summary>
  282. private void SetShadowCascade (CascadeParameters parameters)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. Light_SetShadowCascade (handle, ref parameters);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void Light_SetShadowCascadeSplits (IntPtr handle, ref Urho.Vector4 value);
  289. /// <summary>
  290. /// Set shadow cascade splits.
  291. /// </summary>
  292. public void SetShadowCascadeSplits (Urho.Vector4 value)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. Light_SetShadowCascadeSplits (handle, ref value);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern void Light_SetShadowCascadeFadeStart (IntPtr handle, float fadeStart);
  299. /// <summary>
  300. /// Set shadow cascade fade start.
  301. /// </summary>
  302. private void SetShadowCascadeFadeStart (float fadeStart)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. Light_SetShadowCascadeFadeStart (handle, fadeStart);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern void Light_SetShadowCascadeBiasAutoAdjust (IntPtr handle, float biasAutoAdjust);
  309. /// <summary>
  310. /// Set shadow cascade automatic depth bias adjustment strength.
  311. /// </summary>
  312. private void SetShadowCascadeBiasAutoAdjust (float biasAutoAdjust)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. Light_SetShadowCascadeBiasAutoAdjust (handle, biasAutoAdjust);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern void Light_SetShadowFocus (IntPtr handle, ref FocusParameters parameters);
  319. /// <summary>
  320. /// Set shadow map focusing parameters.
  321. /// </summary>
  322. private void SetShadowFocus (FocusParameters parameters)
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. Light_SetShadowFocus (handle, ref parameters);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern void Light_SetShadowFocusFlag (IntPtr handle, bool focus);
  329. /// <summary>
  330. /// Set shadow focus flag.
  331. /// </summary>
  332. private void SetShadowFocusFlag (bool focus)
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. Light_SetShadowFocusFlag (handle, focus);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern void Light_SetShadowFocusNonUniform (IntPtr handle, bool nonUniform);
  339. /// <summary>
  340. /// Set shadow non-uniform focus flag.
  341. /// </summary>
  342. private void SetShadowFocusNonUniform (bool nonUniform)
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. Light_SetShadowFocusNonUniform (handle, nonUniform);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern void Light_SetShadowFocusAutoSize (IntPtr handle, bool autoSize);
  349. /// <summary>
  350. /// Set shadow focus auto-size.
  351. /// </summary>
  352. private void SetShadowFocusAutoSize (bool autoSize)
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. Light_SetShadowFocusAutoSize (handle, autoSize);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern void Light_SetShadowFocusQuantize (IntPtr handle, float quantize);
  359. /// <summary>
  360. /// Set shadow focus quantization.
  361. /// </summary>
  362. private void SetShadowFocusQuantize (float quantize)
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. Light_SetShadowFocusQuantize (handle, quantize);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern void Light_SetShadowFocusMinView (IntPtr handle, float minView);
  369. /// <summary>
  370. /// Set shadow focus minimum view size.
  371. /// </summary>
  372. private void SetShadowFocusMinView (float minView)
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. Light_SetShadowFocusMinView (handle, minView);
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern void Light_SetShadowIntensity (IntPtr handle, float intensity);
  379. /// <summary>
  380. /// Set light intensity in shadow between 0.0 - 1.0. 0.0 (the default) gives fully dark shadows.
  381. /// </summary>
  382. private void SetShadowIntensity (float intensity)
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. Light_SetShadowIntensity (handle, intensity);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern void Light_SetShadowResolution (IntPtr handle, float resolution);
  389. /// <summary>
  390. /// Set shadow resolution between 0.25 - 1.0. Determines the shadow map to use.
  391. /// </summary>
  392. private void SetShadowResolution (float resolution)
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. Light_SetShadowResolution (handle, resolution);
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern void Light_SetShadowNearFarRatio (IntPtr handle, float nearFarRatio);
  399. /// <summary>
  400. /// Set shadow camera near/far clip distance ratio for spot and point lights. Does not affect directional lights, since they are orthographic and have near clip 0.
  401. /// </summary>
  402. private void SetShadowNearFarRatio (float nearFarRatio)
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. Light_SetShadowNearFarRatio (handle, nearFarRatio);
  406. }
  407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  408. internal static extern void Light_SetShadowMaxExtrusion (IntPtr handle, float extrusion);
  409. /// <summary>
  410. /// Set maximum shadow extrusion for directional lights. The actual extrusion will be the smaller of this and camera far clip. Default 1000.
  411. /// </summary>
  412. private void SetShadowMaxExtrusion (float extrusion)
  413. {
  414. Runtime.ValidateRefCounted (this);
  415. Light_SetShadowMaxExtrusion (handle, extrusion);
  416. }
  417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  418. internal static extern void Light_SetRampTexture (IntPtr handle, IntPtr texture);
  419. /// <summary>
  420. /// Set range attenuation texture.
  421. /// </summary>
  422. private void SetRampTexture (Texture texture)
  423. {
  424. Runtime.ValidateRefCounted (this);
  425. Light_SetRampTexture (handle, (object)texture == null ? IntPtr.Zero : texture.Handle);
  426. }
  427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  428. internal static extern void Light_SetShapeTexture (IntPtr handle, IntPtr texture);
  429. /// <summary>
  430. /// Set spotlight attenuation texture.
  431. /// </summary>
  432. private void SetShapeTexture (Texture texture)
  433. {
  434. Runtime.ValidateRefCounted (this);
  435. Light_SetShapeTexture (handle, (object)texture == null ? IntPtr.Zero : texture.Handle);
  436. }
  437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  438. internal static extern LightType Light_GetLightType (IntPtr handle);
  439. /// <summary>
  440. /// Return light type.
  441. /// </summary>
  442. private LightType GetLightType ()
  443. {
  444. Runtime.ValidateRefCounted (this);
  445. return Light_GetLightType (handle);
  446. }
  447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  448. internal static extern bool Light_GetPerVertex (IntPtr handle);
  449. /// <summary>
  450. /// Return vertex lighting mode.
  451. /// </summary>
  452. private bool GetPerVertex ()
  453. {
  454. Runtime.ValidateRefCounted (this);
  455. return Light_GetPerVertex (handle);
  456. }
  457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  458. internal static extern Urho.Color Light_GetColor (IntPtr handle);
  459. /// <summary>
  460. /// Return color.
  461. /// </summary>
  462. private Urho.Color GetColor ()
  463. {
  464. Runtime.ValidateRefCounted (this);
  465. return Light_GetColor (handle);
  466. }
  467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  468. internal static extern float Light_GetTemperature (IntPtr handle);
  469. /// <summary>
  470. /// Return the temperature of the light in Kelvin.
  471. /// </summary>
  472. private float GetTemperature ()
  473. {
  474. Runtime.ValidateRefCounted (this);
  475. return Light_GetTemperature (handle);
  476. }
  477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  478. internal static extern float Light_GetRadius (IntPtr handle);
  479. /// <summary>
  480. /// Return area light mode radius. Works only with PBR shaders.
  481. /// </summary>
  482. private float GetRadius ()
  483. {
  484. Runtime.ValidateRefCounted (this);
  485. return Light_GetRadius (handle);
  486. }
  487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  488. internal static extern float Light_GetLength (IntPtr handle);
  489. /// <summary>
  490. /// Return area tube light length. Works only with PBR shaders.
  491. /// </summary>
  492. private float GetLength ()
  493. {
  494. Runtime.ValidateRefCounted (this);
  495. return Light_GetLength (handle);
  496. }
  497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  498. internal static extern bool Light_GetUsePhysicalValues (IntPtr handle);
  499. /// <summary>
  500. /// Return if light uses temperature and brightness in lumens.
  501. /// </summary>
  502. private bool GetUsePhysicalValues ()
  503. {
  504. Runtime.ValidateRefCounted (this);
  505. return Light_GetUsePhysicalValues (handle);
  506. }
  507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  508. internal static extern Color Light_GetColorFromTemperature (IntPtr handle);
  509. /// <summary>
  510. /// Return the color value of the temperature in Kelvin.
  511. /// </summary>
  512. private Color GetColorFromTemperature ()
  513. {
  514. Runtime.ValidateRefCounted (this);
  515. return Light_GetColorFromTemperature (handle);
  516. }
  517. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  518. internal static extern float Light_GetSpecularIntensity (IntPtr handle);
  519. /// <summary>
  520. /// Return specular intensity.
  521. /// </summary>
  522. private float GetSpecularIntensity ()
  523. {
  524. Runtime.ValidateRefCounted (this);
  525. return Light_GetSpecularIntensity (handle);
  526. }
  527. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  528. internal static extern float Light_GetBrightness (IntPtr handle);
  529. /// <summary>
  530. /// Return brightness multiplier. Specified in lumens when "use physical values" is enabled.
  531. /// </summary>
  532. private float GetBrightness ()
  533. {
  534. Runtime.ValidateRefCounted (this);
  535. return Light_GetBrightness (handle);
  536. }
  537. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  538. internal static extern Color Light_GetEffectiveColor (IntPtr handle);
  539. /// <summary>
  540. /// Return effective color, multiplied by brightness and affected by temperature when "use physical values" is enabled. Alpha is always 1 so that can compare against the default black color to detect a light with no effect.
  541. /// </summary>
  542. private Color GetEffectiveColor ()
  543. {
  544. Runtime.ValidateRefCounted (this);
  545. return Light_GetEffectiveColor (handle);
  546. }
  547. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  548. internal static extern float Light_GetEffectiveSpecularIntensity (IntPtr handle);
  549. /// <summary>
  550. /// Return effective specular intensity, multiplied by absolute value of brightness.
  551. /// </summary>
  552. private float GetEffectiveSpecularIntensity ()
  553. {
  554. Runtime.ValidateRefCounted (this);
  555. return Light_GetEffectiveSpecularIntensity (handle);
  556. }
  557. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  558. internal static extern float Light_GetRange (IntPtr handle);
  559. /// <summary>
  560. /// Return range.
  561. /// </summary>
  562. private float GetRange ()
  563. {
  564. Runtime.ValidateRefCounted (this);
  565. return Light_GetRange (handle);
  566. }
  567. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  568. internal static extern float Light_GetFov (IntPtr handle);
  569. /// <summary>
  570. /// Return spotlight field of view.
  571. /// </summary>
  572. private float GetFov ()
  573. {
  574. Runtime.ValidateRefCounted (this);
  575. return Light_GetFov (handle);
  576. }
  577. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  578. internal static extern float Light_GetAspectRatio (IntPtr handle);
  579. /// <summary>
  580. /// Return spotlight aspect ratio.
  581. /// </summary>
  582. private float GetAspectRatio ()
  583. {
  584. Runtime.ValidateRefCounted (this);
  585. return Light_GetAspectRatio (handle);
  586. }
  587. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  588. internal static extern float Light_GetFadeDistance (IntPtr handle);
  589. /// <summary>
  590. /// Return fade start distance.
  591. /// </summary>
  592. private float GetFadeDistance ()
  593. {
  594. Runtime.ValidateRefCounted (this);
  595. return Light_GetFadeDistance (handle);
  596. }
  597. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  598. internal static extern float Light_GetShadowFadeDistance (IntPtr handle);
  599. /// <summary>
  600. /// Return shadow fade start distance.
  601. /// </summary>
  602. private float GetShadowFadeDistance ()
  603. {
  604. Runtime.ValidateRefCounted (this);
  605. return Light_GetShadowFadeDistance (handle);
  606. }
  607. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  608. internal static extern BiasParameters Light_GetShadowBias (IntPtr handle);
  609. /// <summary>
  610. /// Return shadow depth bias parameters.
  611. /// </summary>
  612. private BiasParameters GetShadowBias ()
  613. {
  614. Runtime.ValidateRefCounted (this);
  615. return Light_GetShadowBias (handle);
  616. }
  617. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  618. internal static extern float Light_GetShadowConstantBias (IntPtr handle);
  619. /// <summary>
  620. /// Return shadow constant bias.
  621. /// </summary>
  622. private float GetShadowConstantBias ()
  623. {
  624. Runtime.ValidateRefCounted (this);
  625. return Light_GetShadowConstantBias (handle);
  626. }
  627. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  628. internal static extern float Light_GetShadowSlopeScaledBias (IntPtr handle);
  629. /// <summary>
  630. /// Return shadow slope scaled bias.
  631. /// </summary>
  632. private float GetShadowSlopeScaledBias ()
  633. {
  634. Runtime.ValidateRefCounted (this);
  635. return Light_GetShadowSlopeScaledBias (handle);
  636. }
  637. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  638. internal static extern float Light_GetShadowNormalOffset (IntPtr handle);
  639. /// <summary>
  640. /// Return shadow normal offset multiplier.
  641. /// </summary>
  642. private float GetShadowNormalOffset ()
  643. {
  644. Runtime.ValidateRefCounted (this);
  645. return Light_GetShadowNormalOffset (handle);
  646. }
  647. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  648. internal static extern CascadeParameters Light_GetShadowCascade (IntPtr handle);
  649. /// <summary>
  650. /// Return directional light cascaded shadow parameters.
  651. /// </summary>
  652. private CascadeParameters GetShadowCascade ()
  653. {
  654. Runtime.ValidateRefCounted (this);
  655. return Light_GetShadowCascade (handle);
  656. }
  657. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  658. internal static extern Vector4 Light_GetShadowCascadeSplits (IntPtr handle);
  659. /// <summary>
  660. /// Return shadow cascade splits.
  661. /// </summary>
  662. private Vector4 GetShadowCascadeSplits ()
  663. {
  664. Runtime.ValidateRefCounted (this);
  665. return Light_GetShadowCascadeSplits (handle);
  666. }
  667. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  668. internal static extern float Light_GetShadowCascadeFadeStart (IntPtr handle);
  669. /// <summary>
  670. /// Return shadow cascade fade start.
  671. /// </summary>
  672. private float GetShadowCascadeFadeStart ()
  673. {
  674. Runtime.ValidateRefCounted (this);
  675. return Light_GetShadowCascadeFadeStart (handle);
  676. }
  677. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  678. internal static extern float Light_GetShadowCascadeBiasAutoAdjust (IntPtr handle);
  679. /// <summary>
  680. /// Return shadow cascade automatic depth bias adjustment strength.
  681. /// </summary>
  682. private float GetShadowCascadeBiasAutoAdjust ()
  683. {
  684. Runtime.ValidateRefCounted (this);
  685. return Light_GetShadowCascadeBiasAutoAdjust (handle);
  686. }
  687. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  688. internal static extern FocusParameters Light_GetShadowFocus (IntPtr handle);
  689. /// <summary>
  690. /// Return shadow map focus parameters.
  691. /// </summary>
  692. private FocusParameters GetShadowFocus ()
  693. {
  694. Runtime.ValidateRefCounted (this);
  695. return Light_GetShadowFocus (handle);
  696. }
  697. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  698. internal static extern bool Light_GetShadowFocusFlag (IntPtr handle);
  699. /// <summary>
  700. /// Return shadow focus flag.
  701. /// </summary>
  702. private bool GetShadowFocusFlag ()
  703. {
  704. Runtime.ValidateRefCounted (this);
  705. return Light_GetShadowFocusFlag (handle);
  706. }
  707. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  708. internal static extern bool Light_GetShadowFocusNonUniform (IntPtr handle);
  709. /// <summary>
  710. /// Return shadow non-uniform focus flag.
  711. /// </summary>
  712. private bool GetShadowFocusNonUniform ()
  713. {
  714. Runtime.ValidateRefCounted (this);
  715. return Light_GetShadowFocusNonUniform (handle);
  716. }
  717. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  718. internal static extern bool Light_GetShadowFocusAutoSize (IntPtr handle);
  719. /// <summary>
  720. /// Return shadow focus auto-size.
  721. /// </summary>
  722. private bool GetShadowFocusAutoSize ()
  723. {
  724. Runtime.ValidateRefCounted (this);
  725. return Light_GetShadowFocusAutoSize (handle);
  726. }
  727. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  728. internal static extern float Light_GetShadowFocusQuantize (IntPtr handle);
  729. /// <summary>
  730. /// Return shadow focus quantization.
  731. /// </summary>
  732. private float GetShadowFocusQuantize ()
  733. {
  734. Runtime.ValidateRefCounted (this);
  735. return Light_GetShadowFocusQuantize (handle);
  736. }
  737. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  738. internal static extern float Light_GetShadowFocusMinView (IntPtr handle);
  739. /// <summary>
  740. /// Return shadow focus minimum view size.
  741. /// </summary>
  742. private float GetShadowFocusMinView ()
  743. {
  744. Runtime.ValidateRefCounted (this);
  745. return Light_GetShadowFocusMinView (handle);
  746. }
  747. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  748. internal static extern float Light_GetShadowIntensity (IntPtr handle);
  749. /// <summary>
  750. /// Return light intensity in shadow.
  751. /// </summary>
  752. private float GetShadowIntensity ()
  753. {
  754. Runtime.ValidateRefCounted (this);
  755. return Light_GetShadowIntensity (handle);
  756. }
  757. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  758. internal static extern float Light_GetShadowResolution (IntPtr handle);
  759. /// <summary>
  760. /// Return shadow resolution.
  761. /// </summary>
  762. private float GetShadowResolution ()
  763. {
  764. Runtime.ValidateRefCounted (this);
  765. return Light_GetShadowResolution (handle);
  766. }
  767. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  768. internal static extern float Light_GetShadowNearFarRatio (IntPtr handle);
  769. /// <summary>
  770. /// Return shadow camera near/far clip distance ratio.
  771. /// </summary>
  772. private float GetShadowNearFarRatio ()
  773. {
  774. Runtime.ValidateRefCounted (this);
  775. return Light_GetShadowNearFarRatio (handle);
  776. }
  777. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  778. internal static extern float Light_GetShadowMaxExtrusion (IntPtr handle);
  779. /// <summary>
  780. /// Return maximum shadow extrusion distance for directional lights.
  781. /// </summary>
  782. private float GetShadowMaxExtrusion ()
  783. {
  784. Runtime.ValidateRefCounted (this);
  785. return Light_GetShadowMaxExtrusion (handle);
  786. }
  787. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  788. internal static extern IntPtr Light_GetRampTexture (IntPtr handle);
  789. /// <summary>
  790. /// Return range attenuation texture.
  791. /// </summary>
  792. private Texture GetRampTexture ()
  793. {
  794. Runtime.ValidateRefCounted (this);
  795. return Runtime.LookupObject<Texture> (Light_GetRampTexture (handle));
  796. }
  797. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  798. internal static extern IntPtr Light_GetShapeTexture (IntPtr handle);
  799. /// <summary>
  800. /// Return spotlight attenuation texture.
  801. /// </summary>
  802. private Texture GetShapeTexture ()
  803. {
  804. Runtime.ValidateRefCounted (this);
  805. return Runtime.LookupObject<Texture> (Light_GetShapeTexture (handle));
  806. }
  807. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  808. internal static extern IntPtr Light_GetFrustum (IntPtr handle);
  809. /// <summary>
  810. /// Return spotlight frustum.
  811. /// </summary>
  812. private Frustum GetFrustum ()
  813. {
  814. Runtime.ValidateRefCounted (this);
  815. return new Frustum (Light_GetFrustum (handle));
  816. }
  817. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  818. internal static extern IntPtr Light_GetViewSpaceFrustum (IntPtr handle, ref Urho.Matrix3x4 view);
  819. /// <summary>
  820. /// Return spotlight frustum in the specified view space.
  821. /// </summary>
  822. public Frustum GetViewSpaceFrustum (Urho.Matrix3x4 view)
  823. {
  824. Runtime.ValidateRefCounted (this);
  825. return new Frustum (Light_GetViewSpaceFrustum (handle, ref view));
  826. }
  827. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  828. internal static extern int Light_GetNumShadowSplits (IntPtr handle);
  829. /// <summary>
  830. /// Return number of shadow map cascade splits for a directional light, considering also graphics API limitations.
  831. /// </summary>
  832. private int GetNumShadowSplits ()
  833. {
  834. Runtime.ValidateRefCounted (this);
  835. return Light_GetNumShadowSplits (handle);
  836. }
  837. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  838. internal static extern bool Light_IsNegative (IntPtr handle);
  839. /// <summary>
  840. /// Return whether light has negative (darkening) color.
  841. /// </summary>
  842. private bool IsNegative ()
  843. {
  844. Runtime.ValidateRefCounted (this);
  845. return Light_IsNegative (handle);
  846. }
  847. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  848. internal static extern void Light_SetIntensitySortValue (IntPtr handle, float distance);
  849. /// <summary>
  850. /// Set sort value based on intensity and view distance.
  851. /// </summary>
  852. public void SetIntensitySortValue (float distance)
  853. {
  854. Runtime.ValidateRefCounted (this);
  855. Light_SetIntensitySortValue (handle, distance);
  856. }
  857. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  858. internal static extern void Light_SetIntensitySortValue0 (IntPtr handle, ref Urho.BoundingBox box);
  859. /// <summary>
  860. /// Set sort value based on overall intensity over a bounding box.
  861. /// </summary>
  862. public void SetIntensitySortValue (Urho.BoundingBox box)
  863. {
  864. Runtime.ValidateRefCounted (this);
  865. Light_SetIntensitySortValue0 (handle, ref box);
  866. }
  867. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  868. internal static extern void Light_SetLightQueue (IntPtr handle, LightBatchQueue* queue);
  869. /// <summary>
  870. /// Set light queue used for this light. Called by View.
  871. /// </summary>
  872. private void SetLightQueue (LightBatchQueue* queue)
  873. {
  874. Runtime.ValidateRefCounted (this);
  875. Light_SetLightQueue (handle, queue);
  876. }
  877. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  878. internal static extern Urho.Matrix3x4 Light_GetVolumeTransform (IntPtr handle, IntPtr camera);
  879. /// <summary>
  880. /// Return light volume model transform.
  881. /// </summary>
  882. public Urho.Matrix3x4 GetVolumeTransform (Camera camera)
  883. {
  884. Runtime.ValidateRefCounted (this);
  885. return Light_GetVolumeTransform (handle, (object)camera == null ? IntPtr.Zero : camera.Handle);
  886. }
  887. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  888. internal static extern LightBatchQueue* Light_GetLightQueue (IntPtr handle);
  889. /// <summary>
  890. /// Return light queue. Called by View.
  891. /// </summary>
  892. private LightBatchQueue* GetLightQueue ()
  893. {
  894. Runtime.ValidateRefCounted (this);
  895. return Light_GetLightQueue (handle);
  896. }
  897. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  898. internal static extern float Light_GetIntensityDivisor (IntPtr handle, float attenuation);
  899. /// <summary>
  900. /// Return a divisor value based on intensity for calculating the sort value.
  901. /// </summary>
  902. public float GetIntensityDivisor (float attenuation = 1f)
  903. {
  904. Runtime.ValidateRefCounted (this);
  905. return Light_GetIntensityDivisor (handle, attenuation);
  906. }
  907. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  908. internal static extern ResourceRef Light_GetRampTextureAttr (IntPtr handle);
  909. /// <summary>
  910. /// Return ramp texture attribute.
  911. /// </summary>
  912. private ResourceRef GetRampTextureAttr ()
  913. {
  914. Runtime.ValidateRefCounted (this);
  915. return Light_GetRampTextureAttr (handle);
  916. }
  917. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  918. internal static extern ResourceRef Light_GetShapeTextureAttr (IntPtr handle);
  919. /// <summary>
  920. /// Return shape texture attribute.
  921. /// </summary>
  922. private ResourceRef GetShapeTextureAttr ()
  923. {
  924. Runtime.ValidateRefCounted (this);
  925. return Light_GetShapeTextureAttr (handle);
  926. }
  927. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  928. internal static extern Matrix3x4 Light_GetFullscreenQuadTransform (IntPtr camera);
  929. /// <summary>
  930. /// Return a transform for deferred fullscreen quad (directional light) rendering.
  931. /// </summary>
  932. public static Matrix3x4 GetFullscreenQuadTransform (Camera camera)
  933. {
  934. Runtime.Validate (typeof(Light));
  935. return Light_GetFullscreenQuadTransform ((object)camera == null ? IntPtr.Zero : camera.Handle);
  936. }
  937. public override StringHash Type {
  938. get {
  939. return UrhoGetType ();
  940. }
  941. }
  942. public override string TypeName {
  943. get {
  944. return GetTypeName ();
  945. }
  946. }
  947. [Preserve]
  948. public new static StringHash TypeStatic {
  949. get {
  950. return GetTypeStatic ();
  951. }
  952. }
  953. public new static string TypeNameStatic {
  954. get {
  955. return GetTypeNameStatic ();
  956. }
  957. }
  958. /// <summary>
  959. /// Return light type.
  960. /// Or
  961. /// Set light type.
  962. /// </summary>
  963. public LightType LightType {
  964. get {
  965. return GetLightType ();
  966. }
  967. set {
  968. SetLightType (value);
  969. }
  970. }
  971. /// <summary>
  972. /// Return vertex lighting mode.
  973. /// Or
  974. /// Set vertex lighting mode.
  975. /// </summary>
  976. public bool PerVertex {
  977. get {
  978. return GetPerVertex ();
  979. }
  980. set {
  981. SetPerVertex (value);
  982. }
  983. }
  984. /// <summary>
  985. /// Return color.
  986. /// Or
  987. /// Set color.
  988. /// </summary>
  989. public Urho.Color Color {
  990. get {
  991. return GetColor ();
  992. }
  993. set {
  994. SetColor (value);
  995. }
  996. }
  997. /// <summary>
  998. /// Return the temperature of the light in Kelvin.
  999. /// Or
  1000. /// Set temperature of the light in Kelvin. Modulates the light color when "use physical values" is enabled.
  1001. /// </summary>
  1002. public float Temperature {
  1003. get {
  1004. return GetTemperature ();
  1005. }
  1006. set {
  1007. SetTemperature (value);
  1008. }
  1009. }
  1010. /// <summary>
  1011. /// Return area light mode radius. Works only with PBR shaders.
  1012. /// Or
  1013. /// Set area light radius. Greater than zero activates area light mode. Works only with PBR shaders.
  1014. /// </summary>
  1015. public float Radius {
  1016. get {
  1017. return GetRadius ();
  1018. }
  1019. set {
  1020. SetRadius (value);
  1021. }
  1022. }
  1023. /// <summary>
  1024. /// Return area tube light length. Works only with PBR shaders.
  1025. /// Or
  1026. /// Set tube area light length. Works only with PBR shaders.
  1027. /// </summary>
  1028. public float Length {
  1029. get {
  1030. return GetLength ();
  1031. }
  1032. set {
  1033. SetLength (value);
  1034. }
  1035. }
  1036. /// <summary>
  1037. /// Return if light uses temperature and brightness in lumens.
  1038. /// Or
  1039. /// Set use physical light values.
  1040. /// </summary>
  1041. public bool UsePhysicalValues {
  1042. get {
  1043. return GetUsePhysicalValues ();
  1044. }
  1045. set {
  1046. SetUsePhysicalValues (value);
  1047. }
  1048. }
  1049. /// <summary>
  1050. /// Return specular intensity.
  1051. /// Or
  1052. /// Set specular intensity. Zero disables specular calculations.
  1053. /// </summary>
  1054. public float SpecularIntensity {
  1055. get {
  1056. return GetSpecularIntensity ();
  1057. }
  1058. set {
  1059. SetSpecularIntensity (value);
  1060. }
  1061. }
  1062. /// <summary>
  1063. /// Return brightness multiplier. Specified in lumens when "use physical values" is enabled.
  1064. /// Or
  1065. /// Set light brightness multiplier. Both the color and specular intensity are multiplied with this. When "use physical values" is enabled, the value is specified in lumens.
  1066. /// </summary>
  1067. public float Brightness {
  1068. get {
  1069. return GetBrightness ();
  1070. }
  1071. set {
  1072. SetBrightness (value);
  1073. }
  1074. }
  1075. /// <summary>
  1076. /// Return range.
  1077. /// Or
  1078. /// Set range.
  1079. /// </summary>
  1080. public float Range {
  1081. get {
  1082. return GetRange ();
  1083. }
  1084. set {
  1085. SetRange (value);
  1086. }
  1087. }
  1088. /// <summary>
  1089. /// Return spotlight field of view.
  1090. /// Or
  1091. /// Set spotlight field of view.
  1092. /// </summary>
  1093. public float Fov {
  1094. get {
  1095. return GetFov ();
  1096. }
  1097. set {
  1098. SetFov (value);
  1099. }
  1100. }
  1101. /// <summary>
  1102. /// Return spotlight aspect ratio.
  1103. /// Or
  1104. /// Set spotlight aspect ratio.
  1105. /// </summary>
  1106. public float AspectRatio {
  1107. get {
  1108. return GetAspectRatio ();
  1109. }
  1110. set {
  1111. SetAspectRatio (value);
  1112. }
  1113. }
  1114. /// <summary>
  1115. /// Return fade start distance.
  1116. /// Or
  1117. /// Set fade out start distance.
  1118. /// </summary>
  1119. public float FadeDistance {
  1120. get {
  1121. return GetFadeDistance ();
  1122. }
  1123. set {
  1124. SetFadeDistance (value);
  1125. }
  1126. }
  1127. /// <summary>
  1128. /// Return shadow fade start distance.
  1129. /// Or
  1130. /// Set shadow fade out start distance. Only has effect if shadow distance is also non-zero.
  1131. /// </summary>
  1132. public float ShadowFadeDistance {
  1133. get {
  1134. return GetShadowFadeDistance ();
  1135. }
  1136. set {
  1137. SetShadowFadeDistance (value);
  1138. }
  1139. }
  1140. /// <summary>
  1141. /// Return shadow depth bias parameters.
  1142. /// Or
  1143. /// Set shadow depth bias parameters.
  1144. /// </summary>
  1145. public BiasParameters ShadowBias {
  1146. get {
  1147. return GetShadowBias ();
  1148. }
  1149. set {
  1150. SetShadowBias (value);
  1151. }
  1152. }
  1153. /// <summary>
  1154. /// Return shadow constant bias.
  1155. /// Or
  1156. /// Set shadow constant bias.
  1157. /// </summary>
  1158. public float ShadowConstantBias {
  1159. get {
  1160. return GetShadowConstantBias ();
  1161. }
  1162. set {
  1163. SetShadowConstantBias (value);
  1164. }
  1165. }
  1166. /// <summary>
  1167. /// Return shadow slope scaled bias.
  1168. /// Or
  1169. /// Set shadow slope scaled bias.
  1170. /// </summary>
  1171. public float ShadowSlopeScaledBias {
  1172. get {
  1173. return GetShadowSlopeScaledBias ();
  1174. }
  1175. set {
  1176. SetShadowSlopeScaledBias (value);
  1177. }
  1178. }
  1179. /// <summary>
  1180. /// Return shadow normal offset multiplier.
  1181. /// Or
  1182. /// Set shadow normal offset multiplier.
  1183. /// </summary>
  1184. public float ShadowNormalOffset {
  1185. get {
  1186. return GetShadowNormalOffset ();
  1187. }
  1188. set {
  1189. SetShadowNormalOffset (value);
  1190. }
  1191. }
  1192. /// <summary>
  1193. /// Return directional light cascaded shadow parameters.
  1194. /// Or
  1195. /// Set directional light cascaded shadow parameters.
  1196. /// </summary>
  1197. public CascadeParameters ShadowCascade {
  1198. get {
  1199. return GetShadowCascade ();
  1200. }
  1201. set {
  1202. SetShadowCascade (value);
  1203. }
  1204. }
  1205. /// <summary>
  1206. /// Return shadow cascade splits.
  1207. /// </summary>
  1208. public Vector4 ShadowCascadeSplits {
  1209. get {
  1210. return GetShadowCascadeSplits ();
  1211. }
  1212. }
  1213. /// <summary>
  1214. /// Return shadow cascade fade start.
  1215. /// Or
  1216. /// Set shadow cascade fade start.
  1217. /// </summary>
  1218. public float ShadowCascadeFadeStart {
  1219. get {
  1220. return GetShadowCascadeFadeStart ();
  1221. }
  1222. set {
  1223. SetShadowCascadeFadeStart (value);
  1224. }
  1225. }
  1226. /// <summary>
  1227. /// Return shadow cascade automatic depth bias adjustment strength.
  1228. /// Or
  1229. /// Set shadow cascade automatic depth bias adjustment strength.
  1230. /// </summary>
  1231. public float ShadowCascadeBiasAutoAdjust {
  1232. get {
  1233. return GetShadowCascadeBiasAutoAdjust ();
  1234. }
  1235. set {
  1236. SetShadowCascadeBiasAutoAdjust (value);
  1237. }
  1238. }
  1239. /// <summary>
  1240. /// Return shadow map focus parameters.
  1241. /// Or
  1242. /// Set shadow map focusing parameters.
  1243. /// </summary>
  1244. public FocusParameters ShadowFocus {
  1245. get {
  1246. return GetShadowFocus ();
  1247. }
  1248. set {
  1249. SetShadowFocus (value);
  1250. }
  1251. }
  1252. /// <summary>
  1253. /// Return shadow focus flag.
  1254. /// Or
  1255. /// Set shadow focus flag.
  1256. /// </summary>
  1257. public bool ShadowFocusFlag {
  1258. get {
  1259. return GetShadowFocusFlag ();
  1260. }
  1261. set {
  1262. SetShadowFocusFlag (value);
  1263. }
  1264. }
  1265. /// <summary>
  1266. /// Return shadow non-uniform focus flag.
  1267. /// Or
  1268. /// Set shadow non-uniform focus flag.
  1269. /// </summary>
  1270. public bool ShadowFocusNonUniform {
  1271. get {
  1272. return GetShadowFocusNonUniform ();
  1273. }
  1274. set {
  1275. SetShadowFocusNonUniform (value);
  1276. }
  1277. }
  1278. /// <summary>
  1279. /// Return shadow focus auto-size.
  1280. /// Or
  1281. /// Set shadow focus auto-size.
  1282. /// </summary>
  1283. public bool ShadowFocusAutoSize {
  1284. get {
  1285. return GetShadowFocusAutoSize ();
  1286. }
  1287. set {
  1288. SetShadowFocusAutoSize (value);
  1289. }
  1290. }
  1291. /// <summary>
  1292. /// Return shadow focus quantization.
  1293. /// Or
  1294. /// Set shadow focus quantization.
  1295. /// </summary>
  1296. public float ShadowFocusQuantize {
  1297. get {
  1298. return GetShadowFocusQuantize ();
  1299. }
  1300. set {
  1301. SetShadowFocusQuantize (value);
  1302. }
  1303. }
  1304. /// <summary>
  1305. /// Return shadow focus minimum view size.
  1306. /// Or
  1307. /// Set shadow focus minimum view size.
  1308. /// </summary>
  1309. public float ShadowFocusMinView {
  1310. get {
  1311. return GetShadowFocusMinView ();
  1312. }
  1313. set {
  1314. SetShadowFocusMinView (value);
  1315. }
  1316. }
  1317. /// <summary>
  1318. /// Return light intensity in shadow.
  1319. /// Or
  1320. /// Set light intensity in shadow between 0.0 - 1.0. 0.0 (the default) gives fully dark shadows.
  1321. /// </summary>
  1322. public float ShadowIntensity {
  1323. get {
  1324. return GetShadowIntensity ();
  1325. }
  1326. set {
  1327. SetShadowIntensity (value);
  1328. }
  1329. }
  1330. /// <summary>
  1331. /// Return shadow resolution.
  1332. /// Or
  1333. /// Set shadow resolution between 0.25 - 1.0. Determines the shadow map to use.
  1334. /// </summary>
  1335. public float ShadowResolution {
  1336. get {
  1337. return GetShadowResolution ();
  1338. }
  1339. set {
  1340. SetShadowResolution (value);
  1341. }
  1342. }
  1343. /// <summary>
  1344. /// Return shadow camera near/far clip distance ratio.
  1345. /// Or
  1346. /// Set shadow camera near/far clip distance ratio for spot and point lights. Does not affect directional lights, since they are orthographic and have near clip 0.
  1347. /// </summary>
  1348. public float ShadowNearFarRatio {
  1349. get {
  1350. return GetShadowNearFarRatio ();
  1351. }
  1352. set {
  1353. SetShadowNearFarRatio (value);
  1354. }
  1355. }
  1356. /// <summary>
  1357. /// Return maximum shadow extrusion distance for directional lights.
  1358. /// Or
  1359. /// Set maximum shadow extrusion for directional lights. The actual extrusion will be the smaller of this and camera far clip. Default 1000.
  1360. /// </summary>
  1361. public float ShadowMaxExtrusion {
  1362. get {
  1363. return GetShadowMaxExtrusion ();
  1364. }
  1365. set {
  1366. SetShadowMaxExtrusion (value);
  1367. }
  1368. }
  1369. /// <summary>
  1370. /// Return range attenuation texture.
  1371. /// Or
  1372. /// Set range attenuation texture.
  1373. /// </summary>
  1374. public Texture RampTexture {
  1375. get {
  1376. return GetRampTexture ();
  1377. }
  1378. set {
  1379. SetRampTexture (value);
  1380. }
  1381. }
  1382. /// <summary>
  1383. /// Return spotlight attenuation texture.
  1384. /// Or
  1385. /// Set spotlight attenuation texture.
  1386. /// </summary>
  1387. public Texture ShapeTexture {
  1388. get {
  1389. return GetShapeTexture ();
  1390. }
  1391. set {
  1392. SetShapeTexture (value);
  1393. }
  1394. }
  1395. /// <summary>
  1396. /// Return the color value of the temperature in Kelvin.
  1397. /// </summary>
  1398. public Color ColorFromTemperature {
  1399. get {
  1400. return GetColorFromTemperature ();
  1401. }
  1402. }
  1403. /// <summary>
  1404. /// Return effective color, multiplied by brightness and affected by temperature when "use physical values" is enabled. Alpha is always 1 so that can compare against the default black color to detect a light with no effect.
  1405. /// </summary>
  1406. public Color EffectiveColor {
  1407. get {
  1408. return GetEffectiveColor ();
  1409. }
  1410. }
  1411. /// <summary>
  1412. /// Return effective specular intensity, multiplied by absolute value of brightness.
  1413. /// </summary>
  1414. public float EffectiveSpecularIntensity {
  1415. get {
  1416. return GetEffectiveSpecularIntensity ();
  1417. }
  1418. }
  1419. /// <summary>
  1420. /// Return spotlight frustum.
  1421. /// </summary>
  1422. public Frustum Frustum {
  1423. get {
  1424. return GetFrustum ();
  1425. }
  1426. }
  1427. /// <summary>
  1428. /// Return number of shadow map cascade splits for a directional light, considering also graphics API limitations.
  1429. /// </summary>
  1430. public int NumShadowSplits {
  1431. get {
  1432. return GetNumShadowSplits ();
  1433. }
  1434. }
  1435. /// <summary>
  1436. /// Return whether light has negative (darkening) color.
  1437. /// </summary>
  1438. public bool Negative {
  1439. get {
  1440. return IsNegative ();
  1441. }
  1442. }
  1443. /// <summary>
  1444. /// Return light queue. Called by View.
  1445. /// Or
  1446. /// Set light queue used for this light. Called by View.
  1447. /// </summary>
  1448. public LightBatchQueue* LightQueue {
  1449. get {
  1450. return GetLightQueue ();
  1451. }
  1452. set {
  1453. SetLightQueue (value);
  1454. }
  1455. }
  1456. /// <summary>
  1457. /// Return ramp texture attribute.
  1458. /// </summary>
  1459. public ResourceRef RampTextureAttr {
  1460. get {
  1461. return GetRampTextureAttr ();
  1462. }
  1463. }
  1464. /// <summary>
  1465. /// Return shape texture attribute.
  1466. /// </summary>
  1467. public ResourceRef ShapeTextureAttr {
  1468. get {
  1469. return GetShapeTextureAttr ();
  1470. }
  1471. }
  1472. }
  1473. }