-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSAO isn't working with model without normals #1553
Comments
Shader G-buffer output (last image is black but it should contain the normals) Fragment output is set with: fragOutput2 = vec4(normalVCVSOutput, 1.0); But without normal, the shader contains: // Generate the normal if we are not passed in one
vec3 primitiveNormal;
if (primitiveSize == 1) {
primitiveNormal = vec3(0.0, 0.0, 1.0);
}
else if (primitiveSize == 2) {
float addOrSubtract = (dot(fdx, fdy) >= 0.0) ? 1.0 : -1.0;
vec3 lineVec = addOrSubtract*fdy + fdx;
primitiveNormal = normalize(cross(vec3(lineVec.y, -lineVec.x, 0.0), lineVec));
}
else {
primitiveNormal = normalize(cross(fdx, fdy));
if (cameraParallel == 1 && primitiveNormal.z < 0.0) {
primitiveNormal = -1.0*primitiveNormal;
}
if (cameraParallel == 0 && dot(primitiveNormal, vertexVC.xyz) > 0.0) {
primitiveNormal = -1.0*primitiveNormal;
}
}
vec3 vertexNormalVCVS = primitiveNormal;
vec3 normalizedNormalVCVSOutput = normalize(vertexNormalVCVS); So I'd say we should do something like: fragOutput2 = vec4(normalizedNormalVCVSOutput, 1.0); |
Fixed by updating VTK in f3d-app/f3d-docker-images#18 |
So this was F3DWeb specific right ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When there's no normals on the model, SSAO is not working properly
To Reproduce
Steps to reproduce the behavior:
Expected behavior
SSAO should work with generated flat normals
The text was updated successfully, but these errors were encountered: