CriWare Unreal Engine
Plug-ins for CriWare solutions.
Loading...
Searching...
No Matches
About color space and gamma value of Sofdec movie

overview

The Unreal Engine uses a Linear RGB (floating point) color space.

Note
The image is converted to the sRGB color space when displayed.

Sofdec movie are encoded in the Rec.601 or Rec.709 (8bit integer) color space for better video compression.
Therefore, in order to use Sofdec movie on the Unreal Engine , you need to convert the YUV colors to RGB colors.

About Textures in Sofde movie

Mana Texture is a UTexture-derived class that contains multiple sub-textures called component textures .
Each component texture holds the sub-pixels of a channel resulting from decoding the movie.

It holds a component texture (Y,U,V) + Alpha component texture (A,E,Z).


Depending on the platform and video codec (Sofdec.Prime, H.264, VP9),
The channels contained in a component texture may be reversed internally.
However, all color channels used in the Unreal Engine UI and APIs always have three (Y, U, V).

About YUV to RGB conversion

If Render to Texture is enabled

The YUV to RGB conversion is done by off-screen rendering to the internal surface of the Mana Texture.
Therefore, Mana Texture itself can be treated as a texture in RGBA format.

When to use a component texture

YUV to RGB conversion can be done using the material function Mana Color Space Converter .
It uses three textures for input (Y, U, V), Depending on the platform and video codec, the number of textures used may vary.

The H.264 codec on iOS outputs this from the decoder in NV12 format (Y,UV), so it is converted using two textures.



To change the color space of a Sofdec movie, use: This can be done from the Details panel under " Material Expression Mana Color Space Converter -> Color Space ".

The color spaces that can be used with the CRIWARE UE plug-in are as follows:

  • Rec.601: Used for standard video.
  • Rec.709: Used in HD movie.

Since Sofdec movie are normally encoded in Rec.601, there is no need to modify them.
Also, on certain platforms, Sofdec movie encoded with H.264 or VP9 codecs will be decoded as RGB format.
In this case, setting the color space has no effect.

About gamma value

Gamma is a value that controls the overall brightness and contrast of a movie.
Increasing the value makes it darker, decreasing the value makes it brighter.

In Sofdec movie,
The YUV colors are converted to sRGB, then gamma-corrected (factor 2.2 to 2.4) and converted to linear RGB.

If Render to Texture is enabled

This can be set in the Gamma Adjustment section of the Mana Texture asset's details panel.
If it is set to 0.0, it will use the default value (2.2).

When to use component textures

You can set this in the Mana Color Space Converter node's details panel in the following way:

Method 1

Enable Use Gamma Exponent and change the value of Const Gamma .

Method 2

Gamma Connect a gamma value to the input.

HDR rendering

The Unreal Engine uses a linear RGB color space with at least 16-bit floating point per channel.
This means that a wider range of tones is available when rendering your scene.
These lighting calculations and rendering processes are called HDRR (High Dynamic Range Rendering) .

Sofdec movie are encoded into YUV color with 8 bit integers per channel.
The range that can be expressed with this gradation is called SDR (Standard Dynamic Range) .

The color space conversion performed by the CRIWARE UE plug-in is SDR → HDR.
Some movie may lose dynamic range and appear inaccurate after conversion.
This issue can occur in scenes with high intensity lighting.

If Render to Texture is enabled

The result of the conversion to linear RGB color space is written to an 8-bit per channel RGBA surface.
This can result in loss of dynamic range and stripes appearing.

As a workaround, enable " Render to Texture -> HDR " in the Mana Texture asset's details panel.
Changes the internal surfaces of a Mana Texture to a 16-bit floating point format per channel.
The number of gradations that can be expressed increases, but it uses approximately twice as much memory.

When to use component textures

The conversion to linear RGB color space is written to the frame buffer, so there is little chance of dynamic range loss.



THIS SERVICE MAY CONTAIN TRANSLATIONS POWERED BY GOOGLE. GOOGLE DISCLAIMS ALL WARRANTIES RELATED TO THE TRANSLATIONS, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF ACCURACY, RELIABILITY, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.