Commit 86094771 authored by Jan Möbius's avatar Jan Möbius

Christopher:

Uniform pool for render objects
Wireframe of MeshNode2 now uses linewidth

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17547 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d5cc556b
......@@ -2,6 +2,7 @@
in vec3 outGeometryBary;
uniform float lineWidth;
float edgeFactor()
{
......@@ -9,7 +10,7 @@ float edgeFactor()
// http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/
vec3 d = fwidth(outGeometryBary);
vec3 a3 = smoothstep(vec3(0.0), d*1.5, outGeometryBary);
vec3 a3 = smoothstep(vec3(0.0), d*lineWidth, outGeometryBary);
return min(min(a3.x, a3.y), a3.z);
}
......
......@@ -2,6 +2,7 @@
in vec3 outGeometryBary;
uniform float lineWidth;
float edgeFactor()
{
......@@ -9,7 +10,7 @@ float edgeFactor()
// http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/
vec3 d = fwidth(outGeometryBary);
vec3 a3 = smoothstep(vec3(0.0), d*1.5, outGeometryBary);
vec3 a3 = smoothstep(vec3(0.0), d*lineWidth, outGeometryBary);
return min(min(a3.x, a3.y), a3.z);
}
......
// template file for shader generator
uniform float lineWidth;
uniform vec2 screenSize;
void main()
{
const float lineWidth = 0.005;
const vec2 screenSize = vec2(1.0, 1.0);
// start/end points of line
vec4 p0 = gl_in[0].gl_Position;
vec4 p1 = gl_in[1].gl_Position;
......
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