” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”]
The main input at the top of the graph gets a variable called Temperature. This is a float value in a range of 1000-27000 K. The value goes to boolean switch where it can be switched to use a preset value from the list on the left. The input goes to the formula section where the float value is converted from Kelvin to RGB. This is done by the code below.<\/p>\n
” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”][\/vc_column][\/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” color_overlay=”#939393″ overlay_strength=”0.3″ shape_divider_position=”bottom” shape_type=””][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”1\/1″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”]
Set Temperature = Temperature \\ 100<\/span><\/p>\n
\nCalculate Red:<\/span>
\n<\/span> \u00a0\u00a0\u00a0If Temperature <= 66 Then<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Red = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0Else<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Red = Temperature – 60<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Red = 329.698727446 * (Red ^ -0.1332047592)<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Red < 0 Then Red = 0<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Red > 255 Then Red = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0End If<\/span>
\n<\/span> \u00a0\u00a0\u00a0<\/span>
\n<\/span> \u00a0\u00a0\u00a0Calculate Green:<\/span>
\n<\/span> \u00a0\u00a0\u00a0If Temperature <= 66 Then<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Green = Temperature<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Green = 99.4708025861 * Ln(Green) – 161.1195681661<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Green < 0 Then Green = 0<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Green > 255 Then Green = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0Else<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Green = Temperature – 60<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Green = 288.1221695283 * (Green ^ -0.0755148492)<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Green < 0 Then Green = 0<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Green > 255 Then Green = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0End If<\/span>
\n<\/span> \u00a0\u00a0\u00a0<\/span>
\n<\/span> \u00a0\u00a0\u00a0Calculate Blue:<\/span>
\n<\/span> \u00a0\u00a0\u00a0If Temperature >= 66 Then<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Blue = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0Else<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Temperature <= 19 Then<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Blue = 0<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Else<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Blue = Temperature – 10<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Blue = 138.5177312231 * Ln(Blue) – 305.0447927307<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Blue < 0 Then Blue = 0<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If Blue > 255 Then Blue = 255<\/span>
\n<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0End If<\/span>
\n<\/span> \u00a0\u00a0\u00a0End If<\/span>[\/vc_column_text]
I also added some reference temperature colors in description of the Temperature parameter. With the information given the user has a rough idea what to use for light colors. <\/span>[\/vc_column_text][\/vc_column][\/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″ shape_divider_position=”bottom”][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”1\/1″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”]
The preset list is constructed in a common way for easy expandability. It \u2018iterates’ from 0 to 15 int and checks if the value is equal to the set value. Then it sends a temperature value through the if\/else chain to the top, towards the boolean switch.
\n” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”][\/vc_column][\/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″ shape_divider_position=”bottom”][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”1\/1″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”]
” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”][vc_column_text]http:\/\/www.zombieprototypes.com\/?p=210<\/span><\/a>[\/vc_column_text][vc_custom_heading text=”With the new function all setup, the new pixel processor graph looks like this.
\n” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”][\/vc_column][\/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″ shape_divider_position=”bottom”][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”1\/6″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”][\/vc_column][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”2\/3″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”]
There are a couple of features I still want to make for greater capabilities and further ease of use. The option to use a texture map as an input, which will output a color corrected texture based on a color temperature. This would function as a white balance color correction operation.
\nIt would be useful if you could switch between the current preset list and a more detailed list of commonly used lights. This would be really useful for making of custom environment maps.<\/p>\n
I posted the substance (sbar and the sbs) to Substance Share, where you can download it for free. The images in this blogpost are made with the glare post effects in Substance Painter. Without any post effects the output will be an accurate color
\nIf you have any questions, comments or suggestions, feel free to contact me.<\/p>\n
Stay tuned for more.
\n” font_container=”tag:p|text_align:left” google_fonts=”font_family:Open%20Sans%20Condensed%3A300%2C300italic%2C700|font_style:300%20light%20regular%3A300%3Anormal”][vc_column_text]https:\/\/share.allegorithmic.com\/libraries\/4067<\/a>[\/vc_column_text][nectar_icon icon_family=”fontawesome” icon_style=”default” icon_color=”Accent-Color” open_new_tab=”true” icon_padding=”20px” icon_fontawesome=”fa fa-twitter” url=”https:\/\/twitter.com\/QuintVrolijk”][nectar_icon icon_family=”fontawesome” icon_style=”default” icon_color=”Accent-Color” icon_padding=”15px” icon_fontawesome=”fa fa-envelope” url=”mailto:quint@emberglitch.com”][\/vc_column][\/vc_row][vc_row type=”in_container” full_screen_row_position=”middle” scene_position=”center” text_color=”dark” text_align=”left” overlay_strength=”0.3″ shape_divider_position=”bottom”][vc_column column_padding=”no-extra-padding” column_padding_position=”all” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_shadow=”none” column_border_radius=”none” width=”1\/1″ tablet_text_alignment=”default” phone_text_alignment=”default” column_border_width=”none” column_border_style=”solid”][nectar_image_comparison image_url=”1014″ image_2_url=”1013″][vc_raw_html]JTNDdmlkZW8lMjBsb29wJTIwYXV0b3BsYXklMjBtdXRlZCUyMGlkJTNEJTIyaW1wb3J0YW50VmlkZW8lMjIlMjBwb3N0ZXIlM0QlMjJodHRwcyUzQSUyRiUyRmVtYmVyZ2xpdGNoLmNvbSUyRndwLWNvbnRlbnQlMkZ1cGxvYWRzJTJGUHJldmlld1Nob3RfMDFfTG93VGVtcGVyYXR1cmUuanBnJTIyJTNFJTBBJTIwJTIwJTIwJTNDc291cmNlJTIwc3JjJTNEJTIyaHR0cHMlM0ElMkYlMkZlbWJlcmdsaXRjaC5jb20lMkZ3cC1jb250ZW50JTJGdXBsb2FkcyUyRlN1YnN0YW5jZV9Db2xvcl9UZW1wZXJhdHVyZS53ZWJtJTIyJTIwdHlwZSUzRCUyMnZpZGVvJTJGd2VibSUyMiUzRSUwQSUzQyUyRnZpZGVvJTNFJTBBJTBBJTNDc2NyaXB0JTIwdHlwZSUzRCUyMnRleHQlMkZqYXZhc2NyaXB0JTIyJTNFJTBBJTIwJTIwJTIwJTIwJTI0JTI4ZG9jdW1lbnQlMjkucmVhZHklMjglMjhlJTI5JTNEJTNFJTdCJTBBJTIwJTIwJTIwJTIwc2V0VGltZW91dCUyOCUyOGUlMjklM0QlM0UlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjQlMjglMjclMjNpbXBvcnRhbnRWaWRlbyUyNyUyOS50cmlnZ2VyJTI4JTI3cGxheSUyNyUyOSUwQSUyMCUyMCUyMCUyMCU3RCUyQyUyMDEwMDAlMjklN0QlMjklMEElM0MlMkZzY3JpcHQlM0U=[\/vc_raw_html][\/vc_column][\/vc_row]\n","protected":false},"excerpt":{"rendered":"