Texture Processor Tool

Introduction介紹

The 『TextureProcessor.exe』 tool converts image files into a Redshift renderable format. It can be executed automatically during rendering, or used off-line to batch pre-convert textures. It is particularly useful to pre-convert textures off-line when you have a lot of them and you have a shared texture source folder over a network, in which caseautomatic local machine texture conversion can be slower than the actual rendering!

Texture Processor.exe工具用於將貼圖紋理轉換成Redshift自己的格式。格式轉換過程可以在渲染時由渲染器自動完成,也可以在渲染前通過批處理提前轉換。如果貼圖較多,且使用的是共享的網路路徑存儲,那麼提前轉換格式(線下轉換)會很有價值,因為貼圖自動本地轉換過程會降低渲染速度。

The off-line tool converts textures so that the result is stored side-by-side with the source, having the same name and the extension replaced with 「.rs***bin」.

轉換工具會將新生成的貼圖與原始貼圖放在同一路徑中,且文件名相同,只是擴展名改為.rs***bin。

Note 注意

When pre-converting textures, the converted textured must remain side-by-side with the source texture or it will not be found by Redshift. If Redshift does not find a converted texture side-by-side with a source texture, the source texture will be automatically converted during rendering.

如果提權轉化貼圖,必須將新生成的貼圖與原貼圖放在同一個文件夾下,否則Redshift將無法找到它們。如果Redshift沒有找到自已格式的貼圖,就會在渲染過程中調用原始貼圖自動轉換。

Command Line Options命令行選項

The syntax for TextureProcessor.exe is simple:

TextureProcessor.exe的使用方法很簡單

When auto-converting textures at render time, certain information is baked into the converted files based on how the texture is used. For example, the color space of the texture (e.g. sRGB) is used to correctly compute mip maps. When using TextureProcessor to manually pre-convert textures, the usage may need to be specified explicitly since TextureProcessor has no way to determine how the texture is used in your scene. The following command-line options are available to specify usage:

如果用渲染時自動轉換的方式,Redshift將根據這些貼圖的使用方式對其進行轉換。比如,為計算Mip Maps添加所需要的紋理色彩空間(如:sRGB)。當人工調用Texture Processor來進行預先轉換時,TextureProcessor無法知曉貼圖的使用方式,因而需要手工明確為其指定轉換參數。命令行參數包含以下幾個:

-lForce linear gamma (recommended for floating point textures)

-1強制使用Linear Gamma(如果貼圖記錄模式為Floating Point,即浮點數的話應該用此模式)

-s Force sRGB gamma (recommended for integer textures)

-s強制使用sRGB Gamma(如果貼圖記錄格式為Integer,即整數的話應該用此模式)

Note 注意

If no gamma options are specified, TextureProcessor will assume linear gamma for floating point textures and sRGB gamma for integer textures

如果沒有指定Gamma選項,TextureProcessor將為Floating Point貼圖指定Linear Gamma,為Integer貼圖指定sRGB Gamma.

-wx -wyFilter MIP levels with wrapped filtering

-wx-wy指定Fiter MIP級別使用包裹過濾(Wrapped Filtering)

-p Photometric IES data (for IES profile types)

-p 指定Photometric IES數據(用於IES Profile類型)

-isphereImage Based Light (sphere projection)

-isPhere指定Image Based Liht(用於Shere Projection)

-ihemisphereImage Based Light (hemisphere projection)

-ihemisphere指定Image Based Light(用於Hemisphere Projection)

-imirrorballImage Based Light (mirrorball projection)

-imirrorball指定Image Based Light(用於Mirrorball Projection)。

-iangularmapImage Based Light (angular map projection)

-iangularmap指定Image Based Light(用於Angular Map Projection)

-ocolor Sprite Cut-Out Map Opacity (from color intensity)

-oclor指定Sprite Cut-Out Map Opacity (來自於Color intensity)

-oalpha Sprite Cut-Out Map Opacity (from alpha)

-oalpha指定Sprite Cut-Out Map Opacity(來自於Alpha)

By default, TextureProcessor will skip files that it determines have already been converted (based on source and converted time stamps, usage, etc…). This behavior can be disabled by specifying the following command-line option:

默認時,Texture Processor將跳過已經轉換過格式的貼圖(對比源文件和轉換後文件中的Time Stamps和Usage等信息)。這一功能可以通過指定下面的命令行參數來取消:

-noskip Disable the skipping of textures determined to have already been converted

-noskip關閉自動跳過已經轉化的紋理貼圖的功能,即強制轉換。

Note 注意

TextureProcessor supports wildcards for its inputfileargument. For example, to convert all tiff files in the directory path o extures, use the following command:

貼圖處理程序支持Input File一項中使用通配符。例如,為了轉化一個目錄中的所有Tiff文件,使用下面的命令:

Render Time Considerations渲染時間方面的提示

By default when Redshift finds a pre-converted texture during rendering, it will copy it into the local texture cache folder and subsequently reference it from there. The assumption is that the local texture cache folder has better IO performance than the source texture folder, which is common for example when source textures are stored on slower network drives or when the local texture cache folder is on an SSD drive while the source texture folder is on a mechanical drive. In such cases, this is an important optimization as it ensures the best performance for out-of-core texture

streaming.

Redshift渲染時默認會尋找之前轉換後的紋理貼圖,並將它複製到本地貼圖緩存文件夾,然後再從中調用貼圖信息。因為Redshift開發時假設本地貼圖緩存目錄的IO訪問速度較快。如果本地的貼圖緩存路基是在SSD硬碟上,原貼圖保存在機械硬碟上,或者原貼圖保存在一個相對訪問速度較慢的網路路徑中。此時這種方式是一種重要優化。因為它確保了出核(Out-of-Core)紋理最佳的數據流。

In situations where the assumption of differences in IO performance between the local texture cache folder and the source texture folder does not hold, this optimization will actually hurt performance. For example, if the texture cache folder is on a slower network drive or if the texture cache folder and source texture folder are located on the same drive or drives of equal performance. In these cases, the optimization can be disabled by turning OFF the Copy Pre-Converted Textures to Cache Folderoption on the Optimizations tab of the Redshift render options.

假設本地貼圖緩存路徑與原始貼圖路徑的IO性能沒有差別,那麼這種優化反而會損失性能。舉例來說,假如貼圖文件緩存目錄是一個較慢的網路路徑,或者原貼圖文件與紋理緩存目錄在性能相同的驅動器上。此時這個優化就可以取消,即從Redshift渲染設置的Optimizations中,關閉Copy Pre-Converted Textures to Cache Folder


推薦閱讀:

Rock_Volcanic_qjmvT_4K_3d_ms
Redshift System
Redshift for C4D中文說明——材質混合的一些方法
Redshift for C4D中文說明——無限背景的製作
Redshift Global Illumination

TAG:redshift | gpu渲染 | 渲染 |