Commit Graph

65 Commits

Author SHA1 Message Date
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
Campbell Barton 23b8fa5299 Cleanup: split cmake source/headers 2017-04-27 21:58:43 +10:00
Campbell Barton 795e839d3b Cleanup: rename select engine -> basic
This is used by depth drawing too and had no selection specific code.
2017-04-27 02:51:07 +10:00
Campbell Barton 3f91567052 Cleanup: draw engine
- use DRW_engine prefix for engine types.
- use engine suffix for files that define a draw engine.
- remove engines from include path (they're only referenced once)
2017-04-26 17:42:39 +10:00
Campbell Barton bfc2043332 Draw Manager: add select engine
This does very little currently, but allows changing behavior for
selection drawing in the future.
2017-04-26 17:25:41 +10:00
Clément Foucault 82686f0a0c Eevee: World default shader.
- Use uniform color world for the world probe.
- Refactored the Fresnel expression to be better with Area Lights.
- Squared the roughness for default materials.
2017-04-25 23:51:05 +02:00
Clément Foucault 041a50291b Eevee: Make default shaders works.
- Added New Batch cache routine to get the split mesh for each material. (optimization needed)
- Did some shader modifications to create default_frag and support a somwhat correct fresnel for lamps (to finish)
2017-04-25 18:47:20 +02:00
Campbell Barton bfa888cef2 Cleanup: move draw-cache creation from BKE to DRW
Creating draw-cache should only ever be used by the draw-manager.
2017-04-21 22:06:06 +10:00
Campbell Barton cdba73c8fa Draw Manager: curve support
Draws the curve centerline and editmode verts/handles.

Handle theme colors, and normal display still need adding.
2017-04-20 00:38:44 +10:00
Clément Foucault 80db709250 Eevee: Spherical Harmonic diffuse.
For now it's done each frame and it's rather slow (16ms) but result will be cached soon.
2017-04-18 21:33:09 +02:00
Clément Foucault edcf128ce2 Eevee: Introduction of world preconvolved envmap.
For now only compute GGX convolution. The GGX LUT used for the split sum approximation (UE4) is merged with the LTX mag LUT that uses the same parameters (theta and roughness)
2017-04-18 13:10:17 +02:00
Campbell Barton 02273441dc Draw Manager: lattice editmode drawing 2017-04-14 04:34:12 +10:00
Campbell Barton c0a9e388b3 GLSL: rename edit_overlay -> edit_mesh_overlay
Avoid confusion with overlays with non-mesh types
2017-04-13 14:13:46 +10:00
Clément Foucault f2f16a2568 Eevee: First Shadows implementation
Using Texture Arrays to store shadow maps so less texture slots are used when shading. This means a large amount of shadows can be supported.

Support Projection Shadow Map for sun like in old BI/BGE.

Support Cube Shadow Map for Point/Spot/Area lights. the benefit of using it for spot light is that the spot angle does not change shadow resolution (at the cost of more memory used). The implementation of the cubemap sampling is targeted for 3.3 core. We rely on 2D texture arrays to store cubemaps faces and sample the right one manualy. Significant performance improvement can be done using Cubemap Arrays on supported hardware.

Shadows are only hardware filtered. Prefiltered shadows and settings comming next.
2017-04-10 12:36:32 +02:00
Campbell Barton 2944438e9a 3D View: manipulator from custom-manipulators branch
Original code from @Severin with changes from @dfelinto & @hypersomniac.

This doesn't cause many functional changes
besides using new transform manipulators.

Submitted as D2604
2017-04-07 21:23:32 +10:00
Clément Foucault 46cd87f5da Eevee: LTC area lights
Using Linear Transform Cosines to compute area lighting. This is far more accurate than other techniques but also slower.

We use rotating quad to mimic sphere area light. For a better approximation, we use a rotating octogon.
2017-04-03 21:52:03 +02:00
Clément Foucault 6d21970aa0 Eevee: Diffuse Lights (1 / 2)
I added srgb tonemapping for previewing purpose. Also since the color buffer is still not HDR, there is ugly artifacts (fixed in part2)
2017-03-28 00:09:45 +02:00
Clément Foucault 7ee41920fa Draw Manager: New debug timers
Both CPU time and GPU time are printed to spot bottlenecks.

GPU Timers works only if cache is enabled.
2017-03-27 14:01:47 +02:00
Clément Foucault 8abc315a23 Object Mode Engine: New grid drawing.
Move the grid drawing to the Object mode engine and implement a new infinite grid.
Everything is done but it needs better parameters to be intuitive.
2017-03-22 21:29:23 +01:00
Clément Foucault 26c140fbc8 Draw Module: Move the Global Ubo block definition to it's own file. 2017-03-22 21:29:23 +01:00