Okay, so I've got tessellation stage working on Dolphin. Textures, normals, everything displays fine. But I have to apply a projection to implement the PN triangles algorithm to give my new vertices "depth" from their original mesh.
Problem is, Dolphin seems to be doing something strange with the w component of vertices/normals. If I chop it off, and place it back with an identity, I lose essentially all drawing that'd not a 2-D overlay.
And if I keep those vec4's, my projection function:
vec4 ProjectToPlane(vec4 Point, vec4 PlanePoint, vec4 PlaneNormal)
{
vec4 v = Point - PlanePoint;
float Len = dot(v, PlaneNormal);
vec4 d = Len * PlaneNormal;
return vec4(Point- d);
}
Seems to do jack all, while it's supposed to work fine and is straight from an online example and seems to line up exactly with the algorithm. (Except I changed from vec3's to vec4's.)
Also, what would be the easiest way to get access to the current program shader id from within frame.cpp? I'd like to add a key to change the current tessellation level in real-time, so I tried to work around Free Look. But I couldn't figure out how to get the namespaces/variable names to compile.
Problem is, Dolphin seems to be doing something strange with the w component of vertices/normals. If I chop it off, and place it back with an identity, I lose essentially all drawing that'd not a 2-D overlay.
And if I keep those vec4's, my projection function:
vec4 ProjectToPlane(vec4 Point, vec4 PlanePoint, vec4 PlaneNormal)
{
vec4 v = Point - PlanePoint;
float Len = dot(v, PlaneNormal);
vec4 d = Len * PlaneNormal;
return vec4(Point- d);
}
Seems to do jack all, while it's supposed to work fine and is straight from an online example and seems to line up exactly with the algorithm. (Except I changed from vec3's to vec4's.)
Also, what would be the easiest way to get access to the current program shader id from within frame.cpp? I'd like to add a key to change the current tessellation level in real-time, so I tried to work around Free Look. But I couldn't figure out how to get the namespaces/variable names to compile.