-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Cleanup renderer object creation #640
Comments
In addition material creation is inconsistent with the rest of Cesium. |
4ac0a1e made a minor incremental improvement so shader programs are created with Since the renderer is |
Temporarily removed the Material texture cache: #2850 |
@lilleyse, let's do a pull request for each bullet:
|
@lilleyse here's a few ideas for
var nextRenderStateId = 0;
var renderStateCache = {};
|
@lilleyse |
@lilleyse |
@lilleyse for We'll talk in person about |
It seems safe to move the cache to RenderState since RenderState doesn't seem to store any GL resources. Are there any examples with multiple contexts that I could test with? |
Here's a good start (which clearly works so we are probably OK and I'm sure I thought about this at some point): http://analyticalgraphicsinc.github.io/cesium-google-earth-examples/demos/multiple/ |
After looking closer, it does initialize its viewport width and height with the context drawing buffer's width and height. This may be a problem in some cases. Edit: never mind, it initializes to undefined if an explicit viewport isn't given. |
@lilleyse open future pull requests into the renderer-refactor branch. |
@lilleyse for buffers, also check out the code from our book:
I'm not at all advocating for the same approach, but taking a brief look should help identify strengths and weaknesses. |
Some objects use a create function like
context.createRenderState
; others have an explicit cache likecontext.getShaderCache().getShaderProgram
; and others are just allocated withnew
likeDrawCommand
.Likewise, some things need
destroy
, others needrelease
, and others do not require anything.As we add more caching (CC #638), we'll be able to converge. Details TBA.
The text was updated successfully, but these errors were encountered: