3
\$\begingroup\$

I, a newbie, have been doing back face culling in javascript for my WebGL app because I didn't know gl.cullFace() existed. Is there any reason to use software-based culling instead of just passing all faces to GPU and let it do the culling?

\$\endgroup\$
4
\$\begingroup\$

No. The GPU has dedicated hardware for the purpose, so it will be far faster, especially compared to Javascript. (I wouldn't do anything that iterates over individual verts / faces in JS!)

\$\endgroup\$
1
\$\begingroup\$

Sometimes, but it depends on your use case and data structures. You can still get a win if your data is set up so that you can cull groups of faces per test, and if doing so doesn't require you to break a batch. Otherwise just let the GPU do it (especially if you have VBOs available).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.