More seperate cc files, font & overlay rendering
This commit is contained in:
11
shaders/overlay.fs
Normal file
11
shaders/overlay.fs
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 330 core
|
||||
|
||||
uniform sampler2D texBase;
|
||||
|
||||
in vec2 fragTC;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main(void) {
|
||||
color = texture(texBase, fragTC);
|
||||
}
|
||||
13
shaders/overlay.vs
Normal file
13
shaders/overlay.vs
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 330 core
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout(location = 0) in vec2 vertex;
|
||||
layout(location = 1) in vec2 vertexTC;
|
||||
|
||||
out vec2 fragTC;
|
||||
|
||||
void main(void) {
|
||||
vec4 pos = vec4(vertex, 0.0, 1.0);
|
||||
gl_Position = pos;
|
||||
fragTC = vertexTC;
|
||||
}
|
||||
@@ -8,15 +8,17 @@ uniform samplerCubeShadow texShadowMaps[lights];
|
||||
float VectorToDepth (vec3 Vec)
|
||||
{
|
||||
vec3 AbsVec = abs(Vec);
|
||||
float LocalZcomp = max(AbsVec.x, max(AbsVec.y, AbsVec.z));
|
||||
//float LocalZcomp = max(AbsVec.x, max(AbsVec.y, AbsVec.z));
|
||||
float LocalZcomp = length(AbsVec);
|
||||
|
||||
// Replace f and n with the far and near plane values you used when
|
||||
// you drew your cube map.
|
||||
const float f = 128.0;
|
||||
const float n = 1.0;
|
||||
|
||||
float NormZComp = (f+n) / (f-n) - (2*f*n)/(f-n)/LocalZcomp;
|
||||
return (NormZComp + 1.0) * 0.5;
|
||||
// float NormZComp = (f+n) / (f-n) - (2*f*n)/(f-n)/LocalZcomp;
|
||||
return (f/(f-n))+(f*n/(n-f))/LocalZcomp;
|
||||
//return (NormZComp + 1.0) * 0.5;
|
||||
}
|
||||
|
||||
in vec2 fragTC;
|
||||
@@ -27,7 +29,7 @@ in vec3 lightVecs[lights];
|
||||
|
||||
out vec4 color;
|
||||
|
||||
const float bias = 0.00;
|
||||
const float bias = 0.0;
|
||||
|
||||
void main(void) {
|
||||
vec4 texColor = texture(texBase, fragTC);
|
||||
|
||||
Reference in New Issue
Block a user