Commit Graph

838 Commits

Author SHA1 Message Date
Sergey Sharybin
e1e452c062 Draw manager: Avoid unneeded memory malloc/free when attempting to create missing uniform 2017-10-05 17:16:37 +05:00
Clément Foucault
31820d0109 Eevee : Fix T52991 2017-10-04 21:31:47 +02:00
Clément Foucault
9422db7796 Eevee: Some changes to the Render / Render layers settings panel.
- Separate the Post Processes settings into sub panel.
- Rename "Viewport Anti-Aliasing" to sampling & super-sampling as it also reduce the noise of other effects.
- Remove Temporal Anti-Aliasing toggle and make it always active unless the number of samples is 1.
2017-10-03 18:30:56 +02:00
Clément Foucault
57c323b5d3 Object Mode : Fix probe paralax display. 2017-10-03 18:30:56 +02:00
Clément Foucault
f40fa55b58 DRW: Fix Feedbackloop warning. 2017-10-03 18:30:56 +02:00
Clément Foucault
2136942916 Eevee : Fix grid black fill. 2017-10-02 22:17:20 +02:00
Clément Foucault
2bd36338d3 Gawain : Add workaround to fix bad sync of the program_in_use flag. 2017-10-02 22:16:50 +02:00
Clément Foucault
c548c76804 Eevee : Fix ghosting from probe data when toggling "only render". 2017-10-02 20:02:21 +02:00
Clément Foucault
5f7192018e Eevee : SSR : Make sure to not apply Specular Occlusion to SSR.
This makes the metals shine more.

Previous behaviour was not correct.
2017-10-02 19:44:44 +02:00
Clément Foucault
04e4a0db0d Eevee : Probe Grid : Fix Update tagging. 2017-10-02 18:42:18 +02:00
Clément Foucault
73ab572c0a Eevee : Probe Cubemap : Fix Broken Display data. 2017-10-02 18:42:18 +02:00
Clément Foucault
21ec254ae2 Eevee : Light Grid : Init grid to black instead of world color.
This was a mistake to use world color because it introduce light bleeding on indoor environement.
2017-10-02 18:42:18 +02:00
Andrea Weikert
ba67d94258 Compile fixes for MSVC:
* missing include for uint typedef
* macro syntax error

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D2863
2017-10-01 15:34:12 +02:00
Clément Foucault
3349f25502 Eevee : Add a setting for the number of indirect light bounce.
This is used to tweak the overall spread of the lighting. It is a per renderlayer setting.
2017-10-01 02:19:10 +02:00
Clément Foucault
cc772e4bca Eevee: LightGrid: Fix progressive rendering. 2017-09-30 19:37:40 +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
8249e1ce5e DRWCache: Add a new regular Quad buffer. 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
12f650623e Eevee: Probe Grid: Add "progressive rendering"
This gives the user a more rapid preview of what the final result will be.

The grid cells are renderer in a series of powers of two offsets.
2017-09-28 21:16:02 +02:00
Clément Foucault
fcdc7acd8b Eevee : TAA : Fix conflict with outlines.
The previous view was incorrectly considered valid even if the persp matrix was different. So the history depth was mismatching.
2017-09-27 21:21:39 +02:00
Clément Foucault
b24ba9b174 Object Mode Engine: Small cleanup 2017-09-27 21:21:39 +02:00
Clément Foucault
40f5ac4977 Eevee : TAA : Change post process chain to allow more flexibility
This basically do not use hardware blending and do the blending in the shader.
This will allow neighborhood clamping if we ever implement that.
2017-09-27 21:21:39 +02:00
Clément Foucault
88a3323a47 Eevee: Use fmod instead of floor. 2017-09-27 21:21:39 +02:00
Clément Foucault
a24dd6eaba Eevee: Fix bug with cubemap shadows. 2017-09-26 22:30:48 +02:00
Clément Foucault
540ef7ee8e Eevee: Fix broken World probe. 2017-09-26 21:43:14 +02:00
Clément Foucault
c1aca25c3b Eevee: TAA: Remove 32 sample limit. 2017-09-26 21:39:25 +02:00
Clément Foucault
b96c70f9b2 BLI_rand : Make use of BLI_halton and BLI_hammersley 2017-09-26 21:38:23 +02:00
Clément Foucault
5c45fe2937 Eevee : Fix regression : Refraction not working 2017-09-26 16:48:07 +02:00
Clément Foucault
496a354d7f DRW : Fix Compiler Warning 2017-09-26 13:59:31 +02:00
Clément Foucault
f853e724de Eevee : Fix compilation warning on intel. 2017-09-26 13:58:59 +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
198c7d3687 DRW : Add new view_update mechanism.
This makes updates for the viewport cleaner and also add the possibility to add a new callback called when the scene is updated.
2017-09-25 20:14:42 +02:00
Clément Foucault
98dd2a518b Eevee: Fix SSR in orthographic view.
The problem was that orthographic views can have hit position that are negative. Thus we cannot encode the hit in the sign of the Z component.

The workaround is to store the hit position in screenspace. But since we are using floating point render target, we are loosing quite a bit of precision.
TODO: use RGBA16 instead of RGBA16F. But that means encoding the pdf value somehow.
2017-09-25 20:14:42 +02:00
Clément Foucault
00955d8d7a DRW : Add AA to non meshes objects.
You can change the amount of samples in the user preferences. You do not need to restart blender to see the effect in the new viewport.

This adds another Multisample Framebuffer and textures (so even more memory required).

It works by blitting the default_fb to the multisample_fb each time the renderer need to render one or more "wire" pass.
It it then blit back to the default_fb so that the rest of pipeline is working as expected.

We COULD lower the GPU memory / bandwidth usage to render everything to the same multisample fbo and change the logic depending on if MSAA is enabled or not, but I think it's a bit too much work for now.
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
225e52eaf8 Edit Mesh Mode : Fix GLSL compilation errors 2017-09-22 03:44:06 +02:00
Clément Foucault
56fd75c856 Edit Mesh Mode: Put AntiAliasing #define into shader include header. 2017-09-22 02:44:40 +02:00
Clément Foucault
1a4a1447b7 Edit Mesh Mode: Add a facing falloff effect
This let the user keep track of the shape by fading the center of the object.
An Opacity parameter is yet to be added.
2017-09-22 02:44:40 +02:00
Clément Foucault
406427bd4e Object Mode: Fix outline getting darker during expand steps. 2017-09-22 02:44:40 +02:00
Clément Foucault
02cd48a087 Edit Mode : Bias Face dot position 2017-09-22 02:44:40 +02:00
Clément Foucault
4bfa3f4f9b Edit Mesh Mode : Make line smoother.
This introduce some little artifacts on the border of edges because some pixel with very low opacity does not get discarded and then occlude the face rendered behind if it has not been drawn yet.
To fix this. I added an offset in the geometry shader for the edge fixup. This make the artifact only visible on the border of the object if there is a very dense wire region. It's only visible in edge select mode since vertex and face center also hides the artifacts.

We can enable this only if AA is enabled but for now it's always enabled.
2017-09-22 02:44:39 +02:00
Clément Foucault
73e1435ab1 DRW: Fix regression
Textures were bound once. But since it was not unbound it's bind_num would not change and considered still bound next time a shader needed it.

Fix T52866
Fix T52855
2017-09-21 19:54:43 +02:00
Clément Foucault
d97f52f015 Revert "Fix T52855: Eevee: viewport artifacts"
This reverts commit 803c757c2b.
2017-09-21 19:43:53 +02:00
Dalai Felinto
803c757c2b Fix T52855: Eevee: viewport artifacts
Partial revert of 9068c0743e.
This commit tried to do two things:

(1) Fix UBO binding logic [good]
(2) "Improve" texture binding logic [bad]

Don't ever mix different fixes and refactors in the same commit.
2017-09-21 17:41:39 +02:00
Dalai Felinto
a99c64b12f Eevee: Fix wrong MEM_callocN allocation size 2017-09-21 15:52:51 +02:00
Dalai Felinto
9ad2c0b615 Depsgraph and collection enable/visibility
Iterate over invisible objects too, so lamps can still lit the scene.
Also, now you can use a collection to set an object to invisible, not
only to visible.

For example:
Scene > Master collection > bedroom > furniture
Scene > View Layer > bedroom    (visible)
                   > furniture  (invisible)

The View Layer has two linked collections, bedroom and furniture.
This setup will make the furniture collection invisible.

Note: Unlike what was suggested on D2849, this does not make collection
visibility influence camera visibility. I will keep this as a separate
patch.

Reviewers: sergey

Subscribers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D2849
2017-09-21 14:45:08 +02:00
Clément Foucault
9068c0743e DRW: Fix Ubo binding logic and improve Texture binding logic
Ubo needs to be rebound every times the shader changes.
This simplify the logic a bit.

Also modify texture binding logic to potentially reuse more already bound textures.
2017-09-16 02:16:55 +02:00
Clément Foucault
f565d8c4ae Eevee: Fix T52738: Probes are black.
This fix the crappy binding logic.

Note the current method is doing a lot of useless binding. We should somewhat order the texture so that reused textures are already bound most of the time.
2017-09-15 20:09:09 +02:00
Clément Foucault
5ae63f03d9 DRW: Fix texture binding logic. 2017-09-14 01:03:19 +02:00
Clément Foucault
d5478e20cc Eevee: Fix AO disappearing when updating Probe Grids. 2017-09-13 19:40:53 +02:00