Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. glTexImage2D(GL_TEXTURE_2D, 0, GL_R16_SNORM, 512, 512, 0, GL_RED, GL_SHORT, data);
  2.  
  3. layout (binding = 0) uniform sampler2D heightmap;
  4.  
  5. float height = texture(heightmap, inTexCoords).r;
  6.  
  7. glTexImage2D(GL_TEXTURE_2D, 0, GL_R16I, 512, 512, 0, GL_RED, GL_SHORT, data);
  8.  
  9. layout (binding = 0) uniform isampler2D heightmap; // < -- Notice I put isampler here
  10.  
  11. float height = texture(heightmap, inTexCoords).r; // < -- This should return an ivec4, the r value should have my 16 bit signed value, right?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement