User:Hypersomniac/Foundation/2017

Week 51: 4th - 10th December
I started investigating why Motion blur does not work in ogl render. Seems the problem is deeply rooted and require a bit more time to finish fixing. I still started to work it out.
 * Info
 * General development
 * Various fixes for intel GPUs:, Fix SSR and SSAO on intel
 * Some codestyle/cleanup.

Going into vacation for 3 weeks, see ya in 2018!
 * Next week

Week 50: 20th - 3rd December
I've added the irradiance visibility (shadowing) that reduce the indirect light bleeding issues caused by light grid. I've also enabled the smooth backface test that can make the surfaces that are near probes a bit "pinchy" (see blue ceilling in the no_leak image attached). In the other hand the other objects like the lucy model here have better lighting. The visibility tweaking is done per grid and is simillar to the variance shadow map parameters. Instead of following the planning, we agreed that I should focus on bugfix and paying technical depts.
 * Info
 * General development
 * Added Irradiance Visibility: see more details.
 * Made the Irradiance Pool size dynamic, thus saving memory
 * Fix light bounce > 1: It has been broken for a long time.
 * Next week

Week 49: 19th - 26th November
SSS translucency has been added and has great quality. Additional work / bugfixes were done for the SSS. Object Motion blur seems to be problematic. Even current camera blur is really hacky and should be done again more properly. I may prioritize other tasks.
 * Info
 * General development
 * SSS Translucency : This is done by precomputing a translucence profile based on Cycles SSS diffusion. We make some assumptions so the result may be brighter than Cycles reference but it's far more accurate than just applying the same profile as in the Screen space.
 * SSS : Support for separated albedo/diffuse texture. This retains the details of the albedo map by applying it after the Screen space convolution. This is optional since it adds quite a bit of overhead.
 * SSS objects do not appear black in probe capture anymore.
 * Principled BSDF SSS now can have it's scale controlled via textures (but still uses the default radius vector for its profile)
 * Next week

Week 49: 13th - 19th November
SSS has been committed and all profiles type are supported. I still want to finish the translucency effect (even with the inherent artifacts / approximation) before moving on to something else. Finish SSS Translucency and continue to follow planning.
 * Info
 * General development
 * SSS : Support for Gaussian profile (initial implementation).
 * SSS : Support for Cubic profile.
 * SSS : Support for Christensen-Burley profile. Do note that this is an approximation and can be a bit more diffused than cycles reference.
 * Fixed a bug when editing material with multiple BSSDF.
 * Found a bug in Cycles cubic SSS profile that will break old files if fixed.
 * Started Adding translucency to SSS. I tried to minimize the artifacts that came with shadow filtering but it's not worth the trouble of adding complexity to the material setup an biasing result. But since it's prone to artifacts, I will make it optionnal.
 * Next week

Week 48: 6th - 12th November
SSS implementation is nearly finished. Will be posted in the next few days. To use it, you will need to enable it BOTH in the material options tab of your material and in the render settings. Only the gaussian profile is implemented for now. However, the scale parameter CAN actually be modified by textures and other crazy node setup. The number of different SSS Shader in a scene is limited to 255. I'll finish the initial SSS implementation and add work on polishing it.
 * Info
 * General development
 * Screen Space SubSurface Scattering: This is a screen space post process that "blur" the diffuse light reflected by an object. For this reason, it does not produce thin object translucency (red ears effect) and has problems like light bleeding. The radius input is baked into a 1d texture so you cannot control the RGB radii by using a texture or any other input, you have to change the default vector parameter (the one that appears when nothing is linked into this socket).
 * Reworked the stencil buffer / operation support in the draw manager (was needed for the SSS)
 * Next week

Week 47: 30th - 5th November
Research on realtime SSS lead me beleive the most efficient solution for this is the Separable SubSurface Scattering. Although it's still not clear to me how to parametrize the 1D kernel. I'll focus on SSS inplementation.
 * Info
 * General development
 * Fixed some problems related to volumetrics.
 * Optimized Drawmanager memory allocation leading to significant performance improvement with Eevee.
 * Next week

Week 46: 23rd - 29th October
Finished implementing the new volumetric implementation now supporting volume objects.
 * General development
 * Theses are limited to the bounding sphere of the object for now (no voxelisation).
 * It also supports the fluid simulation informations (see image).
 * Volume material nodes in object material is now working and mimics cycles behaviour (invisible surface if only a volume closure is conected).

I'll focus on fixing bug and start investigating SSS.
 * Next week

Week 45: 16th - 22nd October
I had a hard time to figure the depth distribution function. But all went well after that. This new implementation has not been pushed yet! I still have to finish some of the polishing of the temporal supersampling before implementing object volumetrics. These might be restricted to volume domain for the moment because they already have a voxelization method and a volume texture ready to be used. During the implementation I realised that using a compute shader is a must to reduce the computation time to a minimum (specially during the integration phase). So right now I'm not using a compute shader (compatibility first) so the computation time can still be high. The pros and cons of this new method. Pros: Cons:
 * Info
 * General development
 * Unified volumetric pipeline (world, object, fluid sim).
 * lower computation time.
 * No upsample artifacts.
 * Works with transparency. (not implemented yet
 * Very high Vram usage (use several HDR 3D textures)
 * Require Volumetric shadowmap to correctly handle light decay within a volume. (not implemented yet)
 * Subject to trailling artifacts (not in render).
 * Can be low resolution

Finish the new volumetric implementation and bugfix.
 * Next week

Week 44: 9th - 15th October
I had my new AMD gpu installed and it required a bit of work to get up and running. It also lead to a bug that is making eevee pretty much non workable on this particular GPU. After isolating the problem in a pretty simple program (https://github.com/dfelinto/opengl-sandbox/blob/downsample/README.md), I made a workaround to this problem. I also started investigating the volumetrics overhaul. Focus on the volumetric overhaul by folowing Frosbite unified volumetric rendering.
 * Info
 * General development
 * Fixed a rather problematic issue: Due to small floating point format (R11F_G11F_B10F) the accumulation of many frames was making the blue color converge to a lower value than the other color, giving a yellowish tone to the image. Using RGB16F for all concerned render target fixed the issue (but not totally, but all colors are drifting the same way now).
 * Added cubemap resolution option: That said, I did not change the number of samples used in the filtering process, this might produce low quality filtering on higher probe settings.
 * Fixed the contact shadows : there was a backface check that was making the firsts pixels of the contact shadow to fail the shadow test and thus leaking light. This is fixed.
 * Several bug fixes :
 * Next week

Week 43: 2nd - 8th October
I tried to improve "compilation" time (linking time to be precise) by reducing the amount of branching in the shader. But this failed and every solution lead to an increase of linking time. I now have an AMD gpu with mesa driver which is much more prone to visual glitches if I don't code correctly. Right now Eevee's completely broken on this setup and I need to fix it before anything else. Fixing Eevee on mesa so I can go on implementing other features. I have also a few fixes to make before starting to implement Volumetric objects.
 * Info
 * General development
 * Added Contact shadows: They helps fix lightleaking from shadowmaping techniques. These are to be enabled per light under the shadow tab.
 * Helped optimize Gawain: Gawain is constructing a shader interface for each shader after compilation. Previous behaviour was to scan for all active uniforms, but using Array of structure in uniform blocks (UBO) made this unpractical. Now we only query needed uniforms' locations. Reducing Uniforms count to ~50 (previously ~5000). This reduction let us reduce the number of buckets used to quickly access uniforms and improve lookup time.  Also I made the commonly requested uniforms as "builtin" improving lookup time even further.  Main bottleneck now is Draw Manager memory alloc/free.
 * Add uniform block location to Gawain Shader Interface.
 * Made SSR not affected by AO, giving more correct results.
 * Finish Fixing probe display.
 * Modified Eevee's panels to be more consistent and easy to use.
 * Next week

Week 42: 25th - 1st October
There is still some problem with probes updates that needs to be figured out. Then I'll follow the planning (link to planning) and tackle some important issues.
 * General development
 * TAA : Removed the Upper limit of 32 samples.
 * Probes: Add probes data outlines and selectability
 * Probe Grid: Add "progressive rendering" This gives the user a more rapid preview of what the final result will be.
 * Probe Grid: Add a setting for the number of indirect light bounce.
 * Next week

Week 41: 18th - 24th September
The development planning for the near future of Eevee has been posted here. This week was focused on Anti-Aliasing. I encountered several problems : My first Idea was to use FXAA for everything in the viewport. While this was pretty efficient, it does not handles 1px lines like the non-mesh objects (lamps, empties,...). Second Idea was to use TAA for everything. The problem with this is that it would be done at the end of the pipeline and progressive renderer like cycles would not work and produce undesired results (noise from first frame getting stuck in history buffer). Third Idea was to use a separate the object mode TAA and composite it on top of the render. But this would not work for outlines and edit mode engine. So the final solution I settled with was to use a separate AA technique for each use case. There is still some things to be solved, since Eevee's TAA jitters the View Projection matrix, we need to make sure the mode engines that are overlaid on top are not fighting with the jittered depth. Also, as much as I would like to see TAA + reprojection, this will have to wait for correct motion blur for everything, see this article about it. Finish AA implementation. Polishing or Probes.
 * Info
 * General development
 * For Outlines, use FXAA since the outline detection is already a post process. Unfortunately, the FXAA must run (in this case) on the alpha of the line and not the color, leaving transition between colors aliased.
 * For Non Meshes objects, use MSAA. (this is the most inefficient technique considering Vram usage though).
 * For Edit Mesh Mode, Use a linear function instead of a step function to color pixels. (this has some drawbacks regarding blending)
 * For Eevee use TAA.
 * I also added a slight fresnel effect to the edit mode wires. This allow to not loose visibility of the model shape even with very high vertex density.
 * Fixed SSR not working in Orthogonal View
 * Next week

Week 40: 11th - 17th September
This week has been dedicated to bug fix and planning the coming months with Dalai at the Blender Institute. The planning will be posted soon. Post the planning. Begin AA implementation.
 * Info
 * General development
 * Bugfixes & commits :
 * Next week

Week 39: 3rd - 10th September
Shadows has been commited. They are "optimized" because they now use the least amount of sample to filter the target filter size. There is only 256 concentric samples coordinates in the filter shader so big filter on high res shadow maps can not be working. This setup allow a maximum filter size of 3 x 16 pixel of diameter. I had no time to dedicate to bug tracker. Finishing Multiple shadowmap is a matter of finding the right sampling pattern. It may be a bit tough for me. So I'll prioritize bug fixing for this week.
 * Info
 * General development
 * Separate disk filter in 2 steps: One 3x3 box blur and the other depending on lamp settings. Box blur is disabled if soft parameter is 0.0. We now only render to depth buffer and convert the depth to whatever depth format the shadow algorithm needs, during the first box blur. This accelerate the next blur.
 * Added filter support for Cascaded Shadowmap (Sun).
 * Given the addition of the high bit depth option, the bias attribute needed to be unclamped to fight shadow artifacts of low bit depth VSM.
 * Reworked the Cascaded Shadowmaps to have cascade blending, user defined max distance, cascade count, and distribution.
 * Started to implement Multiple Shadowmap: Only problem left is to distribute samples correctly. I need help on this.
 * Next week

Week 38: 28th - 3th September
Worked on shadows, adding bunch of options (filter size, shadowmap resolution, VSM). These are still not commited, I have to finish the sun shadow map first. Need to finish theses goddamn shadows. Then polish and debug, there is too many bug in Eevee right now.
 * Info
 * General development
 * Added filter size: Unfortunatly, filtering cubemap is hard as we cannot use separable kernels due to mapping distortion. So a large amount of sample is needed. And the larger the shadow map is, the slower it gets.
 * Added Variance Shadow Mapping: As an alternative to ESM, I added back VSM as they were implemented in old viewport. They have different artifacts compared to ESM and might be beneficial in some situations.
 * Added Shadow Map Resolution: Resolution of shadows can be changes per render layer now. For optimization purpose (saving texture slots), it will not be possible to change resolution per shadow, and cascade shadows will have the save size as regular point shadows.
 * Added High Bit depth shadows: For performance / memory usage purpose, I added an option to use 32bits per channel textures for shadow maps instead of 16bits. It's recomended to use 32bits for VSM though as artifacts are more pronounced in this case.
 * Next week

Week 37: 21th - 27th August
This week has been a failure. I tried several options for implementing soft shadows but basically they all failed somehow. As I already loose too much time on soft shadows, I'll be fixing the shadow system, getting sun shadows to work, and use multiple shadow maps for area lights.
 * Info
 * General development
 * Tried implementing soft shadow method, more on that topic here.
 * Next week

Week 36: 14th - 20th August
GTAO refactor is finished and I ogl renders have now less noise in stocastic effects (AO, SSR mainly) thanks to noise offseting for each AA sample. I had no time to investigate TAA. We also had to plan the next few month with dalai. In respect to the new planning, I'll be working on soft shadows next week along side with adding sun shadows.
 * Info
 * General development
 * Finished GTAO refactor: added denoising option.
 * Added noise offset for each AA sample. Reducing noise in final olg render
 * Added a clamp and a color setting to the bloom effect. Can create visual difference with old file.
 * Fixed a performance issue related to cubemap filtering.
 * Next week

Week 35: 7th - 13th August
Screen Space Refraction is done. There \I started to play around denoising/optimisation for GTAO. Idea is to not redo every computation for every bsdf node. We do the horizon search before shading (as it does not need surface normals) and then we do the actual integration when evaluating the BSDF. Finish GTAO optimisation. Then do some polishing on existing features. Use random sampling for OGL render (aka fix the noise). Then investigate TAA.
 * Info
 * General development
 * Added Screen Space Refraction.
 * Fixed some mistakes in the SSR while working on refraction.
 * Added a thickness heuristic to the refraction. This allows for 2 interface refraction approximation.
 * Optimized outline passes a bit
 * Fixed some issues and optimized GTAO
 * Started to do some optimization on GTAO: separate trace from resolve.
 * Next week

Week 34: 31th - 6th August
Refraction was much more a problem than expected. But managed to find a decent approximation for probes. Started Screen space refraction but need to finish it. Finish last week plans: screen space refraction. Then GTAO fix, and some polishing.
 * Info
 * General development
 * Rewrote the screen space raytracing algorithm in preparation of the Screen Space Refraction.
 * Changed the SSR clamp to be like cycles one. (Better looking, more predictable).
 * Made Background draw after depth prepass. This saves some times depending on how much the background is visible.
 * Added support for probe refraction. Created a 3D Lookup table containing BTDF values for different IOR, Roughness, and N.V values. The roughness fit is really bad ATM and a better fit has yet to be computed (No time for this "R&D" right now).
 * Next week

Week 33: 24th - 30th July
I'm finally somewhat happy with the state of SSR. I optimised it quite a bit and tracing one ray at 1080p halfres is now 1ms on my gtx960. I also lowered the number of sample per resolve pixels to have less blocky artifact at the cost of noise. This make the resolve much faster (4 fetches instead of 9). I will leave it as is until temporal filtering is done. I still need to jitter the sampling pattern when using ogl rendering with full AA. Start by Refraction, then some optimisation work on AO.
 * Info
 * General development
 * Added support for rough planar reflection with SSR. Remove rough planar reflection support without SSR.
 * Reworked and optimized SSR: Added Max Roughness option to only raytrace for low roughness surfaces (better performance). Added a Trace Quality slide to have better defined object contour.
 * Fixed crash when saving with motion blur enabled.
 * Fixed black squares caused by bloom (hopefully this time for good).
 * Next week

Week 32: 17th - 23rd July
I nearly finished SSR, it should be commited in a few days. This revealed to be much more complex than I expected and I didn't have time left for refraction. Commits starts at. Commit SSR, do some optimisation, then do Refraction.
 * Info
 * General development
 * SSR: spend most of the time getting the stocastic resolve and the raymarching right. Tried to find some meaningfull parameters. Add options for shooting up to 4 rays per pixels.
 * Temp workaround for crash related to dupli groups: we just cut some features for these (for now).
 * Fixed transparent objects not being drawn if volumetrics are enabled. But that does not mean they are affected by it yet.
 * Next week

Week 31: 10th - 16th July
I finished blend modes. Unfortunately true transparency (refraction, transmission) is harder than I expected and share some code with SSR. So I focussed on SSR. Finish Screen Space Reflection and add one layer Refraction.
 * Info
 * General development
 * Transparency: Added support for different blend modes. These can help simulate transparency.
 * The order dependant blended surfaces (Add / Multiply / Alpha Blend) are sorted based on their object origin local Z distance to the camera.
 * Added an option to limit transparency to the first "transmission" event. This fixes sorting problem inside the same mesh at the cost of loosing half the mesh.
 * A hashed alpha mode was added to support correct alpha blending when using anti-aliasing.
 * Screen Space Reflection: Spend some time to find how to render multiple specular lobe per surface. Conclusion is: only one lobe for now, and bruteforce for offline rendering. Found a solution to extract which lobe to use. Necessary data (normal, roughness, specular) are outputed to buffers. Theses have required some code changes.
 * Next week

Week 30: 3rd - 9th July
Working on Volumetrics put me behind schedule. I have to catch up on the transparency. Finish basic transparency, with sorting per object. Tackle the probe update tagging and see if there is time left for Screen Space Reflections.
 * Info
 * General development
 * Fixed several eevee bugs:
 * World Volumetrics are in a usable state. No Volume object support. World node tree is now supported.
 * One commit removed the possibility to connect "shader" sockets to "color" sockets. This may be adressed in the future.
 * Transparency, started implementation, needs 1 or 2 days to finish it. Complex transparency (absorption, refraction) may require much more work. Can have cheap approximation (one refraction event) while waiting.
 * Next week

Week 29: 26th - 2nd July
This week focus was on smoothing the User Experience. Helping with some performance issue and some long standing bug like the clamped HDRI values.
 * Info
 * General development
 * Implement fast and ugly Planar Probe roughness blurring: This works somewhat for low roughnes, but this need much more work, and I think this should be fused with the stochastic approach we will use for SSR to offer best quality result.
 * Principled BSDF: Added basic support in order to get rid of the metallic and specular eevee nodes. The plan is to simplify the workflow using only existing nodes. The specular workflow node should be merged with the Principled BSDF using an enum and hiding some inputs. Unfortunately a technical limitation is hitting us right now. Also Sheen parameter is still unsupported.
 * Prepared support for anisotropic shading: waiting for TAA first because it's using a stocastic approach and generate a lot of noise.
 * Introduced new icons for each probe type.
 * Fixed bloom artifacts: clamped colors to avoid too bright or negative color to bleed all over the place.
 * Huge shader codebase changes for Principle BSDF, more modularity.
 * Unclamped HDRI textures.
 * Fixed bug with probe shaders: was giving black reflection using AO or bent normals.
 * Worked on Physically based Participating media (aka. Volumetrics).
 * Next week
 * Finish volumetric basic support (only world nodetree), start transparency.

Week 28: 19th - 25th June
This week was focus on the Ambient Occlusion. It's in good shape but not pixel perfect and still need more optimisation. I didn't had time to finish the uber shader. I still have to finish the uber shader and make it compatible with the principle bsdf. After that I'll fix the bloom and work on a simple fog system.
 * Info
 * General development
 * Planar reflection:
 * Fix zfighting issue. commit
 * Add normal distortion based on distance to reflection. commit
 * Add AO in planar reflection. commit
 * Started to implement planar reflection blurring but that seems to be an harder task than I expected.
 * AO:
 * Revisit GTAO and make is fast. Use higher LOD for further samples from the interest texels.
 * Make sample spacing exponential. This way near occlusion is always correct. However there is major artifacts if occluder is very far in screen space.
 * Introduce the concept of Bent Normals: This option compute the least occluded direction when computing the AO. This direction is then used to sample the diffuse lighting and mimic the effect of a bounce lighting. This bent normal could also be used for specular shadowing.
 * Added the creation of a minmax pyramid that will be usefull in the future.
 * Optimisation:
 * Dalai & I found and fixed the bottleneck causing the major slowdown when updating postprocess values. commit
 * GPencil:
 * Antonio Vasquez needed some help with rendering multiple grease pencil objects without Z fighting.
 * We found a solution to his problem by adding support for rendering depth without depth test commit
 * Next week

Week 27: 12th - 18th June
Irradiance volumes (known as probe grid in the UI) are working. It's not finished : I want to add precomputed visibility, thus lowering the number of samples needed for the grid, but this can wait. Planar reflections are working but still unfinished (no normal deformation, no roughness blurring). Appart from finishing the uber shader we are somewhat following the planning.
 * Info
 * General development
 * Finished Grid Probes: They are used to compute incomming diffuse light from several position inside a volume. They capture multiple light bounces and record directionnal lighting info (works with normal mapping).
 * Started Planar probes: They are usefull for large planar glossy surface and does not suffer from artifacts like SSR. But implementation is still incomplete.
 * Added options to view probe data inside the viewport.
 * Next week
 * Tackle GTAO, finish uber shader, finish planar reflection to a state they are usable.

Week 26: 5th - 11th June
Probes are in working state. Started the Irradiance Volume implementation since I really felt it was needed.
 * Info
 * General development
 * Probes : After much debate we decided to go for a dedicated datablock. They are not finished but are ready for testing.
 * It's sill missing data previsualisation (for debugging).
 * There is still some problems like update not triggering when moving objects near probes. But I'm hesitant to enable this as probes are slower to refresh than shadows.
 * Also probes are capturing specular reflection which is a bug and should not happen.
 * Blending is not optimal. If a probe is inside another probe they will be considered in their creation order instead of their distance.
 * Added proper parallax correction volume (Box and Sphere) and tried to make it easy to use.
 * Started Implementing a rather crude precomputed Irradiance volume solution. Needs some times to finish it.
 * Next week
 * Finish Irradiance volume and catch up with the planning (planar reflections and finish uber shader).

Week 25: 29th - 4th June
Didn't had time to finish probes. I focused on what would make the probes faster when they will be introduced.
 * Info
 * General development
 * Ported probe rendering to Octahedron env-maps. This enables us to use 2D texture arrays for multiple probes (broader hardware support than cubemap arrays).
 * Some UI work on Eevee's World, Material and Light panels.
 * Optimized Refreshing of Cubemaps and Shadows by rendering them only when needed.
 * Polished ESM with a 32 tap poisson blur (still pretty fast since it's only done on one channel).
 * Move Spherical Harmonics to UBO along with probe data (that still need to be tackled).
 * Also broke Eevee into smaller files.
 * Improve Clay SSAO with blue noise.
 * Make use of a ghash to store Shgroups for eevee and not duplicate them. This greatly reduces the cache overhead on scene with lots of objects (by a factor of 4).
 * Next week
 * Finish probe and move on following the planning (skipping the indirect lighting part for now).

Week 24: 22nd - 28th May
Was at the Blender Institute to plan next few months. Planning can be found code.blender.org
 * Info
 * General development
 * I tried to make a better cheap area light model together with Luca Rood but we failed to find a competitive solution to LTC. I decided to get rid of lower quality lighting implementation assuming user with low-end hardware will prefer accurate point lights instead of really off area lights.
 * Minimized the precision issue with the grid drawing, better but still not enough. This problem seems to be worse on some AMD cards.
 * Next week
 * Focus on optimisations and add support for probes.

Week 23: 15th - 21th May
This week was focused on optimisation. I lost a little bit of time trying to optimized normal drawing that revealed to be a dead end (half a day). The end of the week was used to prepare for the incommint probe implementation. Performance are way better but general editing workflow is still slow. Also it seems that animations are suffering from batch cache invalidation. We need to revisit the MBC to make it more efficient. This is the main bottleneck for mesh update. Also fix mesh update when not in edit mode (apply scale, set smooth ...). I want to fix the freeing of viewport data to be able to carefully handle freing whatever type of data we store in it. Only Passes needs to be in a separate List. This is needed because right now UBO's are leaking on the OGL side (handles are not free). Next week will be mainly focused on Probes and fixing remaining problems for daily production usage.
 * Info
 * General development
 * MBC Optimisation : Deduplicate Vertex buffer and use aliases for material shaders to work. Try to use compressed format where we can. Can use further optimisation for users that wants (reduce precision, range ...).
 * ORCO is now derived from local positions inside the shader. It's only a MADD instruction so it's not really slowing things drastically. Also separate edit mode attributes from position / normals. Mesh memory usage went from 434 MB (94ms) to 163 MB (25ms) on my test scene. commit commit
 * Texture Optimisation : Share additionnal buffers across draw engines to use less different textures. No additionnal buffers are required edit mode wire transparency. Also use 11_11_10 hdr buffers for eevee to reduce bandwidth and storage.
 * Added support for instance particle buffer for Particle drawing.
 * Octahedron mapping : Simplier support of old hardware without cubemap array support. commit
 * Starting to implement soft shadows : Using the ESM method
 * Next week

Week 22: 8th - 14th May
Performance is becoming a critical subject. Next week will be dedicated to solve this matter.
 * General development
 * Depth of field: Revisit the current Depth Of Field algorithm and port it to Eevee. It's using more a more efficient rendering method using generated triangles without any vbos. I also made the depth of field corespond to the actual field of view in camera view (that was not the case before). Algorithm is still slow and should be coupled with a gaussian blur for low brightness pixels.
 * Tonemapping: Added support for OCIO tonemapping for Eevee. Now eevee benefits from all OCIO features (dithering, color curve, looks, filmic ...) commit
 * Added UI for PostProcesses.
 * Started Mesh Batch Cache optimisation.
 * Next week

Week 21: 1st - 7th May
This week was focus on post processes right in the viewport. Finishing other key postprocesses.
 * Info
 * General development
 * Camera Motion Blur: Use animated camera transform deltas to create motion vectors for static objects and create a blur using these vectors. The blur algorithm is simple and suffer from bleeding artifacts.
 * Bloom: Added bloom (a.k.a. glare) filter from kinobloom. There is still visual artefacts that may come from my bad implementation.
 * Display Background Shader for eevee. commit
 * Fix anoying Seam on Equirect Environment Map commit
 * Add memory usage in debug stats.
 * Next week

Week 20: 24th - 30th April
This week was spent entirely on getting the node system to work with the draw manager.
 * Info
 * General development
 * Spent the whole week on modifying the codegen / attribute system to work with eevee. This enables materials generated from nodetree to be compatible with eevee. It's not using PyGLSL but it will greatly benefit from it latter.
 * Implemented Specular and Metallic workflow uber shaders.

Week 19: 17th - 23th April
As I expected porting Materials was not an easy task. I have yet to create special output node for Eevee. At least old nodes works (I have not tested all of them) I'm going to add Output nodes for both Specular and Metallic workflow. Then I'll follow planning with a bit of delay and work on postprocess effects.
 * Info
 * General development
 * Mesh Batch Cache:
 * In order to have full attribute support in materials (UVs, Tangents, Vcols), I needed to add support for them in the MBC. Turns out this was not easy because all of this was mixed between binding time logic in Derived Mesh and shader compile time logic. I tried to come up with a simplest (and more efficient in the end) solution that involves naming the attribute by their layer name. See the [commit] for more details. Tangent support is still wonky.
 * Eevee :
 * Support for default shader parameters (no nodetree - no texture support). Parameters are not final and needs some design.
 * Support for nodetree and current shading nodes. Engines can now request a GPUMaterial with their own GLSL header / vertex code. Implementation is not perfect but it suits our basic needs for now.
 * Next week

Week 18: 10th - 16th April
This week was focus on wrapping up some features from past weeks. I still have not done VSM. I will take a bit of time to get the materials working with the new DrawManager. I expect this to be a bit difficult (making old nodes still work with new shaders) and it will surelly put me behind schedule.
 * Info
 * General development
 * Eevee :
 * Implemented L2 Spherical Harmonic computation for diffuse environment lighting. Optimized generation is roughly 1ms on my system (GTX 960).
 * Implemented Cascaded Shadow Map: There was a few trick to make them stable. This gives us scene scale shadows for sun lamps with increassing detail towards the camera.
 * Speedup shadow rendering using geometry shader and instancing. Biasing is perfectible and some parameters will need to be on lamps / scene settings.
 * Next week

Week 17: 10th - 16th April
I've dedicated my week toward Envmap rendering and prefiltering. Rendering is optimized and is about 1ms (Render 0.25ms + prefilter 0.75ms) for 512px cubemap. I still need to make the spherical harmonics extraction to have diffuse radiance information from envmap. After that my main focus would go towards the GLSL PyNodes and how to support unreals shader input using PyNodes.
 * Info
 * General development
 * Object Mode :
 * Ported Force field display to new Draw Manager commit
 * Eevee Probe :
 * Implemented World probe rendering and prefiltering. Following Unreal Engine split sum approximation, I generated a slittly different LUT to be merge with the LTC_mag LUT (they use the same parameters). Prefiltering is done by Filtered Importance Sampling with a variying amount of sample, minimizing the time spent for each cubemap. I have not heavily validated against Cycles as it's currently broken in 2.8.
 * Next week

Week 16: 3rd - 9nd April
This week focus was shadows. I lost some day figuring out what was the right approach considering old hardware support first (being gl 3.3 only). I went from a complicated general shadow pool to a per shadow type pool for each viewport. Vram usage is not efficient for now because every viewport allocate their own shadows even if they display the same renderlayer. I did manage to create a point light shadowing system that does not rely on GL_ARB_texture_cube_map_array. Rendering is using Geometry shader and make the whole shadow refreshing very slow. I did not have the time to implement Cascaded Shadow maps and VSM as I would like so current shadow are only using hardware PCF. I need to keep Eevee dev going and tackle the envmap rendering (will be pretty much similar to the shadow hopefully). We also need to tackle the transition to ogl 3.3 and I'm part of the dev force for it. Main focus will be to port features to new Draw Manager/Mode Engines.
 * Info
 * General development
 * Object Mode :
 * Added grid fading based on the angle of view.
 * Eevee Shadows :
 * Implemented shadows with texture arrays. This gives the benefit to not rely on dynamic shader recompilation to use them and also spare a lot of texture binding slots. The downside for now is that we need to use layered rendering to render these shadowmaps.
 * Next week

Week 15: 27th - 2nd April
This week focus was area lights. We are on time following the planning. Quality settings are planned but not there yet. The plan is to focus on Eevee shadow support.
 * Info
 * General development
 * Eevee Area Lights : I implemented several techniques for area lighting. Only 2 brdfs are taken into account, lambert diffuse and GGX specular. From cheapest to the most expensive approximation we have :
 * Point light : If desired, for performance reason, area light can be turned off completely and converted to simple point lights.
 * Simple Approximation : Starting from this level Sphere area light diffuse contribution are calculated analiticaly (exact look). Rectangle Lamps are using structured sampling with 5 points as described in the Frosbite PBR notes. For specular surfaces, we use Brian Karis MRP method for sphere lamps and a custom MRP solution for Rectangle Lamps.
 * Expensive Approximation : If quality is needed, we use the LTC solution from Eric Heitz. This gives us perfect diffuse contribution of Rectangle Lamps and a fairly good approximation for GGX spec. For Sphere Lamps specular, we use the spinning quad technique described here. Unfortunatly energy preservation is not perfect and there is an artifact appearing in the light direction.
 * Accurate Approximation : To fix the last problem concerning sphere lamps (see just above), we compute the LTC integral for a whole octogone instead of just a quad. The clipping algorithm is made simpler but introduce a neglectible error. The octogone and the circle have less area difference and thus the approximation is better.
 * Next week

Week 14: 20th - 26th March
Documentation of the draw manager and code flow is up there. I've worked a bit off schedule and focused a bit on the outline and grid refactor. I've also written the ideal components of the mesh batch cache to have the maximum memory efficiency (smaller vbos) and data Independence (faster update) link. I'll plan to focus on the scene light support for eevee.
 * Info
 * General development
 * Object Mode :
 * New Outlines changes : Following plyczkowski mockups (T51021) I changed the outline algorithm to have the same appearance.
 * New Grid : Again, following plyczkowski mockups, I implemented a grid that fades away from the camera position. Grid subdivision become lower the further the distance to the camera. For now the fade-out starts at half the clip distance. It is anti-aliased and have constant performance cost (compared to the old grid). User feedback is needed.
 * Draw Manager :
 * Refactor Static var : Engines were relying on a static g_data var when generating the cache, eliminating any parallel executions. This improves code clarity and potential for multi-threading.
 * Debug Stats : Include detailed CPU and GPU timings when debug var is > 30 (CTRL+ALT+D). This will be useful for profiling and performance testing. (screeshot)
 * Next week

Week 13: 13th - 19th March
Amsterdam Meeting was really productive. Meeting notes are comming soon, but as a short overview we discussed Eevee planning, the current state of the new drawing code, and the OpenGL refactor tasks. I also spend a bit of time on selection outline refinement. For this I implemented stencil masking usage, but final implementation does not rely on it. If I don't find any other I'll remove it. I also started Eevee yay \o/. I'll plan to write documentation about the Draw manager and the whole drawing flow with engines. Then I'll focus on a Memory Manager / Inspector in pair with a statistic tool for benchmarking viewport development.
 * Info
 * General development
 * Object Mode :
 * New Outlines (see picture): First Implementation used Three passes and was very slow compared to the old one (two passes). Also, appart from modulating the occluded silouhette edges, it was not very different from what we have now. Final implementation is a bit more subtle with an outward gradient and a light fill color.
 * GPUTexture :
 * Implement Depth Stencil Textures. commit
 * Eevee :
 * Support for 256 scene lights via UBO (only diffuse for point lights), Limit can be highier and needs to be set depending on system capabilities. Old limit was 48 or was prone to shader compilation error (too much variables). commit
 * OpenGL Refactor :
 * Converted gpu_compositing.c. commit
 * Next week

Week 12: 6th - 12th March
A huge portion of the week was dedicated to drawobject.c. Eevee was postponed until we have a solid roadmap for it. Amsterdam Meetup and hopefully a bit of Eevee.
 * Info
 * General development
 * Edit Mode :
 * Ported Normals (Verts/Loops/Face) display. commit
 * Draw Manager :
 * Restructured the overall design to be more modular and allow engine compositing. commit
 * Added templates for all practicle mode engines. commit
 * OpenGL Refactor :
 * Nearly finished drawobject.c only remaining legacy calls are for DerivedMesh usage.
 * Next week

Week 11: 27th - 5th March
I left asside the OGL refactor tasks to focus on edit mesh overlays. I've worked on fixing the half edge problem as I found it to be a substancial problem (both verts and edges of faces viewed side-on disappearing, vertex being cut at the triangles boundaries). To fix this, I draw a triangle strip with constant width in viewspace, around every triangle using the geometry shader. But the fact all triangles must be in a strip force us to make degenerate triangles to draw the contour, thus we must output 23 vertices per triangle. It results in very poor performance (roughly 1/3) compared to the normal version. So I disabled the fix when navigating the 3D view. We still benefit from this technique though. We don't need 3 passes to render Verts/Edges/faces and we get no depth-fighting or poking through with underneath render (there is still artifact due to depth precision right in front of camera but it results mostly in noise on the edges). We also discussed planning for the month of March. I also detailled the steps for the developpement of the Eevee engine. Document I will try to cleanup the draw manager and make template of things to do so others can work and help. Then I'll start Eevee.
 * Info
 * General development
 * Edit Mode :
 * Fixed the overlay edges being half width at the silouhette. commit commit
 * Added support for loose edges, loose verts and face center. commit
 * Added support of the "Limit selection to visible" feature with an opacity slide option. This is an improvement over the old system that was loosing clarity with dense mesh. Now we have a proper depth sorted wires.
 * Support for Theme colors via UBO. commit
 * Object Mode :
 * Mostly Finished lamp drawing.
 * Added Camera drawing. This is a great reference for someone who want to help port other Non-meshes to the new system. commit
 * Next week

Week 10: 20th - 26th Febuary
I'm exhausted, I worked 7days full time... This is a buffer week. Since I met pretty much all the requirement for this month, I can polish the work done and maybe start on the Eevee engine. I'll try to improve the solid wireframes to use theme color, fix edge artifacts. Maybe do a bit more of the armature drawing to refine the instance batching. I would love to try some temporal refinement too but I don't know if I would have time for this. I also need to create timing code to display render time informations.
 * Info
 * General development
 * Opengl Refactoring :
 * Finished interface_panel.c, interface_widgets.c, uvedit_smart_stich.c, paint_stroke.c, gpu_framebuffer.c
 * Finished porting all glaDrawPixels function to imm equivalent.
 * Ported OCIO implementation to GL 3.3 core. (link)
 * Clay Engine :
 * Started Edit Armature sub-engine: Base is here so someone can finish it. Only Octahedral armatures are supported. (link)
 * Added Edit Mesh overlays: Based on the work started by Mike Erwin, I removed the artifacts due to cliped vertices following Nvidia's paper. I also added point drawing in the same pass and face drawing. Everything can be done in one rendering pass, except for face centers. There is still artifacts on the silhouette of the mesh, I plan to fix this but this would require 6x time more tris to rasterize. I think this will be a quality switch in the settings panel, or switch if off when rotating the view or anim playback. With this technique we are completely GPU bound when drawing edit mesh. However it need to upload a certain amount of data to the GPU that is still slow to regenerated on edits. This could be optimized later. (link)
 * Next week

Week 09: 13th - 19th Febuary
Last week was more focused on OGL refactor so I focus back on CLAY. Some work was done not following planning order but overall progress is still on time. Appart from OGL refactor duties, I will contentrate on edit mesh drawing and the overlay shader (with Mike Erwin's help) that will be used whenever we have to draw wire with shaded geometry.
 * Info
 * General development
 * Opengl Refactoring :
 * Finished drawarmature.c, transform_manipulator.c
 * Clay Engine :
 * Added support for geometry normals. Now clay is better than master matcap+ao because ambient occlusion does not use derived normals (see screenshot).
 * Added back some object/edit mode collection settings, namely "Wire (overlay display)", "Backface culling", and "Hidden Wire"
 * Added back transform manipulator and info drawing.
 * Separated "modes" drawing code into sub-engines. (commit)
 * Added debug variable (Shortcut Ctrl+Alt+D) 666 (no instance caching, non meshes position are recomputed each frame) and 667 (full cache, scene is frozen until you exit this mode) to test viewport cache performance.
 * Next week

Week 08: 6th - 12th Febuary
Monday we merged clay-engine/render-layers branch to blender2.8. A large portion of my time was dedicated to OGL refactoring tasks. I still need to finish the drawarmature refactoring, that will be done by monday. Since I spent a bit of time on the ogl refactoring, I'll try to catch up and do more work on clay engine. Specially on having everything from old viewport tightly integreted in the new DRW module (cursor, transform tools). Then I will implement the Edit mode Collection settings as planned.
 * Info
 * General development
 * Opengl Refactoring :
 * Finished interface_draw.c
 * Nearly finished drawarmature.c
 * Added replacement for gluSphere, gluCylinder, glaDrawPixelsTex*
 * Clay Engine :
 * Added support for collection overrides. 6b372e3a22cb
 * Reworked on Instancing : it is now more flexible and allowed a good cleanup. fc0797142d0c fc0797142d0c eb473143a8cf
 * Next week

Week 07: 30th - 5th Febuary

 * General development
 * Added support for instancing. This leads to a new performance gain.
 * Ported mostly Empties and Lamps drawing to the new drawing methods.
 * Benchmarked the performance gain of non-meshes drawing with instancing and batching. Test files are available here
 * Worked on getting object mode display (wires, outlines).
 * Rewrote some bits of the clay engine to not relly on a custom runtime data struct. 0ee52a5741a1

Week 06: 23rd - 29th January

 * General development
 * Cleanup Clay Engine to support new MBC functions.
 * Started Work on object mode overlay an non-meshes object.
 * Introduce Dynamic VBOs that are created from a list of objects matrices (giving line or points).
 * Use the aformentionned technique to batch object center and relationship lines giving huge performance gain.
 * Changes to DNA/RNA for the RenderEngineSetings.

Week 05: 16th - 22nd January

 * General development
 * Posted a proposal about a cache system to accelerate viewport redrawing. Document
 * Made an early implementation of Ground Truth AO.
 * Added support for Uniform Buffer Object in the GPU module.

Week 04: 9th - 15th January

 * General development
 * Ported SSAO to the new matcap shaders.
 * Added an inverted AO effect to Matcap shader using the same loop as the AO "cavity" effect, highlighting edges.
 * Added parameters to control Hue Saturation Value and Rotation of the Matcap texture.
 * Found a problem in the fragment shader of SSAO and fixed it in master. 0507b3e4c41f
 * Started investigating Ground Truth AO as replacement of Alchemy AO.

Week 03: 1st - 8th January

 * General development
 * Added 2d texture arrays to draw multiple matcaps with less texture bindings.
 * Got matcap to work without proper mesh normal (using dfdy to derive normal) as a quick test waiting for proper VBO request.
 * Refactored the GPU_texture module to allow more internal image format and use consistent function names. D2452