I have lookup data(256 values) provided by one software and I want to use this data with shader as written below:
7999745,8000001,8000258,8066051,8066308,8132357,8132614,......
Fragment Shader code:
Help me to pass this data to sampler2D inputimageTexture2.
I am thinking that these should converted to rgb(image texture) somehow, so I can pass this to sampler2D.
7999745,8000001,8000258,8066051,8066308,8132357,8132614,......
Fragment Shader code:
Code:
precision highp float;
uniform sampler2D inputImageTexture;
uniform sampler2D inputImageTexture2;
varying vec2 textureCoordinate;
uniform float uAmount;
void main() {
vec4 color = texture2D(inputImageTexture, textureCoordinate);
vec2 pos = vec2((color.r + color.g + color.b)/ 3.0, 0.0);
vec4 dstColor = texture2D(inputImageTexture2, pos);
gl_FragColor = mix(
color,
dstColor,
uAmount);
}
I am thinking that these should converted to rgb(image texture) somehow, so I can pass this to sampler2D.
Last edited by a moderator: