Skip to content
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

Improve DoF #12

Open
6 tasks
dmnsgn opened this issue Feb 14, 2024 · 0 comments
Open
6 tasks

Improve DoF #12

dmnsgn opened this issue Feb 14, 2024 · 0 comments

Comments

@dmnsgn
Copy link
Member

dmnsgn commented Feb 14, 2024

  • optimisation discard if blur radius is negligible
if (centerSize < 0.05) color = texture2D(uTexture, texCoord).rgb;
  • separable dof start/end + falloff
if (manualdof) {
    float a = centerDepth - uFocalLength; // focal plane
    float b = (a - fdofstart) / fdofdist; // far DoF
    float c = (-a - ndofstart) / ndofdist; // near Dof
    blur = (a > 0.0) ? b : c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant