Commit Graph

268 Commits

Author SHA1 Message Date
Dalai Felinto a3d8ef059c Draw Manager: Implement render info for external engines
This can be used by any engine actually. For example to give feedback
regarding probe caching in Eevee, ....

Unline master, we try to conciliate both the original viewport info
(FPS, view name) and the render info.

Note: I had to split the function in two because the camera alpha
passepartout is handled inside the view3d_draw_region_info function.

Review: Campbell Barton and Clement Foucault.

Thanks to Sergey Sharybin and Pablo Vazquez for some of the design
discussions.
2017-05-04 16:59:58 +02:00
Campbell Barton 6ea45da05c Cleanup: rename ct -> len
Also use 'defgroup' instead of 'index' for passing weight arg.
2017-05-04 23:37:03 +10:00
Dalai Felinto 55ae54c469 Fix relationship lines in draw manager [*]
This fix doesn't really fix the situaion now because at the moment we
only flush the evaluated flags at DEG_OBJECT_ITER time, which is silly.

But it's all we can do until we have CoW.

So the parent visibility flag is not flushed. And even if we flushed its
visibility flag, we would need to rely on having the parent flag flushed
before we get to the object in question.

Anyways, take this commit as a future fix for when depsgraph comes to
rescue all our souls.
2017-05-04 09:57:20 +02:00
Dalai Felinto 628dad4f01 Fix building on Windows and blenderplayer linking after weightpaint engine
Those problems were introduced on 20f95de6ba.
2017-05-03 20:24:42 +02:00
Campbell Barton 8c2b98ffa5 Cleanup: line length 2017-05-04 03:35:01 +10:00
Campbell Barton d96171ab53 Correct struct type (harmless) 2017-05-04 03:17:05 +10:00
Luca Rood 20f95de6ba Weight painting with draw manager
This implements weight rendering with the draw manager, with all drawing
options (Shading, wire, face masking, vertex masking).

This is part of T51208

Reviewers: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D2654
2017-05-03 18:57:35 +02:00
Lukas Stockner 82e242cc72 Merge branch 'master' into blender2.8 2017-05-03 18:33:02 +02:00
Dalai Felinto 673e6fc535 Draw Manager: Bring pose bones to the pose engine
Note: We should test if the armature is the "armature modifier" parent of the
object.

If any good samaritan feels like tackling this, the function to change
is: DRW_pose_mode_armature
2017-05-03 18:06:47 +02:00
Campbell Barton 3bf31c6d23 Move pose-bone colors into draw_data
Also only allocate necessary number of bone segments.
2017-05-04 01:32:16 +10:00
Campbell Barton 1f16703792 Error in last commit 2017-05-04 00:43:54 +10:00
Bastien Montagne 827818d37d Rename bPoseChannel's temp/cache pointer for DrawManager to draw_data.
More generic name, this remains a temp solution anyway, until we have
proper handling of temp data from 'magic DEG'! ;)
2017-05-03 16:18:03 +02:00
Bastien Montagne 6824ee0595 Fix bad scaling of BBone single-segment bones in new Armature drawing code.
Reported by @campbellbarton over irc, thanks.
2017-05-03 16:18:03 +02:00
Campbell Barton 3c91fbf6be Draw Manager: Use color-sets for solid pose-bones 2017-05-04 00:16:31 +10:00
Campbell Barton e0722a2c07 Draw Manager: use pose bone theme and constraint colors 2017-05-04 00:01:10 +10:00
Dalai Felinto 2bec7c6070 Code Style: Don't add padding in a function call 2017-05-03 14:32:29 +02:00
Campbell Barton a2a436bba3 Update comment 2017-05-03 22:03:48 +10:00
Dalai Felinto 5f38a4a238 Draw Manager: Enable Pose engine as part of the weight paint mode
We still need to bring pose bone drawing for the pose engine.

Note: In the future, once we get face-widget selection, we will need to
make sure the pose engien only draws then if "weight paint mode" is not
enabled too.
2017-05-03 12:41:58 +02:00
Dalai Felinto 50a7d104d2 Draw Manager: Fix pose mode not working well.
In the future this will allow us to implement things like face manipulators.

For now however, this is getting on the way of using pose mode
(mesh objects are drawn green).

NOTE: pose engine should also be the one taking care of pose bones

(and for that matter, X-Ray armature option should/could be a property
of the Pose engine even).
2017-05-03 12:16:40 +02:00
Clément Foucault b08fc83d1d Eevee: Fix Lamp Roughness. 2017-05-03 12:08:56 +02:00
Clément Foucault a740495814 Eevee: Add "uber" Shader Output Nodes.
Include Metallic and Specular workflow.
Clearcoat and are not implemented yet.
2017-05-03 12:08:56 +02:00
Clément Foucault 54bde82445 Draw Manager: Introduce a foreach function for all shgroups in a pass. 2017-05-03 12:08:55 +02:00
Campbell Barton bde4499496 Fix draw manager w/ cycles
8b2640f08 introduced the error,
caused by external-engine needing depth mask to be disabled,
which happened to be the case before changing state changing logic.
2017-05-03 20:12:31 +10:00
Bastien Montagne d116932f3a Add BBone and Wire Armature draw types to DrawManager.
Most of this was copying/adapting code from octahedral existing draw
code, tough part was to get BBone matrices to behave as expected, they
are using a fairly specific setup...

Addresses T51365 and T51362.
2017-05-03 08:37:24 +02:00
Campbell Barton 8b2640f088 Draw Manager: fix draw-state switching logic
Changing states didn't properly reset between shading groups
causing the GL state to be wrong based on draw order.

States are now only set when changed.
2017-05-03 08:24:50 +10:00
Campbell Barton 85ca3156fc Cleanup: typedef for empty list
Without this the intent isn't clear.
2017-05-03 05:21:55 +10:00
Campbell Barton 1b6c21c03b Workaround external engines with OpenGL rendering
For now just do the OpenGL render and don't render using the engine.
This is a slightly odd-use case since it makes more sense to do a regular render.
2017-05-03 05:06:13 +10:00
Campbell Barton 075638f85c Cleanup: consistent arg order 2017-05-03 03:06:37 +10:00
Campbell Barton 3f567535da Draw Manager: OpenGL render support
Works for clay-engine but doesn't draw objects with eevee.
2017-05-03 02:52:39 +10:00
Campbell Barton 2b0f02057f Draw Manager: split DRW_draw_view into 2 functions
Needed for offscreen render
2017-05-03 00:45:10 +10:00
Campbell Barton 47239b4041 Cleanup: use depsgraph for scene/layer access 2017-05-03 00:14:54 +10:00
Dalai Felinto ec9ce9e118 Draw Manager: No need of glScissor for external engines 2017-05-02 15:26:18 +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
Clément Foucault 7eebc5113c Eevee: Add support for legacy materials node. (not PBR) 2017-05-01 18:11:21 +02:00
Clément Foucault 62ea911e1a GPUMaterial: Making material node tree compatible with new drawmanager.
- code_generate_fragment : Making sure that shaders uses the new uniforms.
- code_generate_vertex_new : create require attribute based on their names and not their id (see draw_cache_impl_mesh.c).
- add support for ramp textures.
2017-05-01 18:11:21 +02:00
Clément Foucault 19f86a3d5f Mesh Batch Cache: Add support for uv/vcol/tangent data layers.
This is a bad implementation waiting for some improvement that are :
- Gawain support for multiple names. -> will remove duplication of attribute alloc
- Glsl safe name string escaping. -> will remove any risk of hash colision.

Old glsl drawing was relying on attribute being choosen by DerivedMesh at drawing time.
For this reason, we declare all possible attrib "name" for each data layer inside the batches.
In the glsl code, we declare required data by type and name.
Then Gawain only bind vbos if names correspond.
This is way cleaner as we do not need to access the CD itself when drawing.

One other problem is that the hash maybe 11 caracters long and rapidly overload gawain's attrib name buffer.
2017-05-01 18:11:21 +02:00
Clément Foucault 27fc8ae1cb Eevee: Change MAX2 to max_ff 2017-05-01 18:11:21 +02:00
Clément Foucault e868b459bb Eevee: World nodetree gpumaterial compatibility.
- Unify GPUMaterial creation (world/mesh).
- Support for multiple shader variations (not used for now).
- Convert GPUInputs to DRWUniforms to be used with the draw manager.
- Nodetree Update is not supported. The only way to refresh the shaders is to change render engine.
- Cleanup in GPUPass.
- Add new temporary Node Compatibility type. Compatibility types should be removed in the future.
2017-05-01 18:11:21 +02:00
Dalai Felinto 6ef497d401 WITH_CLAY_ENGINE: Should be used for CLAY only, not drawmanager 2017-05-01 15:44:50 +02:00
Dalai Felinto 22be057e37 Draw Manager: Fix copy-paste harmless comment "typo" 2017-05-01 15:44:50 +02:00
Campbell Barton 8f5f4241c0 Cleanup: comment blocks 2017-04-30 03:14:57 +10:00
Campbell Barton 8f028ec840 Cleanup: rename struct for private engine data
Also remove from pass list (there were some duplicate unused entries).
2017-04-29 16:52:12 +10:00
Dalai Felinto e702b391ed Draw manager: Style cleanups 2017-04-29 00:54:11 +02:00
Campbell Barton b2178472e9 Disable custom armature colors 2017-04-29 04:26:31 +10:00
Campbell Barton 08142dde2c Hide object center and other info when drawing sets 2017-04-28 23:52:02 +10:00
Campbell Barton 886966aa38 Correct comment, we need wire_outline data in this case 2017-04-28 23:04:29 +10:00
Campbell Barton 0e94d91048 Draw Manager: pose-mode custom bone display 2017-04-28 22:31:58 +10:00
Campbell Barton 226b6e60b9 Fix draw manager draw-modes interfering with eachother 2017-04-28 05:22:30 +10: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