1 /**
2 The base class for $(D PanoramaSky) and $(D ProceduralSky).
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.sky;
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.resource;
24 import godot.reference;
25 /**
26 The base class for $(D PanoramaSky) and $(D ProceduralSky).
27 
28 
29 */
30 @GodotBaseClass struct Sky
31 {
32 	package(godot) enum string _GODOT_internal_name = "Sky";
33 public:
34 @nogc nothrow:
35 	union { /** */ godot_object _godot_object; /** */ Resource _GODOT_base; }
36 	alias _GODOT_base this;
37 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
38 	package(godot) __gshared bool _classBindingInitialized = false;
39 	package(godot) static struct GDNativeClassBinding
40 	{
41 		__gshared:
42 		@GodotName("get_radiance_size") GodotMethod!(Sky.RadianceSize) getRadianceSize;
43 		@GodotName("set_radiance_size") GodotMethod!(void, long) setRadianceSize;
44 	}
45 	/// 
46 	pragma(inline, true) bool opEquals(in Sky other) const
47 	{ return _godot_object.ptr is other._godot_object.ptr; }
48 	/// 
49 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
50 	{ _godot_object.ptr = n; return null; }
51 	/// 
52 	pragma(inline, true) bool opEquals(typeof(null) n) const
53 	{ return _godot_object.ptr is n; }
54 	/// 
55 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
56 	mixin baseCasts;
57 	/// Construct a new instance of Sky.
58 	/// Note: use `memnew!Sky` instead.
59 	static Sky _new()
60 	{
61 		static godot_class_constructor constructor;
62 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Sky");
63 		if(constructor is null) return typeof(this).init;
64 		return cast(Sky)(constructor());
65 	}
66 	@disable new(size_t s);
67 	/// 
68 	enum RadianceSize : int
69 	{
70 		/**
71 		Radiance texture size is 32×32 pixels.
72 		*/
73 		radianceSize32 = 0,
74 		/**
75 		Radiance texture size is 64×64 pixels.
76 		*/
77 		radianceSize64 = 1,
78 		/**
79 		Radiance texture size is 128×128 pixels.
80 		*/
81 		radianceSize128 = 2,
82 		/**
83 		Radiance texture size is 256×256 pixels.
84 		*/
85 		radianceSize256 = 3,
86 		/**
87 		Radiance texture size is 512×512 pixels.
88 		*/
89 		radianceSize512 = 4,
90 		/**
91 		Radiance texture size is 1024×1024 pixels.
92 		$(B Note:) $(D constant RADIANCE_SIZE_1024) is not exposed in the inspector as it is known to cause GPU hangs on certain systems.
93 		*/
94 		radianceSize1024 = 5,
95 		/**
96 		Radiance texture size is 2048×2048 pixels.
97 		$(B Note:) $(D constant RADIANCE_SIZE_2048) is not exposed in the inspector as it is known to cause GPU hangs on certain systems.
98 		*/
99 		radianceSize2048 = 6,
100 		/**
101 		Represents the size of the $(D radiancesize) enum.
102 		*/
103 		radianceSizeMax = 7,
104 	}
105 	/// 
106 	enum Constants : int
107 	{
108 		radianceSize32 = 0,
109 		radianceSize64 = 1,
110 		radianceSize128 = 2,
111 		radianceSize256 = 3,
112 		radianceSize512 = 4,
113 		radianceSize1024 = 5,
114 		radianceSize2048 = 6,
115 		radianceSizeMax = 7,
116 	}
117 	/**
118 	
119 	*/
120 	Sky.RadianceSize getRadianceSize() const
121 	{
122 		checkClassBinding!(typeof(this))();
123 		return ptrcall!(Sky.RadianceSize)(GDNativeClassBinding.getRadianceSize, _godot_object);
124 	}
125 	/**
126 	
127 	*/
128 	void setRadianceSize(in long size)
129 	{
130 		checkClassBinding!(typeof(this))();
131 		ptrcall!(void)(GDNativeClassBinding.setRadianceSize, _godot_object, size);
132 	}
133 	/**
134 	The $(D Sky)'s radiance map size. The higher the radiance map size, the more detailed the lighting from the $(D Sky) will be.
135 	See $(D radiancesize) constants for values.
136 	$(B Note:) You will only benefit from high radiance sizes if you have perfectly sharp reflective surfaces in your project and are not using $(D ReflectionProbe)s or $(D GIProbe)s. For most projects, keeping $(D radianceSize) to the default value is the best compromise between visuals and performance. Be careful when using high radiance size values as these can cause crashes on low-end GPUs.
137 	*/
138 	@property Sky.RadianceSize radianceSize()
139 	{
140 		return getRadianceSize();
141 	}
142 	/// ditto
143 	@property void radianceSize(long v)
144 	{
145 		setRadianceSize(v);
146 	}
147 }