1 | <?php |
||
29 | class Standard extends ShaderAbstract implements ShaderInterface |
||
30 | { |
||
31 | /** |
||
32 | * Shader |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $shader = 'standard'; |
||
37 | |||
38 | /** |
||
39 | * Base diffuse color. |
||
40 | * |
||
41 | * @var string $color |
||
42 | */ |
||
43 | protected $color = '#fff'; |
||
44 | |||
45 | /** |
||
46 | * Height of video (in pixels), if defining a video texture. |
||
47 | * |
||
48 | * @var int $height |
||
49 | */ |
||
50 | protected $height = 360; |
||
51 | |||
52 | /** |
||
53 | * Environment cubemap texture for reflections. |
||
54 | * |
||
55 | * Can be a selector to or a comma-separated list of URLs. |
||
56 | * |
||
57 | * @var string|null $envMap |
||
58 | */ |
||
59 | protected $envMap = null; |
||
60 | |||
61 | /** |
||
62 | * Whether or not material is affected by fog. |
||
63 | * |
||
64 | * @var string $fog |
||
65 | */ |
||
66 | protected $fog = 'true'; |
||
67 | |||
68 | /** |
||
69 | * How metallic the material is from 0 to 1. |
||
70 | * |
||
71 | * @var float $metalness |
||
72 | */ |
||
73 | protected $metalness = 0.5; |
||
74 | |||
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 | protected $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 | protected $src = null; |
||
92 | |||
93 | /** |
||
94 | * Width of video (in pixels), if defining a video texture. |
||
95 | * |
||
96 | * @var int $width |
||
97 | */ |
||
98 | protected $width = 640; |
||
99 | |||
100 | /** |
||
101 | * Set shader defaults |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | 1 | public function defaults() |
|
116 | |||
117 | /** |
||
118 | * Base diffuse color |
||
119 | * |
||
120 | * @param string $color |
||
121 | */ |
||
122 | 10 | public function color(string $color) |
|
127 | |||
128 | /** |
||
129 | * Height of video (in pixels), if defining a video texture. |
||
130 | * |
||
131 | * @param int $height |
||
132 | */ |
||
133 | 2 | public function height($height) |
|
138 | |||
139 | /** |
||
140 | * envMap |
||
141 | * |
||
142 | * Environment cubemap texture for reflections. |
||
143 | * Can be a selector to or a comma-separated list of URLs. |
||
144 | * |
||
145 | * @param string|null $envMap |
||
146 | */ |
||
147 | 2 | public function envMap(string $envMap = null) |
|
152 | |||
153 | /** |
||
154 | * Whether or not material is affected by fog. |
||
155 | * |
||
156 | * @param bool $fog |
||
157 | */ |
||
158 | 2 | public function fog($fog) |
|
163 | |||
164 | /** |
||
165 | * How metallic the material is from 0 to 1. |
||
166 | * |
||
167 | * @param float $metalness |
||
168 | */ |
||
169 | 8 | public function metalness($metalness) |
|
174 | |||
175 | /** |
||
176 | * How rough the material is from 0 to 1 |
||
177 | * |
||
178 | * A rougher material will scatter reflected light in more directions than a smooth material. |
||
179 | * |
||
180 | * @param float $roughness |
||
181 | */ |
||
182 | 4 | public function roughness(float $roughness) |
|
187 | |||
188 | /** |
||
189 | * How many times a texture (defined by src) repeats in the X and Y direction. |
||
190 | * |
||
191 | * @param string|null $src |
||
192 | */ |
||
193 | 9 | public function src(string $src = null) |
|
198 | |||
199 | /** |
||
200 | * Width of video (in pixels), if defining a video texture. |
||
201 | * |
||
202 | * @param int $width |
||
203 | */ |
||
204 | 2 | public function width(int $width) |
|
209 | } |
||
210 |