Commit Graph

325 Commits

Author SHA1 Message Date
1d6009d7aa Eevee: Fix tangent being renormalized after interpolation 2019-03-15 22:33:02 +01:00
81531d452c Fix T58694 Eevee: Wrong result when using normal map and face is flipped 2019-03-14 16:53:05 +01:00
7fb7d20c19 Eevee: Fix black mesh when tangent is not present
In this case, the generic vertex attribute is {0,0,0,1}. So we look for
this case.

This fixes black text objects with a normal map applied. Also this could
help porting sculpt mode drawing to Eevee without supporting normal
mapping.

Note that will just fix black meshes due to T61870 but objects will not
show their normal map. So it's not a fix for this issue.
2019-03-13 23:15:11 +01:00
d0fb0d0a9d Fix T60170: Eevee: smoke color does not apply permanently
This was because color is not present in the density texture if there is
only one constant color. Adding it as a uniform.
2019-03-13 23:15:11 +01:00
41cb565880 Fix T60902 Eevee: Environment texture partially visible on transp. render
This was due to environement not being rendered with alpha blending. So
color was still written and contributed to the final render color. Now
we multiply by background alpha so that it removes any background pixels
intensity.

For this reason this made the (incorrect) final premult unecessary.
2019-03-12 22:02:39 +01:00
f16bdf1075 Fix T61380 Geometry normal node incorrect for backfacing faces in Eevee 2019-03-12 22:02:39 +01:00
e1a62fa1a6 Fix T62259: RGB Curves behave differently in Cycles and Eevee
This was due to curve being not extrapolated correctly. Also curvemap range
was not taken into account.
2019-03-07 01:38:06 +01:00
253ff57617 Clamp value in sheen calculation to fix fireflies.
Fixes T59784.

Reviewers: fclem

Reviewed By: fclem

Subscribers: brecht

Maniphest Tasks: T59784

Differential Revision: https://developer.blender.org/D4269
2019-02-18 14:05:16 +01:00
7a41c1634b Merge branch 'blender2.7' 2019-02-14 20:00:37 +01:00
9886ae6331 Fix T61470: incorrect saturation clamping in recent bugfix.
We should clamp the result after multiplication.
2019-02-14 19:28:44 +01:00
dbd9b7590a Merge branch 'blender2.7' 2019-02-13 19:02:43 +01:00
ec559912fb Fix T61470: inconsistent HSV node results with saturation > 1.0.
Values outside the 0..1 range produce negative colors, so now clamp to that
range everywhere. Also fixes improper handling of hue > 2.0 in some places.
2019-02-13 17:06:30 +01:00
68cab3aff6 Cleanup: replace attrib w/ attr
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
2019-01-29 08:32:25 +11:00
7faf0c8c2f Fix T59145: don't clamp color value in Hue Saturation Value node in eevee 2019-01-24 13:58:59 +01:00
065bdc0333 GPUMaterial: Cleanup 2019-01-14 18:33:07 +01:00
3bc87227f5 GPUMaterial: Cleanup / optimization 2019-01-11 16:00:23 +01:00
65fa5a1926 Eevee: Optimize Color Ramp node for common cases. 2018-11-17 18:20:10 +01:00
c599aeaee5 GPU: Cleanup / Opti : Vectorize + MADD and remove unused function 2018-11-17 14:56:18 +01:00
d546269de8 Cleanup: Double semicolon at the end of line 2018-11-15 16:32:18 +01:00
4f11441913 Eevee: Add partial support for the Light Path Node
This makes it possible to tweak indirect lighting in the shader.

Only a subset of the outputs is supported and the ray depth has not exactly
the same meaning:

Is Camera : Supported.
Is Shadow : Supported.
Is Diffuse : Supported.
Is Glossy : Supported.
Is Singular : Not supported. Same as Is Glossy.
Is Reflection : Not supported. Same as Is Glossy.
Is Transmission : Not supported. Same as Is Glossy.
Ray Length : Not supported. Defaults to 1.0.
Ray Depth : Indicate the current bounce when baking the light cache.
Diffuse Depth : Same as Ray Depth but only when baking diffuse light.
Glossy Depth : Same as Ray Depth but only when baking specular light.
Transparent Depth : Not supported. Defaults to 0.
Transmission Depth : Not supported. Same as Glossy Depth.

Caveat: Is Glossy does not work with Screen Space Reflections but does work
with reflection planes (when used with SSR or not).
We have to render the world twice for that to work.
2018-11-08 19:20:40 +01:00
9d12a5aa9e Eevee: Fix geometry node for environments and support true_normal
Also minor cleanup for the Bump node.
2018-11-08 19:20:40 +01:00
bdd44564c9 GPU: Cleanups: Remove GPUMatType, Vectorize / MADD some operations 2018-11-07 22:16:13 +01:00
4f709152f4 Eevee: Add support for interpolation options for Environment Texture nodes 2018-11-07 22:16:13 +01:00
e0edac4cb2 Eevee: Support for extension type in the Node Image Texture
This does not work with the box projection mode. Implementing for box
projection mode would be difficult, slow, and produce a lot of code
duplication. Also i'm not sure this is worth it, as it's not a common use
case.
2018-11-07 22:16:13 +01:00
faecd16d31 Eevee: Fix volumetric broken after recent change 2018-11-07 13:25:28 +01:00
1fe561e662 Eevee: Wireframe: Increase precision a bit
Take the full derivative and compute its length instead of using fwidth.
2018-11-07 00:19:14 +01:00
c3a0af736a Eevee: Make Normal node interactive
Before it was triggering shader recompilation. Include small cleanup/opti.
2018-11-07 00:19:14 +01:00
d6908471c0 Eevee: Fix non normalized Normals in BSDFs and Layer Weight
Although the normal was normalized when evaluating the lighting, the normal
is often used for other purpose. In this case using the non normalized
normal maybe the source of errors.
2018-11-07 00:19:14 +01:00
c6c3d2e0f0 GPU: Cleanup: Vectorize operations and use MADD 2018-11-07 00:19:14 +01:00
8a204ccdb4 Eevee: Support monochromatic Transparent BSDF correctly
This fits Cycles better even if it is only for grey scale values. This only
work if the blend mode is Alpha Blend or Alpha Hashed.
2018-11-07 00:19:14 +01:00
3e6b34dede Eevee: Fix default texture coord for procedural texture in world tree 2018-10-18 15:30:16 +02:00
6ef5bc1b99 Cleanup: node_tex_checker: Vectorize operation in GLSL 2018-10-18 15:30:16 +02:00
342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
667add5fc5 Eevee: Implement Wireframe Node
This implementation is a bit hacky but match cycles pretty close.

If pixel size is not enabled, it will use the geom shader to
compute distances between vertices. This will have a cost.

Implementation is a bit hacky in gpu_codegen to make the geom shader works
in an optional manner.
2018-09-20 17:53:47 +02:00
766d9c2937 GPUMaterial: Fix issue with coloramp and constant interpolation
It was not respecting the clamp to edge texture param because we use
texelFetch directly in this case.
2018-09-11 16:15:43 +02:00
Charlie Jolly
89295c7f6b Eeevee: update to match recent voronoi GLSL features for Cycles.
Differential Revision: https://developer.blender.org/D3680
2018-09-10 19:48:14 +02:00
bb639ccc47 GPUMaterial: Geometry Node: Add support for parametric output
This supports meshes and hairs too. Matches cycles output.

This adds barycentric coords to the GPUBuiltin enum which will also be used
for the wireframe node.
2018-08-22 13:51:02 +02:00
7673867360 GPUMaterial: Fix color ramp node with constant interpolation
Color ramp with constant interpolation must bypass texture filtering and
use nearest neighboor sampling in order to appear correctly sharp.

This patch use a GLSL hack to use nearest sampling on thoses particular
color band.
2018-08-10 16:16:35 +02:00
bf6a22ed6f GPUMaterial: Group all colorband texture together
This lower the use of texture samplers slots and let users use more real
textures in their shaders.

This patch also make the ramp texture 16 bit floating point. Meaning you
can now use value greater than one in your color ramps.

With the limit of 128 colorband per shader (a color band being either a
color ramp, a wavelength node or a curve node (and maybe wavelength node in
the future)).

Only drawback with the current implementation is that it does not remove
colorband from pruned GPUNodes but it shouldn't really matter in practice.

This should fix T56010
2018-08-10 16:16:35 +02:00
ddc2796e4d Eevee: Principled BSDF: Add support for the sheen parameter
This is a rough (but fast) approximation that still match cycles reference
in common case.

In practice, it's just adding more of the diffuse light computed for the
diffuse contribution.
2018-08-09 16:46:03 +02:00
cac43e1765 Eevee: Use "constant folding" for the principle shader
This is more like a static optimisation when some parameters are set to 1.0
or 0.0. In theses case we use a more optimized version of the node.

This also revisit the transmission parameter behaviour to make it closer to
cycles.
2018-08-08 21:27:26 +02:00
82352565b7 Eevee: Remove some of the non-necessary uniforms
The remaining ones are from the attributes linear/srgb switches and from
nodes that should be pruned before running their _gpu function.
2018-08-08 21:26:49 +02:00
e8dd5e5cc6 GPUMaterial: Make Mapping node use UBO storage
This means tweaking parameter is now interactive and does not need to
recompile the shaders.
2018-08-01 22:08:36 +02:00
4510f30026 GPUMaterial: Fix nearest sampling
texelFetch return vec4(0.0) if the target pixel is outside the texture
rect. So we mimic the default repeate mode that we have for linear
interpolation.

Fix T56156 Mapping-Node doesn't work
2018-08-01 22:08:36 +02:00
f07140940c Eevee: Principled: Fix Subsurface input behaviour
Match Cycles behaviour of scalling the SSS radius and don't interpolate
between diffuse and SSS result.
2018-07-21 18:15:31 +02:00
28fa79219d GPUMaterial: Texture Node: Add support for Cubic filtering
Like in cycles it's a bit more slower than linear but it's smoother.

Works for all projection type.
2018-07-20 19:17:15 +02:00
26b6b5871e GPUMaterial: Texture Node: support for nearest (closest) filtering method
Add placeholder for cubic and smart filtering for now.
2018-07-20 19:16:48 +02:00
e7d8908f14 GPUMaterial: Optimize and fix blending in box mapping
Blending was done in srgb space and was not matching cycles.

Optimized by using less branches and more vector operations.
2018-07-20 19:16:48 +02:00
680994643c Merge branch 'master' into blender2.8 2018-07-15 00:54:12 +02:00
83a4e1aaf9 Cycles: add voronoi features and distance settings from Blender.
Features to get the 2nd, 3rd, 4th closest point instead of the closest, and
various distance metrics. No viewport/Eevee support yet.

Patch by Michel Anders, Charlie Jolly and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D3503
2018-07-15 00:45:42 +02:00