Merge pull request #794 from takahito-tejima/ptex

fix ptex lookup shaders to clamp the patchcoord
This commit is contained in:
David G Yu 2016-03-23 09:53:22 -07:00
commit 100b61b17f
2 changed files with 10 additions and 10 deletions

View File

@ -114,7 +114,7 @@ vec4 PtexLookupNearest(vec4 patchCoord,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID);
vec2 coords = vec2(uv.x * ppack.width + ppack.uOffset,
@ -127,7 +127,7 @@ vec4 PtexLookupNearest(vec4 patchCoord,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);
vec2 coords = vec2(uv.x * ppack.width + ppack.uOffset,
@ -139,7 +139,7 @@ vec4 PtexLookupFast(vec4 patchCoord,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID);
@ -154,7 +154,7 @@ vec4 PtexLookupFast(vec4 patchCoord,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);
@ -169,7 +169,7 @@ vec4 PtexLookup(vec4 patchCoord,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);
@ -203,7 +203,7 @@ vec4 PtexLookupQuadratic(out vec4 du,
sampler2DArray data,
isamplerBuffer packings)
{
vec2 uv = patchCoord.xy;
vec2 uv = clamp(patchCoord.xy, vec2(0), vec2(1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);

View File

@ -114,7 +114,7 @@ float4 PtexLookupNearest(float4 patchCoord,
Texture2DArray data,
Buffer<uint> packings)
{
float2 uv = patchCoord.xy;
float2 uv = clamp(patchCoord.xy, float2(0,0), float2(1,1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID);
float2 coords = float2(uv.x * ppack.width + ppack.uOffset,
@ -127,7 +127,7 @@ float4 PtexLookupNearest(float4 patchCoord,
Texture2DArray data,
Buffer<uint> packings)
{
float2 uv = patchCoord.xy;
float2 uv = clamp(patchCoord.xy, float2(0,0), float2(1,1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);
float2 coords = float2(uv.x * ppack.width + ppack.uOffset,
@ -140,7 +140,7 @@ float4 PtexLookup(float4 patchCoord,
Texture2DArray data,
Buffer<uint> packings)
{
float2 uv = patchCoord.xy;
float2 uv = clamp(patchCoord.xy, float2(0,0), float2(1,1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);
@ -174,7 +174,7 @@ float4 PtexLookupQuadratic(out float4 du,
Texture2DArray data,
Buffer<uint> packings)
{
float2 uv = patchCoord.xy;
float2 uv = clamp(patchCoord.xy, float2(0,0), float2(1,1));
int faceID = int(patchCoord.w);
PtexPacking ppack = getPtexPacking(packings, faceID, level);