Skip to content

Layers Filters TODO

Richard Eakin edited this page Jan 26, 2017 · 1 revision

Copied / pasted from my evernote page:

* questions / discussion:
* 
	* [ ] should a FrameBufferRef's getSize() return the requested size, or actual size of the Fbo?
	* 
		* currently it matches the Fbo one to one, and they are shared among multiple Layers
		* if it returns the actual size, we'll need some other container for the Fbo, that gets shared
		* if they are only used by Filters and internally by Layers, can handle size separately
		* 
			* ex. Filter::Pass


	* [ ] any way to formalize the tex coord scaling needed when textures are larger than requested?
	* 
		* or break into some common functionality
		* reason the scaling is necessary is because of an internal optimizaton (reusing fbos)

	* [ ] figure out proper FrameBuffer caching scheme
	* 
		* right now I'm doing something funky in Layer::processFilters()
		* possibly use the Layer's sub-graph to determine what Fbos can't be used
		* 
			* would need to keep track of each Fbos root view?

		* need to considering things like caching fbos here too (e.g. dropshadows)
		* [ ] some sort of virtual memory scheme?
		* 
			* you ask the Renderer for a ivec2 region and it returns one to you, wrapped up in some object abstracting a FrameBuffer



* [ ] handle border in filter with blur
* 
	* entire border should still be visible, and blurred
	* [ ] FilterBlur::configure() needs to increase the size of the Fbo it wants

* [ ] handle blur with downsampling
* [ ] FilterDropShadow
* 
	* [ ] need to find correct way to blur as the current one is making shadow very thin
	* 
		* could be a matter of downsampling first

	* [ ] look closer at nvidia shader library's dropshadow example
	* [ ] fix shadow offset x direction
	* 
		* negative value goes to right, when it should be left


* [ ]  optimizations
* 
	* [ ] move all calls to gl::drawSolidRect to Renderer / batches
	* [ ] if alpha compositing, share last Filter's FrameBuffer with compositing FrameBuffer
	* [ ] if no alpha compositing necessary, draw last filter directly to canvas

* [ ] tests
* 
	* [ ] test resizing a View with filters, the Filter's configure() methods should be called again
	* [ ] test adding multiple Filters to the same View

* [X] move FilterBlur and FilterDropShadow to Filters.cpp
* 
	* once shaders are complete

* [ ] Persistent Layers
* 
	* necessary for drop shadows to be feasible in real-time
Clone this wiki locally