Overview

Working with “linear color” means lighting and rendering in a color space where the mapping between numeric color values and “absolute color” is a straight line. This is the standard in digital cinema and is the best way to produce realistic lighting. Houdini does all internal color calculations in a linear color space.

However, many image formats, monitors, and some older video production workflows use a non-linear color space. Outputting linear color data in a format that expects non-linear color (that is, that expects gamma to be “baked in”) produces a dark and overly contrasted image. Conversely, loading a non-linear image data (such as sRGB) into a linear pipeline without correction produces an image that is overly bright and washed out.

To avoid this, Houdini converts to/from linear color space when images are loaded and saved/displayed. Houdini applies a default gamma correction of 2.2 to its display, on the assumption the monitor expects image data with pre-baked gamma. When saving images to formats that assume non-linear color space, Houdini converts the data to the image format’s color space or saves the original color space as meta-data (depending on the features of the format).

Why does Houdini work in a linear color space even if the inputs and outputs use non-linear color? Working with linear color gives more accurate arithmetical results, and makes color faster and easier for the computer to deal with. Doubling the numeric values of a color in linear color space doubles the intensity and has no loss of precision. Doubling values in non-linear color space will result in more or less than double the intensity, and may give a loss of precision. In a non-linear color space, summing color contributions from various lights and transparent surfaces would have this problem, giving an unrealistic rendered result.

Background

Gamma correction is rooted in cathode ray tube (CRT) displays. In a CRT, an electron beam excites phosphors on the screen non-linearly: doubling the beam power did not double the brightness of the phosphor. Instead, it responding according to a curve very close to x2.2.

As a result, manufacturers calibrated recording equipment to produce signals with an x1/2.2 response to cancel out the CRT’s non-linear repsonse. This is became known as a “gamma correction of 2.2”.

Even though today CRTS are mostly replaced by film, LCD, and digital technologies and technically it’s no longer really necessary, the 2.2 gamma correction had become a standard. Image formats such as JPEG bake the gamma correction into the pixels to avoid any pre-display correction. Houdini must convert these image formats to linear color when it loads them.

The most common non-linear color spaces are sRGB and REC709, which have minor variations from the gamma 2.2 curve.

Display settings

  • To change the global gamma settings, choose Edit > Color Settings and click the Color correction tab.

  • Houdini allows display gamma correction to color in a variety of places

    MPlay

    Both foreground and background images. Use the color correction toolbar along the bottom.

    Scene View

    All user generated geometry and background images.

    Open the  display options and click the Viewport tab.

    To show the color correction toolbar with more color controls, open the viewport options menu and turn on “Corrections toolbar”.

    Render View

    Foreground and background images. Use the color correction toolbar along the bottom (it is collapsed by default).

    Composite View

    Foreground and background images. Use the color correction toolbar along the bottom.

    Image file browser

    Image previews.

    Color swatches

    Color rectangle shown in Color Editors and color parameters.

    All of these places can also have a look-up table (LUT) applied along with the gamma correction.

  • It is possible to disable color correction for specific areas of Houdini, though this is not recommended.

Importing and exporting linear images

When you import images as textures or compositing layers, Houdini can detect the color space automatically, or assume it to be linear.

  • The File COP has a Linearize Non-Linear Images parameter. Turn this off to assume the image is in linear color space. There is also an Image Color Space parameter which can override the colorspace inferred from the format or stored in the image file before the image is linearized.

  • The Texture VOP has a Source Color Space parameter. Set this to “Linear” to assume the image is in linear color space.

  • Houdini automatically converts images imported as textures for OpenGL rendering or as viewport background images. To avoid this conversion, first load them using a File COP, and then get the texture from the COP using op: syntax.

When saving images, you can output linear images or set an output gamma (assuming the image format supports it).

  • The Composite render node has a Convert to image format's colorspace parameter. If this parameter is on, the node uses the Output gamma parameter to set the gamma to bake in. If conversion is off, the image data is written without correction.

  • The Image Save file dialog (available when you right click a compositing node and choose Save image) works the same as the Composite render node.

Image Formats

Format Color space  
Houdini .pic

Stores the color space as per-plane meta-data.

Houdini .rat

2.2 gamma for 8 bit planes, linear for other plane formats

OpenEXR, Targa

Linear

PNG, JPEG, TIFF

sRGB

Other

If the data is stored in 8 bit fixed format, it is assumed to be sRGB, otherwise linear

Note

Custom image formats implemented using plugins can specify their color spaces using IMG_Format virtual methods. See the HDK documentation for more information.

MPlay

MPlay is the image preview/display program included with Houdini.

By default, MPlay applies a 2.2 gamma correction. This indicates the color space to view the image in. For example, if you load a JPEG (which is pre-corrected to sRGB, very close to 2.2 gamma), the viewer does not alter the image. However, if you load a linear image (for example, a floating point .rat texture), the viewer will correct it to 2.2 gamma. (While if you set the display gamma to 1.0, the JPEG would be corrected and the RAT not corrected.)

In other words, it is not a gamma that is unconditionally applied to image, but rather a “target” gamma that the viewer may have to alter the data to achieve.

  • You can set the display gamma in the  display options, on the Corrections tab.

  • You can start it with the -g gamma option to set the viewer gamma correction on launch.

  • By default, MPlay does not gamma correct image planes it knows to contain geometric data, such as PPzNBVM, and Af.

  • When you render and image or flipbook to MPlay (using the ip special file), the color space is passed along with the image data (usually linear), so color correction is applied when needed.

  • Flipbooking only the “beauty pass” will send linear color to MPlay, while flipbooking the entire viewport (with handles and other UI) uses the same color space as the viewport (2.2 gamma by default).

Tips

  • Set your monitor to sRGB color mode, or calibrate it to a 2.2 gamma. Many monitors without calibration have display gammas between 2.1 and 2.4, which can subtly change the image.

  • The OpenGL 1.1 viewport mode (Edit > Preferences > 3D viewports, Scene renderer option) is not able to perform gamma correction on the scene view.

  • The Gamma COP does not change color spaces. It bakes a correction into the pixels of the image, but the resulting data is still in the linear color space. You can use it to apply or undo gamma correction, or as a way to control image contrast.

  • Visit opencolorio.org for information on color spaces and for tools to generate Houdini LUT files.

  • To globally disable linear workflow, set HOUDINI_IMAGE_DISPLAY_GAMMA to 1.0 and HOUDINI_AUTOCONVERT_IMAGE_FILES to 0 (defaults of 2.2 and 1, respectively).

Rendering Linear lighting and color相关推荐

  1. Part I 空气曲棍球 Chapter4 (4.4 Rendering with the New Color Attribute)

    4.4 使用新的颜色进行渲染(Rendering with the New Color Attribute) 现在我们已经在顶点数据中增加了一个颜色属性数据并且已经更新了相应的顶点着色器及片元着色器, ...

  2. 【lighting】Color and Vision

    The Electromagnetic and Visible Spectra 原文:http://www.physicsclassroom.com/class/light/Lesson-2/The- ...

  3. Forward vs Deferred vs Forward+ Rendering with DirectX 11

    原文:http://www.3dgep.com/forward-plus/ Introduction Forward rendering works by rasterizing each geome ...

  4. Real-Time Rendering——Chapter 9 Global Illumination

    radiance is the final quantity computed by the rendering process. 渲染的最终结果是计算辐射率.我们使用反射率方程进行求解. so fa ...

  5. Part I 空气曲棍球 Chapter4 Adding Color and Shade)

    由于后面的章节篇幅比较大点,所以我们会把每一章单独分成几篇文章来写(后面将采用这种模式,除非篇幅比较小). 在实际中,每个物体都会有不同的颜色:比如我们的家里面的墙壁,它都是使用同一种颜色进行粉刷的, ...

  6. Avoiding 16 Common OpenGL Pitfalls(避免 16 个常见的 OpenGL 陷阱)

    前言 避免 16 个常见的 OpenGL 陷阱原文 Avoiding 16 Common OpenGL Pitfalls Copyright 1998, 1999 by Mark J. Kilgard ...

  7. iOS 苹果官方Demo

    GitHub 文章链接地址, 欢迎Star+Fork Mirror of Apple's iOS samples This repository mirrors Apple's iOS samples ...

  8. iOS 苹果官方Demo合集

    转自:https://github.com/WildDylan/appleSample Mirror of Apple's iOS samples This repository mirrors Ap ...

  9. 我理解的伽马校正(Gamma Correction)

    [图形学]我理解的伽马校正(Gamma Correction) 2015年05月30日 18:22:52 妈妈说女孩子要自立自强 阅读数:69844 版权声明:本文为博主原创文章,未经博主允许不得转载 ...

最新文章

  1. JShell:Java REPL综合指南
  2. R 语言排名破纪录,一不小心把 PHP 比下去了 | 7月编程语言排行
  3. JavaScript OOP(2)定义JavaScript类
  4. Qt中的QFontDialog
  5. Intel Realsense D435 opencv 为什么将color图转换成灰度图后,再与depth图水平堆叠,其结果一片黑色?(数据未map到0-255)
  6. 第一行代码学习笔记第十章——探究服务
  7. 一个简单的时间片轮转多道程序内核代码分析
  8. java文件与bean所定义的_Spring定义bean的三种方式和自动注入
  9. 线程八锁,同步锁的应用
  10. equals 跟== 的区别
  11. 如何调试神经网络参数
  12. 计算机二级考试vb内容,计算机二级VB考试考什么内容?(一)
  13. ubuntu 16.04 镜像下载
  14. 自考《数据库系统原理》(3)之关系模式设计理论
  15. python_使用需要的气象台站提取气象数据
  16. 线结构光平面方程自动标定
  17. 【小程序项目开发 --- 京东商城】 启航篇之uni-app项目搭建
  18. 什么是360度全景图,360度全景图有什么用
  19. proteus三输入与非门名字_proteus元件名称中文名说明
  20. 基于Java+SpringBoot+Vue前后端分离商城系统设计与实现

热门文章

  1. ios main函数之前的操作_添加函数在ARM在进入main函数之前
  2. 软件测试常见笔试面试题(一)
  3. php mkdir 无效,PHP mkdir()无写权限的问题解决方法
  4. java web 常用工具类_Javaweb常用工具类及配置文件备份
  5. 内存条上面参数详解_价格极低的国产颗粒内存条:光威弈系列Pro评测,超频表现超稳定...
  6. chrome应用程序无法启动因为并行配置不正确_Win8打不开软件提示并行配置不正确的解决方法...
  7. android串口工具apk_【APK】一个强大的Android开发工具!
  8. 栈的pop和peek_从堆栈中移除项目,而不使用pop、peek、push
  9. cp和scp复制命令
  10. 大数据学习笔记31:Java程序访问高可用Hadoop集群