uniform sampler2D u_Texture0; uniform sampler2D u_Texture1; uniform sampler2D u_Texture2; // https://qiita.com/zinziroge/items/3676b4e0f7715fa60336 // C:\Users\jeong\testing\theta_uvc_blender_mdk_ver.0.3.0 // https://gist.github.com/dinhnhat0401/12910a5fee2e380051c55e5db752b279 varying vec2 v_TexCoords0; varying vec2 v_TexCoords1; varying vec2 v_TexCoords2; #define v_TexCoords1 v_TexCoords0 #define v_TexCoords2 v_TexCoords0 #define v_TexCoords3 v_TexCoords0 uniform float u_opacity; uniform mat4 u_colorMatrix; uniform mat3 tune360; void main(void) { vec2 fc = v_TexCoords0.st; vec2 src; // Y 축은 상단이 1.0, 하단이 0.0 // 원점 확인 if(fc.x < 0.5) // left { // 좌측 이미지(0.5,1.0)-> 상단이미지(1.0,0.5) src = vec2(fc.x*2.0,0.5+(fc.y*0.5)); } else // right { // 후측 이미지(0.5,1.0)-> 상단이미지(1.0,0.5) src = vec2((fc.x*2.0)-1.0,fc.y*0.5); } gl_FragColor = clamp(u_colorMatrix * vec4(texture2D(u_Texture0, src).r, texture2D(u_Texture1, src).r, texture2D(u_Texture2, src).r, 1.0), 0.0, 1.0); }