first commit
This commit is contained in:
56
project/fm_viewer/fav/shaders/dual.fsh
Normal file
56
project/fm_viewer/fav/shaders/dual.fsh
Normal file
@@ -0,0 +1,56 @@
|
||||
uniform sampler2D u_Texture0;
|
||||
uniform sampler2D u_Texture1;
|
||||
uniform sampler2D u_Texture2;
|
||||
|
||||
// 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;
|
||||
|
||||
// DEFISH
|
||||
float PI = 3.14159265358979;
|
||||
float _THETA_S_Y_SCALE = 640.0/720.0;//(1080.0 / 1920.0);
|
||||
|
||||
float radius = 1.0;
|
||||
//uniform vec4 uvOffset;
|
||||
//uniform vec2 radiusOffset;
|
||||
uniform mat4 tune360; // [0] = left [wzr], [1] right [yxr]
|
||||
uniform int resolution; // 0:FHD, 1:HD, 2:SD
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 st = v_TexCoords0.st;
|
||||
bool front = (tune360[0][0] > 0.5);
|
||||
|
||||
vec2 fc;
|
||||
if (front)
|
||||
{
|
||||
fc = vec2(st.x,min(st.y*0.5,0.499)); // 이거 왜하는거지???
|
||||
}
|
||||
else
|
||||
{
|
||||
fc = vec2(st.x,0.5001+st.y*0.5);
|
||||
}
|
||||
|
||||
// CLIP LEFT 1PX
|
||||
if(resolution == 2)
|
||||
{
|
||||
//fc.x = clamp(fc.x,0.0,0.90);
|
||||
//gl_FragColor = vec4(1.0,0.0,0.0,1.0);
|
||||
//return;
|
||||
}
|
||||
|
||||
gl_FragColor = clamp(u_colorMatrix
|
||||
* vec4(texture2D(u_Texture0, fc).r,
|
||||
texture2D(u_Texture1, fc).r,
|
||||
texture2D(u_Texture2, fc).r,
|
||||
1.0), 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user