1 | <?php |
||
29 | class Standard extends ShaderAbstract implements ShaderInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Base diffuse color. |
||
34 | * |
||
35 | * @var string $color |
||
36 | */ |
||
37 | public $color = '#fff'; |
||
38 | |||
39 | /** |
||
40 | * Height of video (in pixels), if defining a video texture. |
||
41 | * |
||
42 | * @var int $height |
||
43 | */ |
||
44 | public $height = 360; |
||
45 | |||
46 | /** |
||
47 | * Environment cubemap texture for reflections. |
||
48 | * |
||
49 | * Can be a selector to or a comma-separated list of URLs. |
||
50 | * |
||
51 | * @var string|null $envMap |
||
52 | */ |
||
53 | public $envMap = null; |
||
54 | |||
55 | /** |
||
56 | * Whether or not material is affected by fog. |
||
57 | * |
||
58 | * @var string $fog |
||
59 | */ |
||
60 | public $fog = 'true'; |
||
61 | |||
62 | /** |
||
63 | * How metallic the material is from 0 to 1. |
||
64 | * |
||
65 | * @var float $metalness |
||
66 | */ |
||
67 | public $metalness = 0.5; |
||
68 | |||
69 | /** |
||
70 | * How many times a texture (defined by src) repeats in the X and Y direction. |
||
71 | * |
||
72 | * @var string $repeat |
||
73 | */ |
||
74 | public $repeat = '1 1'; |
||
75 | |||
76 | /** |
||
77 | * How rough the material is from 0 to 1. |
||
78 | * A rougher material will scatter |
||
79 | * reflected light in more directions than a smooth material. |
||
80 | * |
||
81 | * @var float $roughness |
||
82 | */ |
||
83 | public $roughness = 0.5; |
||
84 | |||
85 | /** |
||
86 | * Image or video texture map. |
||
87 | * Can either be a selector to an <img> or <video>, or an inline URL. |
||
88 | * |
||
89 | * @var string|null $src |
||
90 | */ |
||
91 | public $src = null; |
||
92 | |||
93 | /** |
||
94 | * Width of video (in pixels), if defining a video texture. |
||
95 | * |
||
96 | * @var int $width |
||
97 | */ |
||
98 | public $width = 640; |
||
99 | |||
100 | /** |
||
101 | * Construct and set shader defaults |
||
102 | */ |
||
103 | 13 | public function __construct() |
|
115 | |||
116 | /** |
||
117 | * Base diffuse color |
||
118 | * |
||
119 | * @param string $color |
||
120 | */ |
||
121 | 13 | public function color(string $color) |
|
125 | |||
126 | /** |
||
127 | * Height of video (in pixels), if defining a video texture. |
||
128 | * |
||
129 | * @param int $height |
||
130 | */ |
||
131 | 13 | public function height($height) |
|
135 | |||
136 | /** |
||
137 | * envMap |
||
138 | * |
||
139 | * Environment cubemap texture for reflections. |
||
140 | * Can be a selector to or a comma-separated list of URLs. |
||
141 | * |
||
142 | * @param string|null $envMap |
||
143 | */ |
||
144 | 13 | public function envMap(string $envMap = null) |
|
148 | |||
149 | /** |
||
150 | * Whether or not material is affected by fog. |
||
151 | * |
||
152 | * @param bool $fog |
||
153 | */ |
||
154 | 13 | public function fog($fog) |
|
158 | |||
159 | /** |
||
160 | * How metallic the material is from 0 to 1. |
||
161 | * |
||
162 | * @param float $metalness |
||
163 | */ |
||
164 | 13 | public function metalness($metalness) |
|
168 | |||
169 | /** |
||
170 | * repeat |
||
171 | * |
||
172 | * @param int|float $x |
||
|
|||
173 | * @param int|float $y |
||
174 | */ |
||
175 | 13 | public function repeat(float $x, float $y) |
|
179 | |||
180 | /** |
||
181 | * How rough the material is from 0 to 1 |
||
182 | * |
||
183 | * A rougher material will scatter reflected light in more directions than a smooth material. |
||
184 | * |
||
185 | * @param float $roughness |
||
186 | */ |
||
187 | 13 | public function roughness(float $roughness) |
|
191 | |||
192 | /** |
||
193 | * How many times a texture (defined by src) repeats in the X and Y direction. |
||
194 | * |
||
195 | * @param string|null $src |
||
196 | */ |
||
197 | 13 | public function src(string $src = null) |
|
201 | |||
202 | /** |
||
203 | * Width of video (in pixels), if defining a video texture. |
||
204 | * |
||
205 | * @param int $width |
||
206 | */ |
||
207 | 13 | public function width(int $width) |
|
211 | } |
||
212 |