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

Allow updating textures in PostProcessStage #7521

Open
OmarShehata opened this issue Jan 29, 2019 · 1 comment
Open

Allow updating textures in PostProcessStage #7521

OmarShehata opened this issue Jan 29, 2019 · 1 comment

Comments

@OmarShehata
Copy link
Contributor

OmarShehata commented Jan 29, 2019

Similar to #5080, if you are passing a canvas as a uniform to a post process, it will not be updated even if the canvas changes. I believe this is by design, but there doesn't seem to be a way to explicitly update it with the public API.

This Sandcastle will draw a red/blue rectangle to a canvas, and it will force the PostProcessStage to re-create the texture with this private API hack:

stage._texturesToCreate.push({
            name: 'myTexture',
            source: document.querySelector('#customCanvas')
        });

We could make PostProcessStage handle setting it directly like this:

stage.uniforms.myTexture = document.querySelector('#customCanvas');

And it would behave as it does in the above Sandcastle. Doing this currently will crash because it expects that uniform to be a Cesium.Texture object at that point.

Came up on the forum.

@OmarShehata
Copy link
Contributor Author

@lilleyse can we tag this category - graphics and type - enhancement ?

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

2 participants