Commit eb5d2183 authored by Martin Schultz's avatar Martin Schultz

changed picking shaders to work with shaderGenerator

parent 3038537a
// returns picking ids of faces in a n-poly mesh
#version 150
#include "colortranslator.glsl"
uniform int pickFaceOffset;
uniform isamplerBuffer triToFaceMap; // maps: triangle id in draw buffer -> face id in input buffer
out vec4 outPickID;
void main()
{
int faceID = texelFetch(triToFaceMap, gl_PrimitiveID).x;
// faceID = gl_PrimitiveID; // debug mode: skip reading from texture-buffer
int pickID = pickFaceOffset + faceID;
outPickID = IntToColor(pickID);
}
\ No newline at end of file
outFragment = IntToColor(pickID);
}
// returns picking ids of vertices
#version 150
in vec4 vertexPickID;
out vec4 outPickID;
......
// returns picking ids of vertices
#version 150
#include "colortranslator.glsl"
uniform int pickVertexOffset;
......
// returns picking ids of vertices
#version 150
#include "colortranslator.glsl"
uniform mat4 mWVP;
......
// picking - all fragments have the same pick id
#version 150
uniform vec4 color;
out vec4 outColor;
......
#version 150
uniform mat4 mWVP;
in vec4 inPosition;
void main()
{
gl_Position = mWVP * vec4(inPosition.xyz, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment