pass_emissive.glsl 597 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#version 150

#include "GBufferAccess.glsl"
#include "depthbuffer.glsl"

uniform sampler2D samplerPos;


uniform samplerBuffer samplerMaterial;

uniform vec4 projParams;
uniform vec2 clipPlanes;

in vec2 vTexCoord;
out vec4 outColor;



void main() 
{
  // read G-buffer
  vec3 cEmissive;
  
  int matID = int(floor(texture2D(samplerPos, vTexCoord).y));
  cEmissive = texelFetch(samplerMaterial, matID * 5).xyz;

  
  outColor = vec4(cEmissive, 0);
  
//  outColor = vec4(float(matID) / 100, float(matID) / 100, float(matID) / 100, 1.0);
  
  // compute depth buffer value
  gl_FragDepth = 1.0;
}