1 /** 2 Prerendered indirect light map for a scene. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.bakedlightmap; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.visualinstance; 25 import godot.node; 26 import godot.sky; 27 import godot.bakedlightmapdata; 28 /** 29 Prerendered indirect light map for a scene. 30 31 Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the $(D GIProbe) approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time. 32 */ 33 @GodotBaseClass struct BakedLightmap 34 { 35 package(godot) enum string _GODOT_internal_name = "BakedLightmap"; 36 public: 37 @nogc nothrow: 38 union { /** */ godot_object _godot_object; /** */ VisualInstance _GODOT_base; } 39 alias _GODOT_base this; 40 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 41 package(godot) __gshared bool _classBindingInitialized = false; 42 package(godot) static struct GDNativeClassBinding 43 { 44 __gshared: 45 @GodotName("bake") GodotMethod!(BakedLightmap.BakeError, Node, String) bake; 46 @GodotName("get_bake_quality") GodotMethod!(BakedLightmap.BakeQuality) getBakeQuality; 47 @GodotName("get_bias") GodotMethod!(double) getBias; 48 @GodotName("get_bounces") GodotMethod!(long) getBounces; 49 @GodotName("get_capture_cell_size") GodotMethod!(double) getCaptureCellSize; 50 @GodotName("get_capture_enabled") GodotMethod!(bool) getCaptureEnabled; 51 @GodotName("get_capture_propagation") GodotMethod!(double) getCapturePropagation; 52 @GodotName("get_capture_quality") GodotMethod!(BakedLightmap.BakeQuality) getCaptureQuality; 53 @GodotName("get_default_texels_per_unit") GodotMethod!(double) getDefaultTexelsPerUnit; 54 @GodotName("get_environment_custom_color") GodotMethod!(Color) getEnvironmentCustomColor; 55 @GodotName("get_environment_custom_energy") GodotMethod!(double) getEnvironmentCustomEnergy; 56 @GodotName("get_environment_custom_sky") GodotMethod!(Sky) getEnvironmentCustomSky; 57 @GodotName("get_environment_custom_sky_rotation_degrees") GodotMethod!(Vector3) getEnvironmentCustomSkyRotationDegrees; 58 @GodotName("get_environment_min_light") GodotMethod!(Color) getEnvironmentMinLight; 59 @GodotName("get_environment_mode") GodotMethod!(BakedLightmap.EnvironmentMode) getEnvironmentMode; 60 @GodotName("get_extents") GodotMethod!(Vector3) getExtents; 61 @GodotName("get_image_path") GodotMethod!(String) getImagePath; 62 @GodotName("get_light_data") GodotMethod!(BakedLightmapData) getLightData; 63 @GodotName("get_max_atlas_size") GodotMethod!(long) getMaxAtlasSize; 64 @GodotName("is_generate_atlas_enabled") GodotMethod!(bool) isGenerateAtlasEnabled; 65 @GodotName("is_using_color") GodotMethod!(bool) isUsingColor; 66 @GodotName("is_using_denoiser") GodotMethod!(bool) isUsingDenoiser; 67 @GodotName("is_using_hdr") GodotMethod!(bool) isUsingHdr; 68 @GodotName("set_bake_quality") GodotMethod!(void, long) setBakeQuality; 69 @GodotName("set_bias") GodotMethod!(void, double) setBias; 70 @GodotName("set_bounces") GodotMethod!(void, long) setBounces; 71 @GodotName("set_capture_cell_size") GodotMethod!(void, double) setCaptureCellSize; 72 @GodotName("set_capture_enabled") GodotMethod!(void, bool) setCaptureEnabled; 73 @GodotName("set_capture_propagation") GodotMethod!(void, double) setCapturePropagation; 74 @GodotName("set_capture_quality") GodotMethod!(void, long) setCaptureQuality; 75 @GodotName("set_default_texels_per_unit") GodotMethod!(void, double) setDefaultTexelsPerUnit; 76 @GodotName("set_environment_custom_color") GodotMethod!(void, Color) setEnvironmentCustomColor; 77 @GodotName("set_environment_custom_energy") GodotMethod!(void, double) setEnvironmentCustomEnergy; 78 @GodotName("set_environment_custom_sky") GodotMethod!(void, Sky) setEnvironmentCustomSky; 79 @GodotName("set_environment_custom_sky_rotation_degrees") GodotMethod!(void, Vector3) setEnvironmentCustomSkyRotationDegrees; 80 @GodotName("set_environment_min_light") GodotMethod!(void, Color) setEnvironmentMinLight; 81 @GodotName("set_environment_mode") GodotMethod!(void, long) setEnvironmentMode; 82 @GodotName("set_extents") GodotMethod!(void, Vector3) setExtents; 83 @GodotName("set_generate_atlas") GodotMethod!(void, bool) setGenerateAtlas; 84 @GodotName("set_image_path") GodotMethod!(void, String) setImagePath; 85 @GodotName("set_light_data") GodotMethod!(void, BakedLightmapData) setLightData; 86 @GodotName("set_max_atlas_size") GodotMethod!(void, long) setMaxAtlasSize; 87 @GodotName("set_use_color") GodotMethod!(void, bool) setUseColor; 88 @GodotName("set_use_denoiser") GodotMethod!(void, bool) setUseDenoiser; 89 @GodotName("set_use_hdr") GodotMethod!(void, bool) setUseHdr; 90 } 91 /// 92 pragma(inline, true) bool opEquals(in BakedLightmap other) const 93 { return _godot_object.ptr is other._godot_object.ptr; } 94 /// 95 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 96 { _godot_object.ptr = n; return null; } 97 /// 98 pragma(inline, true) bool opEquals(typeof(null) n) const 99 { return _godot_object.ptr is n; } 100 /// 101 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 102 mixin baseCasts; 103 /// Construct a new instance of BakedLightmap. 104 /// Note: use `memnew!BakedLightmap` instead. 105 static BakedLightmap _new() 106 { 107 static godot_class_constructor constructor; 108 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("BakedLightmap"); 109 if(constructor is null) return typeof(this).init; 110 return cast(BakedLightmap)(constructor()); 111 } 112 @disable new(size_t s); 113 /// 114 enum BakeQuality : int 115 { 116 /** 117 The lowest bake quality mode. Fastest to calculate. 118 */ 119 bakeQualityLow = 0, 120 /** 121 The default bake quality mode. 122 */ 123 bakeQualityMedium = 1, 124 /** 125 A higher bake quality mode. Takes longer to calculate. 126 */ 127 bakeQualityHigh = 2, 128 /** 129 The highest bake quality mode. Takes the longest to calculate. 130 */ 131 bakeQualityUltra = 3, 132 } 133 /// 134 enum BakeError : int 135 { 136 /** 137 Baking was successful. 138 */ 139 bakeErrorOk = 0, 140 /** 141 Returns if no viable save path is found. This can happen where an $(D imagePath) is not specified or when the save location is invalid. 142 */ 143 bakeErrorNoSavePath = 1, 144 /** 145 Currently unused. 146 */ 147 bakeErrorNoMeshes = 2, 148 /** 149 Returns when the baker cannot save per-mesh textures to file. 150 */ 151 bakeErrorCantCreateImage = 3, 152 /** 153 The size of the generated lightmaps is too large. 154 */ 155 bakeErrorLightmapSize = 4, 156 /** 157 Some mesh contains UV2 values outside the `$(D 0,1)` range. 158 */ 159 bakeErrorInvalidMesh = 5, 160 /** 161 Returns if user cancels baking. 162 */ 163 bakeErrorUserAborted = 6, 164 /** 165 166 */ 167 bakeErrorNoLightmapper = 7, 168 } 169 /// 170 enum EnvironmentMode : int 171 { 172 /** 173 No environment is used during baking. 174 */ 175 environmentModeDisabled = 0, 176 /** 177 The baked environment is automatically picked from the current scene. 178 */ 179 environmentModeScene = 1, 180 /** 181 A custom sky is used as environment during baking. 182 */ 183 environmentModeCustomSky = 2, 184 /** 185 A custom solid color is used as environment during baking. 186 */ 187 environmentModeCustomColor = 3, 188 } 189 /// 190 enum Constants : int 191 { 192 bakeErrorOk = 0, 193 bakeQualityLow = 0, 194 environmentModeDisabled = 0, 195 bakeErrorNoSavePath = 1, 196 bakeQualityMedium = 1, 197 environmentModeScene = 1, 198 bakeQualityHigh = 2, 199 environmentModeCustomSky = 2, 200 bakeErrorNoMeshes = 2, 201 environmentModeCustomColor = 3, 202 bakeErrorCantCreateImage = 3, 203 bakeQualityUltra = 3, 204 bakeErrorLightmapSize = 4, 205 bakeErrorInvalidMesh = 5, 206 bakeErrorUserAborted = 6, 207 bakeErrorNoLightmapper = 7, 208 } 209 /** 210 Bakes the lightmap, scanning from the given `from_node` root and saves the resulting $(D BakedLightmapData) in `data_save_path`. If no save path is provided it will try to match the path from the current $(D lightData). 211 */ 212 BakedLightmap.BakeError bake(Node from_node = Node.init, in String data_save_path = gs!"") 213 { 214 checkClassBinding!(typeof(this))(); 215 return ptrcall!(BakedLightmap.BakeError)(GDNativeClassBinding.bake, _godot_object, from_node, data_save_path); 216 } 217 /** 218 219 */ 220 BakedLightmap.BakeQuality getBakeQuality() const 221 { 222 checkClassBinding!(typeof(this))(); 223 return ptrcall!(BakedLightmap.BakeQuality)(GDNativeClassBinding.getBakeQuality, _godot_object); 224 } 225 /** 226 227 */ 228 double getBias() const 229 { 230 checkClassBinding!(typeof(this))(); 231 return ptrcall!(double)(GDNativeClassBinding.getBias, _godot_object); 232 } 233 /** 234 235 */ 236 long getBounces() const 237 { 238 checkClassBinding!(typeof(this))(); 239 return ptrcall!(long)(GDNativeClassBinding.getBounces, _godot_object); 240 } 241 /** 242 243 */ 244 double getCaptureCellSize() const 245 { 246 checkClassBinding!(typeof(this))(); 247 return ptrcall!(double)(GDNativeClassBinding.getCaptureCellSize, _godot_object); 248 } 249 /** 250 251 */ 252 bool getCaptureEnabled() const 253 { 254 checkClassBinding!(typeof(this))(); 255 return ptrcall!(bool)(GDNativeClassBinding.getCaptureEnabled, _godot_object); 256 } 257 /** 258 259 */ 260 double getCapturePropagation() const 261 { 262 checkClassBinding!(typeof(this))(); 263 return ptrcall!(double)(GDNativeClassBinding.getCapturePropagation, _godot_object); 264 } 265 /** 266 267 */ 268 BakedLightmap.BakeQuality getCaptureQuality() const 269 { 270 checkClassBinding!(typeof(this))(); 271 return ptrcall!(BakedLightmap.BakeQuality)(GDNativeClassBinding.getCaptureQuality, _godot_object); 272 } 273 /** 274 275 */ 276 double getDefaultTexelsPerUnit() const 277 { 278 checkClassBinding!(typeof(this))(); 279 return ptrcall!(double)(GDNativeClassBinding.getDefaultTexelsPerUnit, _godot_object); 280 } 281 /** 282 283 */ 284 Color getEnvironmentCustomColor() const 285 { 286 checkClassBinding!(typeof(this))(); 287 return ptrcall!(Color)(GDNativeClassBinding.getEnvironmentCustomColor, _godot_object); 288 } 289 /** 290 291 */ 292 double getEnvironmentCustomEnergy() const 293 { 294 checkClassBinding!(typeof(this))(); 295 return ptrcall!(double)(GDNativeClassBinding.getEnvironmentCustomEnergy, _godot_object); 296 } 297 /** 298 299 */ 300 Ref!Sky getEnvironmentCustomSky() const 301 { 302 checkClassBinding!(typeof(this))(); 303 return ptrcall!(Sky)(GDNativeClassBinding.getEnvironmentCustomSky, _godot_object); 304 } 305 /** 306 307 */ 308 Vector3 getEnvironmentCustomSkyRotationDegrees() const 309 { 310 checkClassBinding!(typeof(this))(); 311 return ptrcall!(Vector3)(GDNativeClassBinding.getEnvironmentCustomSkyRotationDegrees, _godot_object); 312 } 313 /** 314 315 */ 316 Color getEnvironmentMinLight() const 317 { 318 checkClassBinding!(typeof(this))(); 319 return ptrcall!(Color)(GDNativeClassBinding.getEnvironmentMinLight, _godot_object); 320 } 321 /** 322 323 */ 324 BakedLightmap.EnvironmentMode getEnvironmentMode() const 325 { 326 checkClassBinding!(typeof(this))(); 327 return ptrcall!(BakedLightmap.EnvironmentMode)(GDNativeClassBinding.getEnvironmentMode, _godot_object); 328 } 329 /** 330 331 */ 332 Vector3 getExtents() const 333 { 334 checkClassBinding!(typeof(this))(); 335 return ptrcall!(Vector3)(GDNativeClassBinding.getExtents, _godot_object); 336 } 337 /** 338 339 */ 340 String getImagePath() const 341 { 342 checkClassBinding!(typeof(this))(); 343 return ptrcall!(String)(GDNativeClassBinding.getImagePath, _godot_object); 344 } 345 /** 346 347 */ 348 Ref!BakedLightmapData getLightData() const 349 { 350 checkClassBinding!(typeof(this))(); 351 return ptrcall!(BakedLightmapData)(GDNativeClassBinding.getLightData, _godot_object); 352 } 353 /** 354 355 */ 356 long getMaxAtlasSize() const 357 { 358 checkClassBinding!(typeof(this))(); 359 return ptrcall!(long)(GDNativeClassBinding.getMaxAtlasSize, _godot_object); 360 } 361 /** 362 363 */ 364 bool isGenerateAtlasEnabled() const 365 { 366 checkClassBinding!(typeof(this))(); 367 return ptrcall!(bool)(GDNativeClassBinding.isGenerateAtlasEnabled, _godot_object); 368 } 369 /** 370 371 */ 372 bool isUsingColor() const 373 { 374 checkClassBinding!(typeof(this))(); 375 return ptrcall!(bool)(GDNativeClassBinding.isUsingColor, _godot_object); 376 } 377 /** 378 379 */ 380 bool isUsingDenoiser() const 381 { 382 checkClassBinding!(typeof(this))(); 383 return ptrcall!(bool)(GDNativeClassBinding.isUsingDenoiser, _godot_object); 384 } 385 /** 386 387 */ 388 bool isUsingHdr() const 389 { 390 checkClassBinding!(typeof(this))(); 391 return ptrcall!(bool)(GDNativeClassBinding.isUsingHdr, _godot_object); 392 } 393 /** 394 395 */ 396 void setBakeQuality(in long quality) 397 { 398 checkClassBinding!(typeof(this))(); 399 ptrcall!(void)(GDNativeClassBinding.setBakeQuality, _godot_object, quality); 400 } 401 /** 402 403 */ 404 void setBias(in double bias) 405 { 406 checkClassBinding!(typeof(this))(); 407 ptrcall!(void)(GDNativeClassBinding.setBias, _godot_object, bias); 408 } 409 /** 410 411 */ 412 void setBounces(in long bounces) 413 { 414 checkClassBinding!(typeof(this))(); 415 ptrcall!(void)(GDNativeClassBinding.setBounces, _godot_object, bounces); 416 } 417 /** 418 419 */ 420 void setCaptureCellSize(in double capture_cell_size) 421 { 422 checkClassBinding!(typeof(this))(); 423 ptrcall!(void)(GDNativeClassBinding.setCaptureCellSize, _godot_object, capture_cell_size); 424 } 425 /** 426 427 */ 428 void setCaptureEnabled(in bool enabled) 429 { 430 checkClassBinding!(typeof(this))(); 431 ptrcall!(void)(GDNativeClassBinding.setCaptureEnabled, _godot_object, enabled); 432 } 433 /** 434 435 */ 436 void setCapturePropagation(in double propagation) 437 { 438 checkClassBinding!(typeof(this))(); 439 ptrcall!(void)(GDNativeClassBinding.setCapturePropagation, _godot_object, propagation); 440 } 441 /** 442 443 */ 444 void setCaptureQuality(in long capture_quality) 445 { 446 checkClassBinding!(typeof(this))(); 447 ptrcall!(void)(GDNativeClassBinding.setCaptureQuality, _godot_object, capture_quality); 448 } 449 /** 450 451 */ 452 void setDefaultTexelsPerUnit(in double texels) 453 { 454 checkClassBinding!(typeof(this))(); 455 ptrcall!(void)(GDNativeClassBinding.setDefaultTexelsPerUnit, _godot_object, texels); 456 } 457 /** 458 459 */ 460 void setEnvironmentCustomColor(in Color color) 461 { 462 checkClassBinding!(typeof(this))(); 463 ptrcall!(void)(GDNativeClassBinding.setEnvironmentCustomColor, _godot_object, color); 464 } 465 /** 466 467 */ 468 void setEnvironmentCustomEnergy(in double energy) 469 { 470 checkClassBinding!(typeof(this))(); 471 ptrcall!(void)(GDNativeClassBinding.setEnvironmentCustomEnergy, _godot_object, energy); 472 } 473 /** 474 475 */ 476 void setEnvironmentCustomSky(Sky sky) 477 { 478 checkClassBinding!(typeof(this))(); 479 ptrcall!(void)(GDNativeClassBinding.setEnvironmentCustomSky, _godot_object, sky); 480 } 481 /** 482 483 */ 484 void setEnvironmentCustomSkyRotationDegrees(in Vector3 rotation) 485 { 486 checkClassBinding!(typeof(this))(); 487 ptrcall!(void)(GDNativeClassBinding.setEnvironmentCustomSkyRotationDegrees, _godot_object, rotation); 488 } 489 /** 490 491 */ 492 void setEnvironmentMinLight(in Color min_light) 493 { 494 checkClassBinding!(typeof(this))(); 495 ptrcall!(void)(GDNativeClassBinding.setEnvironmentMinLight, _godot_object, min_light); 496 } 497 /** 498 499 */ 500 void setEnvironmentMode(in long mode) 501 { 502 checkClassBinding!(typeof(this))(); 503 ptrcall!(void)(GDNativeClassBinding.setEnvironmentMode, _godot_object, mode); 504 } 505 /** 506 507 */ 508 void setExtents(in Vector3 extents) 509 { 510 checkClassBinding!(typeof(this))(); 511 ptrcall!(void)(GDNativeClassBinding.setExtents, _godot_object, extents); 512 } 513 /** 514 515 */ 516 void setGenerateAtlas(in bool enabled) 517 { 518 checkClassBinding!(typeof(this))(); 519 ptrcall!(void)(GDNativeClassBinding.setGenerateAtlas, _godot_object, enabled); 520 } 521 /** 522 523 */ 524 void setImagePath(in String image_path) 525 { 526 checkClassBinding!(typeof(this))(); 527 ptrcall!(void)(GDNativeClassBinding.setImagePath, _godot_object, image_path); 528 } 529 /** 530 531 */ 532 void setLightData(BakedLightmapData data) 533 { 534 checkClassBinding!(typeof(this))(); 535 ptrcall!(void)(GDNativeClassBinding.setLightData, _godot_object, data); 536 } 537 /** 538 539 */ 540 void setMaxAtlasSize(in long max_atlas_size) 541 { 542 checkClassBinding!(typeof(this))(); 543 ptrcall!(void)(GDNativeClassBinding.setMaxAtlasSize, _godot_object, max_atlas_size); 544 } 545 /** 546 547 */ 548 void setUseColor(in bool use_denoiser) 549 { 550 checkClassBinding!(typeof(this))(); 551 ptrcall!(void)(GDNativeClassBinding.setUseColor, _godot_object, use_denoiser); 552 } 553 /** 554 555 */ 556 void setUseDenoiser(in bool use_denoiser) 557 { 558 checkClassBinding!(typeof(this))(); 559 ptrcall!(void)(GDNativeClassBinding.setUseDenoiser, _godot_object, use_denoiser); 560 } 561 /** 562 563 */ 564 void setUseHdr(in bool use_denoiser) 565 { 566 checkClassBinding!(typeof(this))(); 567 ptrcall!(void)(GDNativeClassBinding.setUseHdr, _godot_object, use_denoiser); 568 } 569 /** 570 When enabled, the lightmapper will merge the textures for all meshes into a single large layered texture. Not supported in GLES2. 571 */ 572 @property bool atlasGenerate() 573 { 574 return isGenerateAtlasEnabled(); 575 } 576 /// ditto 577 @property void atlasGenerate(bool v) 578 { 579 setGenerateAtlas(v); 580 } 581 /** 582 Maximum size of each lightmap layer, only used when $(D atlasGenerate) is enabled. 583 */ 584 @property long atlasMaxSize() 585 { 586 return getMaxAtlasSize(); 587 } 588 /// ditto 589 @property void atlasMaxSize(long v) 590 { 591 setMaxAtlasSize(v); 592 } 593 /** 594 Raycasting bias used during baking to avoid floating point precission issues. 595 */ 596 @property double bias() 597 { 598 return getBias(); 599 } 600 /// ditto 601 @property void bias(double v) 602 { 603 setBias(v); 604 } 605 /** 606 Number of light bounces that are taken into account during baking. 607 */ 608 @property long bounces() 609 { 610 return getBounces(); 611 } 612 /// ditto 613 @property void bounces(long v) 614 { 615 setBounces(v); 616 } 617 /** 618 Grid size used for real-time capture information on dynamic objects. 619 */ 620 @property double captureCellSize() 621 { 622 return getCaptureCellSize(); 623 } 624 /// ditto 625 @property void captureCellSize(double v) 626 { 627 setCaptureCellSize(v); 628 } 629 /** 630 When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene. 631 */ 632 @property bool captureEnabled() 633 { 634 return getCaptureEnabled(); 635 } 636 /// ditto 637 @property void captureEnabled(bool v) 638 { 639 setCaptureEnabled(v); 640 } 641 /** 642 Bias value to reduce the amount of light proagation in the captured octree. 643 */ 644 @property double capturePropagation() 645 { 646 return getCapturePropagation(); 647 } 648 /// ditto 649 @property void capturePropagation(double v) 650 { 651 setCapturePropagation(v); 652 } 653 /** 654 Bake quality of the capture data. 655 */ 656 @property BakedLightmap.BakeQuality captureQuality() 657 { 658 return getCaptureQuality(); 659 } 660 /// ditto 661 @property void captureQuality(long v) 662 { 663 setCaptureQuality(v); 664 } 665 /** 666 If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size. 667 */ 668 @property double defaultTexelsPerUnit() 669 { 670 return getDefaultTexelsPerUnit(); 671 } 672 /// ditto 673 @property void defaultTexelsPerUnit(double v) 674 { 675 setDefaultTexelsPerUnit(v); 676 } 677 /** 678 The environment color when $(D environmentMode) is set to $(D constant ENVIRONMENT_MODE_CUSTOM_COLOR). 679 */ 680 @property Color environmentCustomColor() 681 { 682 return getEnvironmentCustomColor(); 683 } 684 /// ditto 685 @property void environmentCustomColor(Color v) 686 { 687 setEnvironmentCustomColor(v); 688 } 689 /** 690 The energy scaling factor when when $(D environmentMode) is set to $(D constant ENVIRONMENT_MODE_CUSTOM_COLOR) or $(D constant ENVIRONMENT_MODE_CUSTOM_SKY). 691 */ 692 @property double environmentCustomEnergy() 693 { 694 return getEnvironmentCustomEnergy(); 695 } 696 /// ditto 697 @property void environmentCustomEnergy(double v) 698 { 699 setEnvironmentCustomEnergy(v); 700 } 701 /** 702 The $(D Sky) resource to use when $(D environmentMode) is set o $(D constant ENVIRONMENT_MODE_CUSTOM_SKY). 703 */ 704 @property Sky environmentCustomSky() 705 { 706 return getEnvironmentCustomSky(); 707 } 708 /// ditto 709 @property void environmentCustomSky(Sky v) 710 { 711 setEnvironmentCustomSky(v); 712 } 713 /** 714 The rotation of the baked custom sky. 715 */ 716 @property Vector3 environmentCustomSkyRotationDegrees() 717 { 718 return getEnvironmentCustomSkyRotationDegrees(); 719 } 720 /// ditto 721 @property void environmentCustomSkyRotationDegrees(Vector3 v) 722 { 723 setEnvironmentCustomSkyRotationDegrees(v); 724 } 725 /** 726 Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color. 727 */ 728 @property Color environmentMinLight() 729 { 730 return getEnvironmentMinLight(); 731 } 732 /// ditto 733 @property void environmentMinLight(Color v) 734 { 735 setEnvironmentMinLight(v); 736 } 737 /** 738 Decides which environment to use during baking. 739 */ 740 @property BakedLightmap.EnvironmentMode environmentMode() 741 { 742 return getEnvironmentMode(); 743 } 744 /// ditto 745 @property void environmentMode(long v) 746 { 747 setEnvironmentMode(v); 748 } 749 /** 750 Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting. 751 */ 752 @property Vector3 extents() 753 { 754 return getExtents(); 755 } 756 /// ditto 757 @property void extents(Vector3 v) 758 { 759 setExtents(v); 760 } 761 /** 762 Deprecated, in previous versions it determined the location where lightmaps were be saved. 763 */ 764 @property String imagePath() 765 { 766 return getImagePath(); 767 } 768 /// ditto 769 @property void imagePath(String v) 770 { 771 setImagePath(v); 772 } 773 /** 774 The calculated light data. 775 */ 776 @property BakedLightmapData lightData() 777 { 778 return getLightData(); 779 } 780 /// ditto 781 @property void lightData(BakedLightmapData v) 782 { 783 setLightData(v); 784 } 785 /** 786 Determines the amount of samples per texel used in indrect light baking. The amount of samples for each quality level can be configured in the project settings. 787 */ 788 @property BakedLightmap.BakeQuality quality() 789 { 790 return getBakeQuality(); 791 } 792 /// ditto 793 @property void quality(long v) 794 { 795 setBakeQuality(v); 796 } 797 /** 798 Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting. 799 */ 800 @property bool useColor() 801 { 802 return isUsingColor(); 803 } 804 /// ditto 805 @property void useColor(bool v) 806 { 807 setUseColor(v); 808 } 809 /** 810 When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination. 811 */ 812 @property bool useDenoiser() 813 { 814 return isUsingDenoiser(); 815 } 816 /// ditto 817 @property void useDenoiser(bool v) 818 { 819 setUseDenoiser(v); 820 } 821 /** 822 If `true`, stores the lightmap textures in a high dynamic range format (EXR). If `false`, stores the lightmap texture in a low dynamic range PNG image. This can be set to `false` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision. 823 $(B Note:) Setting $(D useHdr) to `true` will decrease lightmap banding even when using the GLES2 backend or if $(D ProjectSettings.rendering/quality/depth/hdr) is `false`. 824 */ 825 @property bool useHdr() 826 { 827 return isUsingHdr(); 828 } 829 /// ditto 830 @property void useHdr(bool v) 831 { 832 setUseHdr(v); 833 } 834 }