Fixed glsl unsigned conversions in Gregory shaders

This commit is contained in:
David G Yu 2013-06-10 12:32:45 -07:00
parent 2551c32448
commit ffe427dc65
2 changed files with 8 additions and 8 deletions

View File

@ -285,8 +285,8 @@ void main()
output[ID].v.position = input[ID].v.position;
uint start = texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x & 0x00ff;
uint prev = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0xff00;
uint start = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0x00ffu;
uint prev = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0xff00u;
prev=uint(prev/256);
uint np = abs(input[ip].v.valence);
uint nm = abs(input[im].v.valence);
@ -320,7 +320,7 @@ void main()
vec3 Fp = vec3(0.0f,0.0f,0.0f);
vec3 Fm = vec3(0.0f,0.0f,0.0f);
uint prev_p = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + ip)).x)&0xff00;
uint prev_p = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + ip)).x) & 0xff00u;
prev_p=uint(prev_p/256);
vec3 Em_ip;
@ -331,7 +331,7 @@ void main()
Em_ip = input[ip].v.position + input[ip].v.e0*csf(np-3,2*prev_p) + input[ip].v.e1*csf(np-3,2*prev_p+1);
}
uint start_m = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + im)).x)&0x00ff;
uint start_m = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + im)).x) & 0x00ffu;
vec3 Ep_im;
if (input[im].v.valence < -2) {

View File

@ -179,8 +179,8 @@ void main()
output[ID].v.position = input[ID].v.position;
uint start = texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x & 0x00ff;
uint prev = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0xff00;
uint start = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0x00ffu;
uint prev = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + i)).x) & 0xff00u;
prev=uint(prev/256);
// Control Vertices based on :
@ -213,11 +213,11 @@ void main()
uint np = input[ip].v.valence;
uint nm = input[im].v.valence;
uint prev_p = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + ip)).x)&0xff00;
uint prev_p = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + ip)).x) & 0xff00u;
prev_p=uint(prev_p/256);
vec3 Em_ip = input[ip].v.position + input[ip].v.e0*csf(np-3,2*prev_p) +input[ip].v.e1*csf(np-3, 2*prev_p+1);
uint start_m = texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + im)).x&0x00ff;
uint start_m = uint(texelFetch(g_QuadOffsetBuffer, int(4*gl_PrimitiveID+base + im)).x) & 0x00ffu;
vec3 Ep_im = input[im].v.position + input[im].v.e0*csf(nm-3, 2*start_m) + input[im].v.e1*csf(nm-3, 2*start_m+1);
float s1 = 3 - 2*csf(n-3,2)-csf(np-3,2);