Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "float map(float val, float A, float B, float a, float b) \n"
- "{ \n"
- " return (val - A) * (b - a) / (B - A) + a; \n"
- "} \n"
- " \n"
- "void main() \n"
- "{ \n"
- " vec4 ndc = VP * M * vec4(position, 1); \n"
- " \n"
- " gl_Position = ndc; \n"
- " float u = map(ndc.x / ndc.w, -1, 1, 0, 1); \n"
- " float v = map(ndc.y / ndc.w, -1, 1, 0, 1); \n"
- " f_texCoords = vec2(u, v); \n"
- "}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement