SPIRV-Cross/shaders-hlsl/frag/tex-sampling.frag

64 lines
2.0 KiB
GLSL
Raw Normal View History

2017-04-21 09:46:10 +00:00
#version 450
uniform sampler1D tex1d;
uniform sampler2D tex2d;
uniform sampler3D tex3d;
2017-04-21 12:55:01 +00:00
uniform samplerCube texCube;
2017-04-21 15:52:04 +00:00
uniform sampler1DShadow tex1dShadow;
uniform sampler2DShadow tex2dShadow;
uniform samplerCubeShadow texCubeShadow;
2017-04-24 09:08:55 +00:00
uniform sampler1DArray tex1dArray;
uniform sampler2DArray tex2dArray;
uniform samplerCubeArray texCubeArray;
in float texCoord1d;
in vec2 texCoord2d;
in vec3 texCoord3d;
2017-04-24 09:08:55 +00:00
in vec4 texCoord4d;
2017-04-21 09:46:10 +00:00
out vec4 FragColor;
2017-04-21 15:52:04 +00:00
void main()
{
vec4 texcolor = texture(tex1d, texCoord1d);
texcolor += textureOffset(tex1d, texCoord1d, 1);
texcolor += textureLod(tex1d, texCoord1d, 2);
texcolor += textureGrad(tex1d, texCoord1d, 1.0, 2.0);
texcolor += textureProj(tex1d, vec2(texCoord1d, 2.0));
texcolor += texture(tex1d, texCoord1d, 1.0);
texcolor += texture(tex2d, texCoord2d);
texcolor += textureOffset(tex2d, texCoord2d, ivec2(1, 2));
texcolor += textureLod(tex2d, texCoord2d, 2);
texcolor += textureGrad(tex2d, texCoord2d, vec2(1.0, 2.0), vec2(3.0, 4.0));
texcolor += textureProj(tex2d, vec3(texCoord2d, 2.0));
texcolor += texture(tex2d, texCoord2d, 1.0);
texcolor += texture(tex3d, texCoord3d);
texcolor += textureOffset(tex3d, texCoord3d, ivec3(1, 2, 3));
texcolor += textureLod(tex3d, texCoord3d, 2);
texcolor += textureGrad(tex3d, texCoord3d, vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0));
texcolor += textureProj(tex3d, vec4(texCoord3d, 2.0));
texcolor += texture(tex3d, texCoord3d, 1.0);
2017-04-21 12:55:01 +00:00
texcolor += texture(texCube, texCoord3d);
texcolor += textureLod(texCube, texCoord3d, 2);
texcolor += texture(texCube, texCoord3d, 1.0);
2017-04-21 15:52:04 +00:00
texcolor.a += texture(tex1dShadow, vec3(texCoord1d, 0.0, 0.0));
texcolor.a += texture(tex2dShadow, vec3(texCoord2d, 0.0));
texcolor.a += texture(texCubeShadow, vec4(texCoord3d, 0.0));
2017-04-24 09:08:55 +00:00
texcolor += texture(tex1dArray, texCoord2d);
texcolor += texture(tex2dArray, texCoord3d);
texcolor += texture(texCubeArray, texCoord4d);
texcolor += textureGather(tex2d, texCoord2d);
texcolor += texelFetch(tex2d, ivec2(1, 2), 0);
2017-04-21 09:46:10 +00:00
FragColor = texcolor;
}