Skip to main content
added 50 characters in body
Source Link

Question

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

Additional information

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

Gradient with bands of incorrect sizes

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

Gradient texture

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Texture properties in UDK material editor

Above are the properties for this texture. Nothing special here, just the defaults. Specifically, the Adjust Brightness Curve and Adjust RGB Curve properties are set to 1.0 (by default), which seems correct since they are the power to which the HSV and RGB curves must be elevated. The distortion I observed looks a lot like if the values were raised to a given power.

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

Gradient with bands of incorrect sizes

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

Gradient texture

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Texture properties in UDK material editor

Above are the properties for this texture. Nothing special here, just the defaults. Specifically, the Adjust Brightness Curve and Adjust RGB Curve properties are set to 1.0 (by default), which seems correct since they are the power to which the HSV and RGB curves must be elevated. The distortion I observed looks a lot like if the values were raised to a given power.

Question

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

Additional information

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

Gradient with bands of incorrect sizes

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

Gradient texture

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Texture properties in UDK material editor

Above are the properties for this texture. Nothing special here, just the defaults. Specifically, the Adjust Brightness Curve and Adjust RGB Curve properties are set to 1.0 (by default), which seems correct since they are the power to which the HSV and RGB curves must be elevated. The distortion I observed looks a lot like if the values were raised to a given power.

Added image alt text, added screenshot of the texture's properties window.
Source Link

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

enter image description hereGradient with bands of incorrect sizes

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

enter image description hereGradient texture

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Texture properties in UDK material editor

Above are the properties for this texture. Nothing special here, just the defaults. Specifically, the Adjust Brightness Curve and Adjust RGB Curve properties are set to 1.0 (by default), which seems correct since they are the power to which the HSV and RGB curves must be elevated. The distortion I observed looks a lot like if the values were raised to a given power.

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

enter image description here

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

enter image description here

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

Gradient with bands of incorrect sizes

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

Gradient texture

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).

Texture properties in UDK material editor

Above are the properties for this texture. Nothing special here, just the defaults. Specifically, the Adjust Brightness Curve and Adjust RGB Curve properties are set to 1.0 (by default), which seems correct since they are the power to which the HSV and RGB curves must be elevated. The distortion I observed looks a lot like if the values were raised to a given power.

Source Link

Distortion of color space in UDK (material editor)

Using UDK's material editor, I wish to use a texture as a two-dimensional array of values for mathematical computations (basically, the color components of each pixel in the texture alter the behavior of some transformations applied to another texture).

I want to retain rather precise color values for my mathematical operations to keep their meaning, but in my experiments I noticed a heavy distortion of the color space: dark colors are darker than they should be, and light colors are lighter than they should.

This effect is best shown by the following material, which takes a simple linear gradient texture, and applies a rounding operation on the colors:

enter image description here

If the colors were correctly preserved, the preview on the left should have 10 bands of equal length (a black band, a 10% gray band, a 20% gray band etc. with each band being 10% of the width of the image), however the black band is huge, the next (10% gray) one rather large, and the bands get smaller and smaller as they get lighter.

In this example, I take the red channel of the image, but taking the other channels gives similar results: The red and blue channels are identical, and the distortion is slightly different with the green channel, and taking the combination of these logically produces small bands of purple and green between any two bands.

I guess this is a compression issue with the original texure, but I don't know which parameters I should change so the colors are preserved when I use the texture in the material editor.

enter image description here

Above is the texture I used, created with The Gimp. The colors are correct, it is a linear gradient: the color of the pixels in column 0 is (0,0,0), the pixels in the column 255 are (255,255,255) and I manually checked at many points in the image that the pixels in the column x are (x,x,x)).