Commit Graph

84 Commits

Author SHA1 Message Date
mano-wii 8277bee748 Draw Manager: re-enable edit-mesh text overlay 2017-10-30 17:50:47 +11:00
Clément Foucault 66d8f82b83 Eevee: Overhaul the volumetric system.
The system now uses several 3D textures in order to decouple every steps of the volumetric rendering.

See https://www.ea.com/frostbite/news/physically-based-unified-volumetric-rendering-in-frostbite for more details.

On the technical side, instead of using a compute shader to populate the 3D textures we use layered rendering with a geometry shader to render 1 fullscreen triangle per 3D texture slice.
2017-10-27 22:49:15 +02:00
Clément Foucault 1054f65a29 Object Mode : Add probes data outlines and selectability
This required some small changes to the data display shaders so that they match the way the object mode renders them.
Strangely enough, I had to remove the normal attribute from the display code because it was being not bound as soon as I created another rendering call in object mode. The problem may be deeper but I did not have time for this so I derive the normal from the sphere pos.
2017-09-30 19:37:40 +02:00
Clément Foucault 31be6fccf8 Eevee: Probe Grid: Clear Grid buffers with world diffuse coefs.
This make sure the values displayed by the "show data" sphere are initialized.

Also this make the bounce lighting progress more apparent.
2017-09-28 21:17:57 +02:00
Clément Foucault 3ae0be45f1 Eevee: Implement Temporal Anti Aliasing / Super Sampling
This adds TAA to eevee. The only thing important to note is that we need to keep the unjittered depth buffer so that the other engines are composited correctly.
2017-09-25 20:14:42 +02:00
Clément Foucault f2ea8e217b Object Mode : Add Outline FXAA
Adds a FXAA for smoothing out the extracted outlines.
The Post Process Anti Aliasing is only done on the Alpha channel of the outlines.
Because of that we need to add bleed the outline color out of the silouhette so the AA'd alpha can blend the right color and not pick black when the alpha is smoothed out of the silhouette.

Also because of the AA needs to have clear contrast to work with, I decided to ditch the "bluring" or the occluded outlines.

The FXAA adds an overhead of 0.17ms but we gain back 0.22ms * 4 = 0.88ms by removing the blur.

The FXAA Implementation is from Corey Richardson (cmr) (D2717). I had to modify it a bit to only filter the alpha channel.
2017-09-22 17:31:40 +02:00
Clément Foucault 9fdf094b85 Eevee: Shadows: Filtering improvement.
- Replace poisson by concentric samples: Less variance. They are sorted by radius then by angle.
- Separate filtering into 2 blur. First blur is 3x3 box blur. Second is user dependant.
- Group fetches by group of 4.
2017-09-10 03:09:45 +02:00
Clément Foucault 8b7a83a868 Eevee: Refactor Shadow System
- Use only one 2d texture array to store all shadowmaps.
- Allow to change shadow maps resolution.
- Do not output radial distance when rendering shadowmaps. This will allow fast rendering of shadowmaps when we will drop the use of geometry shaders.
2017-09-10 03:09:45 +02:00
Clément Foucault 2abc21ace5 Eevee: Fix problem with GPU_texture_generate_mipmap
This function was called to recreate the lower mip level of the probe texture. But this is not it's usage and it introduced a stall.

This patch add cubemap mipmap level regeneration in eevee_effects.c
2017-08-19 01:20:09 +02:00
Clément Foucault 659be38760 Eevee: Rework GTAO
This includes big improvement:
- The horizon search is decoupled from the BSDF evaluation. This means using multiple BSDF nodes have a much lower impact when enbaling AO.
- The horizon search is optimized by splitting the search into 4 corners searching similar directions to help which GPU cache coherence.
- The AO options are now uniforms and do not trigger shader recompilation (aka. freeze UI).
- Include a quality slider similar to the SSR one.
- Add a switch for disabling bounce light approximation.
- Fix problem with Bent Normals when occlusion get very dark.
- Add a denoise option to that takes the neighbors pixel values via glsl derivatives. This reduces noise but exhibit 2x2 blocky artifacts.

The downside : Separating the horizon search uses more memory (~3MB for each samples on HD viewport). We could lower the bit depth to 4bit per horizon but it produce noticeable banding (might be fixed with some dithering).
2017-08-18 15:09:43 +02:00
Clément Foucault d16342e5fd Eevee: Add Screen Space Refraction.
For the moment the only way to enable this is to:
- enable Screen Space REFLECTIONS.
- enable Screen Space Refraction in the SSR parameters.
- enable Screen Space Refraction in the material tab.
2017-08-10 15:43:48 +02:00
Clément Foucault 8e36089e41 Eevee: LUT generation.
We generate a 3D lut to precompute the btdf intensity.
I decided to use a 64*64*16 (N dot V, ior, roughness) because the btdf varies less with roughness than with IOR.
We also remap the ior to better use the space in the LUT.
2017-08-10 15:43:47 +02:00
Clément Foucault 5bfa3cf6e9 DRW: Revamp the performance debugging tool.
Old performance debug was doing queries for every frame even if not debugging perf.
Also, it did not record when a pass was draw multiple time, leading to incorect measurement.

New module also allows to group the timers to limit infos displayed.

Also fix the background CPU draw timer.
2017-07-27 14:51:44 +02:00
Clément Foucault f1bf9d6bfb Eevee: SSR: Add mipmap filtering and bias to reduce noise.
Also fix the roughness factors.
2017-07-24 15:28:27 +02:00
Clément Foucault 3be8ab881e Eevee: SSR: Add simple raytracing.
Still imprecise.
2017-07-24 15:28:27 +02:00
Clément Foucault 2a84331f02 Eevee: SSR: Output ssr datas to buffers.
Output in 2 buffers Normals, Specular Color and roughness.
This way we can raytrace in a defered fashion and blend the exact contribution of the specular lobe on top of the opaque pass.
2017-07-24 15:28:27 +02:00
Clément Foucault 65b01014b9 Eevee: Initial implementation of Volumetrics. 2017-07-03 22:08:33 +02:00
Clément Foucault 1982e724f4 Eevee: Refactor of shading code to be more modular.
This will enable creating shading models more easily.
2017-06-28 16:32:08 +02:00
Clément Foucault 0394c04a7f Eevee: Add Planar reflection blurring.
This method is very cheap and inaccurate. This will fill the gap untill better model is supported.
2017-06-26 21:04:53 +02:00
Clément Foucault 779c950098 Eevee: Ambient Occlusion: Initial implementation.
Implement GTAO (Ground Truth Ambient Occlusion) which is a special case of Horizon Based Ambient Occlusion that is more physically accurate.
Also add a bent normal option to sample indirect irradiance (diffuse lighting) with the least occluded direction.
2017-06-22 03:51:06 +02:00
Clément Foucault 2c7f6db8d1 Eevee: Minmax Depth Pyramid.
This commit introduce the computation of a depth pyramid containing min and max depth values of the original depth buffer.
This is useful for Clustered Light Culling but also for raytracing on the depth buffer (SSR).
It's also usefull to have to fetch higher mips in order to improve texture cache usage.

As of now, 1st mip (highest res) is half the resolution of the depth buffer, but everything is already done to be able to make a fullres copy of the depth buffer in the 1st mip instead of downsampling.
Also, the texture used is RG_32F which is a too much but enough to cover the 24bits of the depth buffer. Reducing the texture size would make things quite faster.
2017-06-22 03:51:06 +02:00
Clément Foucault 5a029d7a6d Eevee: Add data display for planar reflection.
Maybe not very useful but it's here for feature parity with the other probes.
The fragment shader clipping is here because I'm lazy and don't want to creating a proper quad Batch.
2017-06-19 10:47:56 +02:00
Clément Foucault 5c67ac2236 Eevee: Add special shader for depth prespass.
This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.
2017-06-19 10:47:56 +02:00
Clément Foucault cac851a00e Eevee: Probes: Add data display for cubemaps. 2017-06-15 00:57:16 +02:00
Clément Foucault 810464e5f7 Eevee: Group octahedron map functions into one file. 2017-06-15 00:57:16 +02:00
Clément Foucault 26e710b1fd Eevee: Add Grid debug display. 2017-06-15 00:55:45 +02:00
Clément Foucault dccf46f18f Eevee: Add Irradiance Grid support
Early implementation. Slow and still has quality
3 ways of storing irradiance:
- Spherical Harmonics: Have problem with directionnal lighting.
- HL2 diffuse cube: Very low resolution but smooth transitions.
- Diffuse cube: High storage requirement.

Also include some name change.
2017-06-15 00:53:41 +02:00
Campbell Barton eaadfdbdc0 CMake: add missing includes 2017-06-13 14:51:15 +10:00
Campbell Barton f52dc2f371 Rename probe to light-probe
Probe is a real general term, the new name is used often in docs online.
2017-06-12 21:34:55 +10:00
Clément Foucault 28b597b6df Eevee: Material code refactor.
Separate material handling inside another file.
Make use of enums to identify shader variations.
Group all 64*64 LUTs into one array texture.
Only update world probe if world changes.
2017-06-04 12:12:58 +02:00
Clément Foucault 2851e91db4 Eevee: Cleanup. Group data functions into one file. 2017-06-03 00:54:01 +02:00
Luca Rood 340e4394d4 Use custom shader for dot particles 2017-05-23 14:25:12 +02:00
Luca Rood b5426b50fb Rename/move particle shaders 2017-05-23 14:20:10 +02:00
Luca Rood b30cefa650 Revert "Implement UBOs for particles"
This reverts commit 845732652f.
2017-05-23 13:52:50 +02:00
Campbell Barton f21c235c6f DwM: texture paint support & mask mode
Uses workaround so material slots are used when neither blender-internal
or cycles are enabled.
2017-05-23 17:40:48 +10:00
Luca Rood 845732652f Implement UBOs for particles
This fixes the issue where all particles were drawn with the colors and
size of the last psys to be drawn.
2017-05-22 16:42:08 +02:00
Clément Foucault d9d65a06d3 Eevee: Move cube shadows to octahedron shadowmaps.
We render linear distance to the light in a R32 texture and store it into an octahedron projection inside a 2D texture array.

This render the sampling function much more simpler and without edge artifacts.
2017-05-20 16:58:07 +02:00
Campbell Barton 8e3cefd0d5 DwM: Object mode empty-image support 2017-05-20 23:17:50 +10:00
Luca Rood 42804d49b5 Implement particle drawing with draw manager
This still has a couple of issues:
* Instancing is not working when multiple particle systems use the same
primitive. Only the last particle system to be drawn with a particular
primitive shows up.

* Because of colors being passed as uniforms with static variables, the
color of the collection of the last object to be evauluated is used for
all particles being displayed.

Also, note that while this is being drawn in the clay engine, this might
be moved to the object mode later intead.

Part of T51378
2017-05-19 17:23:19 +02:00
Luca Rood 0eb32ab228 Implement hair drawing with Draw Manager in Clay engine
Part of T51378
2017-05-12 16:14:55 +02:00
Clément Foucault 3fbafaffa1 Eevee: Add tonemapping using ocio.
Actually it's done by the Draw Manager, so other engines can use it.
2017-05-11 16:29:35 +02:00
Clément Foucault 9075f934aa Eevee: Initial Depth Of Field commit. 2017-05-09 23:55:19 +02:00
Clément Foucault 0aa2a662b9 Eevee: Add Bloom post process.
Based on Kino/Bloom v2 - Bloom filter for Unity
MIT license.
2017-05-07 15:51:54 +02:00
Luca Rood d9949c351d Pass selection to weight paint vert overlay instead of colors 2017-05-05 18:23:27 +02:00
Luca Rood 872d8993dd Clean up weight/vertex painting code
Now passing selection state instead of colors for the wire/face mask
overlay thing. Also added masking indication on the faces in vertex
paint.
2017-05-05 15:53:37 +02:00
Clément Foucault 4ef0513aab Eevee: Draw background shader.
Also fixes some remaining errors caused by some matrices not updated.
2017-05-04 17:42:22 +02:00
Clément Foucault 5601a62179 Eevee: Simple Camera Motion Blur.
Disabled by default. Set ENABLE_EFFECT_MOTION_BLUR to 1 to enable.
No fancy motion blur. Use depth and camera matrix to get the motion vectors. Then blur in this direction.
Only available in camera view.
Only Camera animation is supported, does not take into account the parents motion
2017-05-04 17:42:22 +02:00
Dalai Felinto 8c660c7801 Cycles integration with Draw Manager
We can now use object and other modes on top of Cycles.
Since we are now always on "render_to_view" (old Rendered mode), the
pause button is always visible.
2017-05-02 15:13:50 +02:00
Campbell Barton a680bcd13b Draw Manager: basic text overlay support 2017-04-28 04:54:04 +10:00
Campbell Barton b649f53a62 Error in last commit 2017-04-27 22:01:31 +10:00