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

Excessive CPU time spent on WebGLRenderer.setProgram #153

Open
fallenoak opened this issue Jun 10, 2016 · 3 comments
Open

Excessive CPU time spent on WebGLRenderer.setProgram #153

fallenoak opened this issue Jun 10, 2016 · 3 comments
Labels

Comments

@fallenoak
Copy link
Member

fallenoak commented Jun 10, 2016

Even when a scene has fully loaded and the camera is stationary, uniform uploads seem to be burning a rather large amount of CPU time. What's happening?

@fallenoak fallenoak added the bug label Jun 10, 2016
@fallenoak
Copy link
Member Author

I might be mistaken on this... it looks like the flag goes away once the group is rendered once. However, something is clearly burning cycles on uniform updating...

@fallenoak fallenoak changed the title WMO materials are perpetually flagged with needsUpdate Something chews CPU time on uniform uploads Jun 10, 2016
@fallenoak fallenoak added question and removed bug labels Jun 10, 2016
@fallenoak
Copy link
Member Author

fallenoak commented Jun 14, 2016

The biggest culprit might be context switches between different textures (ie calls to bindTexture and activeTexture). In particular, probably because of layering, terrain tends to cause a lot more of these calls than, say, a few WMOs or doodads.

Not sure what the best way to reduce these context switches would be.

@fallenoak fallenoak changed the title Something chews CPU time on uniform uploads Excessive CPU time spent on WebGLRenderer.setProgram Jun 14, 2016
@fallenoak
Copy link
Member Author

It would appear that objects with transparent materials are sorted by depth, whereas opaque objects are sorted by material. We're overusing transparent materials for M2s: the no-backface-culling flag and blending mode 1 both cause transparent flagging, even though neither case ought to necessitate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant