* Sets the swizzles that will be applied to the components of a texel before it is written to the output color. * * @param {ColorChannel} r - The swizzle for the `r` component. * @param {ColorChannel} [g=r] - The swizzle for the `g` component. * @param {ColorChannel} [b=r] - The swizzle for
(r, g = r, b = r, a = r)
| 190 | */ |
| 191 | |
| 192 | setTextureSwizzleRGBA(r, g = r, b = r, a = r) { |
| 193 | |
| 194 | const rgba = "rgba"; |
| 195 | let swizzle = ""; |
| 196 | |
| 197 | if(r !== ColorChannel.RED || g !== ColorChannel.GREEN || b !== ColorChannel.BLUE || a !== ColorChannel.ALPHA) { |
| 198 | |
| 199 | swizzle = [".", rgba[r], rgba[g], rgba[b], rgba[a]].join(""); |
| 200 | |
| 201 | } |
| 202 | |
| 203 | this.defines.set("TEXEL", "texel" + swizzle); |
| 204 | this.setChanged(); |
| 205 | |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Updates this effect. |
no test coverage detected