holopy3/Assets/PlattarExporter/UnityGLTF/Shaders/TextureUtils/GLTFLinear2sRGB.shader

46 lines
804 B
Text
Raw Permalink Normal View History

2021-01-28 12:07:52 +00:00

Shader "GLTF/Linear2sRGB" {
Properties{
_InputTex("Texture", 2D) = "white" {}
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "GLTFColorSpace.cginc"
struct vertInput {
float4 pos : POSITION;
float2 texcoord : TEXCOORD0;
};
struct vertOutput {
float4 pos : SV_POSITION;
float2 texcoord : TEXCOORD0;
};
sampler2D _InputTex;
int _FlipY;
vertOutput vert(vertInput input) {
vertOutput o;
o.pos = UnityObjectToClipPos(input.pos);
o.texcoord.x = input.texcoord.x;
o.texcoord.y = input.texcoord.y;
return o;
}
float4 frag(vertOutput output) : COLOR {
return linearToSrgb(tex2D(_InputTex, output.texcoord));
}
ENDCG
}
}
}