mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
Transmit normal to text rendering shader
This commit is contained in:
parent
be261cd038
commit
30fbd37645
2 changed files with 14 additions and 3 deletions
|
@ -14,8 +14,11 @@ uniform sampler2D Font;
|
||||||
uniform bool Outline;
|
uniform bool Outline;
|
||||||
uniform vec4 Color;
|
uniform vec4 Color;
|
||||||
|
|
||||||
const float gamma = 2.6;
|
// the interpolated normal
|
||||||
const float smoothing = 100.0;
|
varying vec4 interpolatedNormal;
|
||||||
|
|
||||||
|
const float gamma = 2.2;
|
||||||
|
const float smoothing = 64.0;
|
||||||
const float interiorCutoff = 0.8;
|
const float interiorCutoff = 0.8;
|
||||||
const float outlineExpansion = 0.2;
|
const float outlineExpansion = 0.2;
|
||||||
|
|
||||||
|
@ -43,5 +46,7 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// final color
|
// final color
|
||||||
gl_FragColor = vec4(Color.rgb, Color.a * a);
|
gl_FragData[0] = vec4(Color.rgb, Color.a * a);
|
||||||
|
gl_FragData[1] = vec4(interpolatedNormal.xyz, 0.0) * 0.5 + vec4(0.5, 0.5, 0.5, 1.0);
|
||||||
|
gl_FragData[2] = vec4(0.0);
|
||||||
}
|
}
|
|
@ -13,6 +13,9 @@
|
||||||
|
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
|
// the interpolated normal
|
||||||
|
varying vec4 interpolatedNormal;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||||
|
|
||||||
|
@ -20,4 +23,7 @@ void main() {
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
<$transformModelToClipPos(cam, obj, gl_Vertex, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, gl_Vertex, gl_Position)$>
|
||||||
|
<$transformModelToEyeDir(cam, obj, gl_Normal, interpolatedNormal.xyz)$>
|
||||||
|
|
||||||
|
interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0);
|
||||||
}
|
}
|
Loading…
Reference in a new issue