Difference between revisions of "Wavelengths"
(Better table formatting still) |
|||
(20 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Wavelengths are stored in the ctype field and determine the colour of the elements (e.g. PHOT, FILT, BRAY, BIZR, BIZS and BIZG.) They can be used as storage by setting the wavelengths to a certain amount and read that info by filtering out some wavelengths and letting others through. | Wavelengths are stored in the ctype field and determine the colour of the elements (e.g. PHOT, FILT, BRAY, BIZR, BIZS and BIZG.) They can be used as storage by setting the wavelengths to a certain amount and read that info by filtering out some wavelengths and letting others through. | ||
− | https://powdertoy.co.uk/Browse/View.html?ID=2332971 shows that use. | + | [https://powdertoy.co.uk/Browse/View.html?ID=2332971 This save] shows that use. |
Wavelengths are displayed at the HUD on top of the element name. In a full spectrum, the wavelengths on the left are red, and on the right they are blue. In between are the colours of the rainbow. When it isn't a full spectrum, then some colours will be missing. | Wavelengths are displayed at the HUD on top of the element name. In a full spectrum, the wavelengths on the left are red, and on the right they are blue. In between are the colours of the rainbow. When it isn't a full spectrum, then some colours will be missing. | ||
To set a wavelength, you need to set the ctype to get different wavelength. | To set a wavelength, you need to set the ctype to get different wavelength. | ||
The wavelengths are: | The wavelengths are: | ||
− | |||
− | -- | + | [[File:Wavelengths.png|frame]] |
− | 1 | + | |
− | 2 | + | {| class="wikitable static-row-numbers" style="text-align:right" |
− | 3 | + | |+ Wavelength values (from blue to red) |
− | 4 | + | |- |
− | 5 | + | ! !!Decimal value!!Hexadecimal value |
− | 6 | + | |- |
− | 7 | + | !1 |
− | 8 | + | |1||0x1 |
− | 9 | + | |- |
− | 10 | + | !2 |
− | 11 | + | |2||0x2 |
− | 12 | + | |- |
− | 13 | + | !3 |
− | 14 | + | |4||0x4 |
− | 15 | + | |- |
− | 16 | + | !4 |
− | 17 | + | |8||0x8 |
− | 18 | + | |- |
− | 19 | + | !5 |
− | 20 | + | |16||0x10 |
− | 21 | + | |- |
− | 22 | + | !6 |
− | 23 | + | |32||0x20 |
− | 24 | + | |- |
− | 25 | + | !7 |
− | 26 | + | |64||0x40 |
− | 27 | + | |- |
− | 28 | + | !8 |
− | 29 | + | |128||0x80 |
− | 30 | + | |- |
− | + | !9 | |
+ | |256||0x100 | ||
+ | |- | ||
+ | !10 | ||
+ | |512||0x200 | ||
+ | |- | ||
+ | !11 | ||
+ | |1024||0x400 | ||
+ | |- | ||
+ | !12 | ||
+ | |2048||0x800 | ||
+ | |- | ||
+ | !13 | ||
+ | |4096||0x1000 | ||
+ | |- | ||
+ | !14 | ||
+ | |8192||0x2000 | ||
+ | |- | ||
+ | !15 | ||
+ | |16384||0x4000 | ||
+ | |- | ||
+ | !16 | ||
+ | |32768||0x8000 | ||
+ | |- | ||
+ | !17 | ||
+ | |65536||0x10000 | ||
+ | |- | ||
+ | !18 | ||
+ | |131072||0x20000 | ||
+ | |- | ||
+ | !19 | ||
+ | |262144||0x40000 | ||
+ | |- | ||
+ | !20 | ||
+ | |524288||0x80000 | ||
+ | |- | ||
+ | !21 | ||
+ | |1048576||0x100000 | ||
+ | |- | ||
+ | !22 | ||
+ | |2097152||0x200000 | ||
+ | |- | ||
+ | !23 | ||
+ | |4194304||0x400000 | ||
+ | |- | ||
+ | !24 | ||
+ | |8388608||0x800000 | ||
+ | |- | ||
+ | !25 | ||
+ | |16777216||0x1000000 | ||
+ | |- | ||
+ | !26 | ||
+ | |33554432||0x2000000 | ||
+ | |- | ||
+ | !27 | ||
+ | |67108864||0x4000000 | ||
+ | |- | ||
+ | !28 | ||
+ | |134217728||0x8000000 | ||
+ | |- | ||
+ | !29 | ||
+ | |268435456||0x10000000 | ||
+ | |- | ||
+ | !30 | ||
+ | |536870912||0x20000000 | ||
+ | |} | ||
You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart. | You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart. | ||
− | 30.536870912 ctype for wave 30 = 536870912 | + | 30.536870912 ctype for wave 30 = 536870912, |
− | 1.1 ctype for wave 1 = 1 | + | 1.1 ctype for wave 1 = 1, |
− | 536870912 + 1 = 536870913, | + | 536870912 + 1 = 536870913. So, set the ctype of the PHOT or FILT or whatever to 536870913 to get both wavelengths 30 and 1. |
+ | |||
+ | If you know hexadecimal working with ctypes becomes very easy because every hexadecimal digit represents a cluster of 4 wavelengths. Assume we want to set the second, the fourth, the fifth and the eight wavelength: | ||
+ | wavelength 2 = 0x2, wavelength 4 = 0x8, wavelength 5 = 0x10 and wavelength 8 = 0x80, adding them gives 0x2 + 0x8 + 0x10 + 0x80 = 0x9a. | ||
+ | You can enter hexadecimal values in the console and in the PROP tool by using the 0x prefix. |
Latest revision as of 15:03, 8 October 2023
Wavelengths are stored in the ctype field and determine the colour of the elements (e.g. PHOT, FILT, BRAY, BIZR, BIZS and BIZG.) They can be used as storage by setting the wavelengths to a certain amount and read that info by filtering out some wavelengths and letting others through. This save shows that use. Wavelengths are displayed at the HUD on top of the element name. In a full spectrum, the wavelengths on the left are red, and on the right they are blue. In between are the colours of the rainbow. When it isn't a full spectrum, then some colours will be missing. To set a wavelength, you need to set the ctype to get different wavelength. The wavelengths are:
Decimal value | Hexadecimal value | |
---|---|---|
1 | 1 | 0x1 |
2 | 2 | 0x2 |
3 | 4 | 0x4 |
4 | 8 | 0x8 |
5 | 16 | 0x10 |
6 | 32 | 0x20 |
7 | 64 | 0x40 |
8 | 128 | 0x80 |
9 | 256 | 0x100 |
10 | 512 | 0x200 |
11 | 1024 | 0x400 |
12 | 2048 | 0x800 |
13 | 4096 | 0x1000 |
14 | 8192 | 0x2000 |
15 | 16384 | 0x4000 |
16 | 32768 | 0x8000 |
17 | 65536 | 0x10000 |
18 | 131072 | 0x20000 |
19 | 262144 | 0x40000 |
20 | 524288 | 0x80000 |
21 | 1048576 | 0x100000 |
22 | 2097152 | 0x200000 |
23 | 4194304 | 0x400000 |
24 | 8388608 | 0x800000 |
25 | 16777216 | 0x1000000 |
26 | 33554432 | 0x2000000 |
27 | 67108864 | 0x4000000 |
28 | 134217728 | 0x8000000 |
29 | 268435456 | 0x10000000 |
30 | 536870912 | 0x20000000 |
You can add them together, e.g. to get both wavelengths, 30 (the leftmost and the reddest wavelength) and 1 (the rightmost and the bluest wavelength) in the same spectra, you need to add the corresponding ctypes in the chart. 30.536870912 ctype for wave 30 = 536870912, 1.1 ctype for wave 1 = 1, 536870912 + 1 = 536870913. So, set the ctype of the PHOT or FILT or whatever to 536870913 to get both wavelengths 30 and 1.
If you know hexadecimal working with ctypes becomes very easy because every hexadecimal digit represents a cluster of 4 wavelengths. Assume we want to set the second, the fourth, the fifth and the eight wavelength: wavelength 2 = 0x2, wavelength 4 = 0x8, wavelength 5 = 0x10 and wavelength 8 = 0x80, adding them gives 0x2 + 0x8 + 0x10 + 0x80 = 0x9a.
You can enter hexadecimal values in the console and in the PROP tool by using the 0x prefix.