Commit Graph

398 Commits

Author SHA1 Message Date
2b56d21839 Workbench: Performance: Fix performance drop caused by specular lighting
In my test, the composite pass went from 1.52ms to 0.24ms when specular
lighting is enabled.
2018-11-19 18:05:15 +01:00
ee44dd1b2b Studio Lights: Big Cleanups
* Less Lengthy enum/macro names.
* Optimize computation of Spherical Harmonics.
* Reduce radiance cubemap size a bit. Higher resolution is not necessary.
* Remove STUDIOLIGHT_LIGHT_DIRECTION_CALCULATED (was not used).
* Do windowing on each component separately instead of using luminance.
* Use ITER_PIXELS to iterate on each pixels, using pixel center coords.
* Remove gpu_matcap_3components as it is only needed when creating the gputex.
* Fix a lot of confusion in axis denomination/swizzle.

These changes should not affect functionallity.
2018-11-19 15:48:17 +01:00
69a04c6140 Cleanup: correct flag comparisons
Also use smaller types for shading data.
2018-11-14 23:31:06 +11:00
647a798076 Workbench: Volume: Fix slice display opacity 2018-11-13 11:22:29 +01:00
6ba7345ca5 Workbench: Volumes: Fix volumetrics step length calculation
Step size is now one voxel diagonal.
Fix T57678 Culling of smoke depending on view direction
2018-11-12 21:15:58 +01:00
3eb7928406 Workbench: Volumes: Fix volumetrics rendering twices 2018-11-12 21:12:34 +01:00
13944c3dda Workbench: Scale shadowing based on density
This makes previewing thick smoke a bit more plausible with better shadows.

The shadowing is clamped so that nothing is completely black. That said the
lower bound is pretty low.

This is not an option but could become one if users do not like it in
all situations.
2018-11-07 13:25:28 +01:00
84ad9b102e Workbench: Add cubic filtering for smoke simulation
The option is per domain and only affects the solid / xray / wireframe view.

Eevee is not yet supported.
2018-11-07 13:25:28 +01:00
b23c68a937 Workbench: Improve volume render by removing noise using temporal AA 2018-11-07 00:19:14 +01:00
8af53dbeab Workbench: Fix volumetric blending leading to corrupted render results
Use simpler premultiplied blending.
2018-11-07 00:19:14 +01:00
4c8d88b485 Workbench: Fix non transparent background in viewport render 2018-11-07 00:19:14 +01:00
b4dfe00fd6 Wireframe: Extend Xray slider range
This makes it possible to bypass the depth dithering effect at the cost
of less accurate depth perception.
2018-11-05 16:31:12 +01:00
1fb9fcb333 Cleanup: indentation 2018-10-31 14:43:25 +11:00
4e23c69bfa Workbench: Attenuate dithering effect when using viewport render
Quick hack to get rid of most of the noise when doing a viewport render in
xray or wireframe mode.
2018-10-31 00:46:08 +01:00
a321f68f64 Workbench: Fix shadows on macOS 2018-10-26 10:54:21 +02:00
2c35307f09 Workbench: Use AntiAliasing in render even if not enabled in the User Prefs 2018-10-23 18:04:45 +02:00
8742f6358b Workbench: Fix Wrong AntiAliasing in renders
Was caused by offseting the same matrix for each samples instead of adding
the offset to the original projection matrix.
2018-10-23 18:04:45 +02:00
238d3471bd Xray Mode: Fix wireframe object display type not being correctly occluded 2018-10-23 18:04:45 +02:00
0749808d51 DRW: Fix volume visibility when object draw type is wire or bbox 2018-10-09 12:12:38 +02:00
9cf01d35be Workbench: Smoke: Add support for Color Mappping for smoke debugging 2018-10-09 12:12:38 +02:00
e5c7c21630 Workbench: Smoke: Port back Flame display
The appearance is a bit different than 2.79 where the flame was just added
on top of the smoke without correct blending.

Now it's much more realistic and using volumetric integration. You can see
the smoke actually masking the flame.

The other difference is that the flame color was not using proper color
managed blending. Now with the use of filmic it shows bright yellow.
This could be adjusted and displayed as a user parameter in the future.
2018-10-08 17:20:09 +02:00
eea22dd5ef Workbench: Smoke: Fix display
Includes the following fixes
- Fix smoke texture creation: data was interpreted as Byte instead of Floats.
- Fix Velocity texture not being free after draw: also was causing crashes.
- Fix display_thickness not being copied during COW.
- Fix Blending and general volume rendering algorithm.
- Add Volume Shadowing support.
2018-10-08 17:20:09 +02:00
04064fb186 Cleanup: use DRW_object_is_* for object checks
Also use const qualifier for object's.
2018-10-08 10:43:34 +11:00
9869e4ffe5 Fix T56992 caused by typo in previous fix 2018-10-04 14:56:51 +02:00
34a627f345 Fix T56992: OpenGL Render Engine ignores Transparent Background
Correct the outline blending for alpha 0 background.
2018-10-03 15:44:12 +02:00
29c8c6cf4f Fix T56940: crash rendering with OpenGL as engine. 2018-09-28 10:39:20 +02:00
5732d9e1dc Wireframe/Xray: Make Xray option local to wireframe mode
This commit make the Xray option for the wireframe different from the other
shading mode. This makes it possible to rapidly switch between wireframe +
Xray and Solid mode without Xray.

Xray alpha is also decoupled.

Both variables are duplicated and exposed separately through RNA.
2018-09-26 20:31:20 +02:00
3523958de9 DRW: Add back wireframe mode
This is using the existing engine (workbench forward) with 0.0 xray_alpha
and forcing wireframes on all objects.

There is no workflow/shortcut changes in this commit.
2018-09-21 15:45:03 +02:00
6b433f4eb3 Merge branch 'master' into blender2.8 2018-09-19 18:20:50 +02:00
f35e9f047a Merge branch 'master' into blender2.8 2018-09-19 12:14:36 +10:00
5ae531d813 Cleanup: spelling 2018-09-18 16:35:13 +10:00
6489243332 DRW: Fix background image display
This make the workbench draw everything in the background routine just like
eevee. This is because the workbench uses floating point buffers too and
rendering background to this buffer makes it incorrect without proper
color management.

This could be improved because in xray the background is not blended but
dithered as it's drawn after the main pass.
2018-08-22 13:51:02 +02:00
7eaf00bfb0 Cleanup: style 2018-08-22 10:10:12 +10:00
acc4507f1b Workbench: Support XRay rendering in OpenGL
OpenGL rendering only implemented the deferred renderer. This commit
will add the forward renderer. The forward renderer is used when XRay
mode is enabled
2018-08-21 11:00:46 +02:00
1c7119a336 Wrokbench: Add support for maximum drawtype OB_TEXTURE 2018-08-20 16:21:44 +02:00
8b79a150f8 Workbench: Fix buggy shadow
Was caused by shadow bbox not being updated.
2018-08-17 13:04:26 +02:00
c761153f64 Overlays: Support for wireframes and edit mode overlay on xray objects 2018-08-16 23:57:59 +02:00
32e57fe4e7 GPUFramebuffer: Fix wrong stencil clearing 2018-08-16 23:57:59 +02:00
485b8d41be Workbench: Add support for the xray object option
Xray object can be see through other objects. They cast shadows as well
but cannot receive then.
2018-08-14 21:38:13 +02:00
fe6e751e69 Workbench: Correct ifndef after recent changes
Usage of matcap image uniform had different ifdef than definition
of that uniform. Assuming the usage was correct, and the definition
needed an update.

Prevents shader from compilation failure and from aborts in debug
builds.
2018-07-31 10:25:54 +02:00
b51dcb6f07 Fix crash w/ missing matcaps
Building w/o EXR caused this.
2018-07-31 16:44:35 +10:00
c86b5fa820 Viewport: use Filmic without scene exposure/gamma/curves for workbench.
This ignores the scene color managment view settings for solid mode and
lookdev when not using scene lights and world. The scene settings are
intended for tweaking renders and should not affect studio lighting and
matcaps.

There may be cases where a simple sRGB transform is better than Filmic
and we could add configuration for this. Not sure if it really matters
and it may be better if we just assume matcaps and studiolights are all
created for one view transform.

Differential Revision: https://developer.blender.org/D3569
2018-07-30 18:51:15 +02:00
6d6deeb700 Workbench: Use FXAA instead of TAA when viewport is animated.
Fix T55996 "Playback in "Active Editor Only" doesn't work"
2018-07-30 16:48:51 +02:00
f8f4feefb8 Cleanup: trailing space 2018-07-30 15:40:09 +10:00
70966af513 Workbench: option to change background
Replaced the draw world option with a shading.background_type enum.
Where the user can select Theme, World or a Custom color.

World and theme colors do not always work in workbench. We needed to
have an option what the user could control locally (per viewport).
Especially when using linked data.

I removed the world background drawing from the draw_manager. It was never used as EEVEE and Workbench both override the logic.

Not 100% sure about the naming of Theme, World, Viewport.
In other parts of blender's codebase World is sometimes called Scene.
Will stick to the names that describes its location best.

{F3990139}

Reviewers: fclem, campbellbarton

Reviewed By: fclem

Subscribers: venomgfx

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3551
2018-07-27 15:28:15 +02:00
c924f6f53f Workbench: Fix missing geometry on Iris 640/630 GPUs
For some reason 32c5972653 broke display of
solid meshes in workbench.

After some investigation, it seems that the vertex coordinate output is
degenerated even if the input is correct and the matrix too.

Removing dead code seems to fix the problem. So maybe the GLSL preprocessor
is not doing what it should?
2018-07-24 16:51:01 +02:00
a185bf3b85 Workbench: Add backface culling support 2018-07-20 12:41:54 +02:00
9df1e54079 Cleanup: style 2018-07-19 16:06:37 +10:00
9d514a4e6f Cleanup: remove debug comment. 2018-07-18 18:11:59 +02:00
8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00