Custom Post Process filters

Hey guys,

I am a summer student at NICTA, working with Chris Cooper on Doarama. I am getting myself acquainted with Cesium and WebGL so I might have quite a lot of questions in the near future.

I am currently trying to integrate custom post-process filters with the current Cesium master. I found the SunPostProcess integration in Scene.js and I have based my filter integration on this. I have added a few lines to scene.render() in my fork here…

https://github.com/craigsketchley/cesium/blob/postProcess-hook/Source/Scene/Scene.js#L890

I ended up disabling the sun for this implementation. To enable the custom post process, you define the scene.customPostProcess as a CustomPostProcess object, found here…

https://github.com/craigsketchley/cesium/blob/postProcess-hook/Source/Scene/CustomPostProcess.js

What do you think? It would be great to get some feedback. Would there be a much easier way to do this? How could I add a post process filter without disabling the sun?

Hi Craig,

Awesome. Nice to meet you. A few comments:

  • We are changing renderer commands a bit and this will require some minor changes on your end. See #1340.
  • I have an old start to a post-processing framework in the postprocess branch. This is what Doarama originally used. From looking at CustomPostProcess.js, it looks like you already found it.
  • We also have an initial design for post-processing here. I’d want to revisit this before advocating it.
  • If you don’t have a background in computer graphics, I love Eric Haines’ free Udacity course. We also have some recommended reading on the tech used by Cesium.
    Is this something you plan to contribute back to Cesium? If you and Chris are up for it, I’m happy to collaborate more here.

Patrick

Hi Patrick,

Thanks for getting back to me. Nice to meet you too. That Udacity course is great, thanks for the recommendation. I’m working my way through them and learning a lot.

I have had a chat with Chris and we were wondering if you’d like us to submit our postProcess-hook branch to a corresponding Cesium branch to enable post-process filters with the latest version of Cesium? We’d try to keep it up to date and maintained. This could then be used by others to apply custom post-process filters in the meantime until you’ve had a chance to review your initial design for post-processing.

Cheers,

Craig

Hi Craig,

Yes, please have Chris create a branch in the main Cesium repo and then you can merge into that branch (even without a pull request, but everything that goes into master goes through a pull request). This will allow us to remove my original and now out-dated postprocessing branch. If I can find the time, I think I could get into this shape for master in two or three days work. No promises. This would be a very simple implementation for color filters only; no depth-based filters, or custom g-buffers like glow, but there’s a decent chance we could get the foundations right without requiring any breaking changes later.

Patrick

Hi Patrick,

Thanks, we’ve done just that. Chris created postprocess-hook and we have merged these changes into that. I made a further modification allowing access to set custom uniforms. Examples of this are found in CesiumViewer.js.

Cheers,

Craig

Thanks. Will try to have a look soon.

  • Are you guys OK with me removing the old postprocess branch?

  • Can you merge in master and update this for the minor command changes in #1363?

  • Let’s not keep changing CesiumViewer.js. That was a bad habit of mine. It trashes the history. Instead, now I make a new CesiumViewer (like in gltf) and just delete it before merging into master.

  • When this branch lands in master, we’ll be sure to add you to CONTRIBUTORS.md.

Patrick

Hi Patrick,

Thanks for the heads up about the latest changes in master affecting this branch. I’ve updated this and reverted the modified CesiumViewer.js as requested. The old postprocess branch is no longer needed by us, thanks. That is kind of you to offer to add me as contributor, that’s really exciting.

Cheers,

Craig

It seems this was never merged into the master branch, the vignette effect is really cool, would be great to have the option for the post process.

I agree, it’s a cool effect. The post-processing framework is on the roadmap, but it is a ways out. You could create a build off the branch in the meantime.

Patrick

I did actually tried that, but its Cesium 1.1 and it’s master is
1.5? There was some code I already created for 1.5 that didn’t work.
I’ll keep a watch on it.

Hi Trevor,

We’re still actually using that branch somewhat for the themes in Doarama and we’ve discussed updating it to fall in line with the current Cesium release. I think we’re waiting for a few more features in an upcoming Cesium release to justify the time to update. We’ll get round to it but I can’t really say when that might be I’m afraid. It’s good to know someone else would find it useful though.

bump

Any chance of getting this on master any time soon? Until then I’ll be doing an atrocity with glCopyTexSubImage onPostRender

Hi,

We are heads down on 3D Tiles, and don’t have any updates here. We would love to get back to this, but need to get 3D Tiles farther along first.

Patrick