mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +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 vec4 Color;
|
||||
|
||||
const float gamma = 2.6;
|
||||
const float smoothing = 100.0;
|
||||
// the interpolated normal
|
||||
varying vec4 interpolatedNormal;
|
||||
|
||||
const float gamma = 2.2;
|
||||
const float smoothing = 64.0;
|
||||
const float interiorCutoff = 0.8;
|
||||
const float outlineExpansion = 0.2;
|
||||
|
||||
|
@ -43,5 +46,7 @@ void main() {
|
|||
}
|
||||
|
||||
// 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()$>
|
||||
|
||||
// the interpolated normal
|
||||
varying vec4 interpolatedNormal;
|
||||
|
||||
void main() {
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
|
@ -20,4 +23,7 @@ void main() {
|
|||
TransformCamera cam = getTransformCamera();
|
||||
TransformObject obj = getTransformObject();
|
||||
<$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