Commit Graph

55529 Commits

Author SHA1 Message Date
Mike Erwin
e03e977385 OpenGL: call glProgramUniform only if version >= 4.1
Otherwise crash! Called from OpenSubdiv setup code. Might start using this in more places...
2017-05-18 18:30:24 -04:00
Mike Erwin
ff8673399e OpenSubdiv: remove legacy support & display queries
OSD display needs more work, since it uses some legacy OpenGL light and material functions.
2017-05-18 18:30:23 -04:00
Mike Erwin
51278bab5d remove GPU_legacy_support query
In the move to OpenGL 3.3 core profile, we drop support for compatibility profile and older versions.

OpenSubdiv was the only user; I'll update OSD next.
2017-05-18 18:30:23 -04:00
Mike Erwin
414c1c0e77 OpenGL: remove -noglsl option & GPU_extensions_disable
Also removed a leftover reference to the old basic-shader-glsl option.
2017-05-18 18:30:23 -04:00
Mike Erwin
5ed0944ce6 GPU: cleanup GLSL version and standard extensions
Now we always use GLSL 3.3, AKA #version 330. Most of the extensions we used are built into OpenGL 3.3 so we don't need them anymore.

Cleaned up comments related to GLSL version.

Part of T49012
2017-05-18 18:30:23 -04:00
Mike Erwin
7823957455 remove GPU_geometry_shader_support, instanced_drawing_support queries
These are always supported now
- instancing as of GL 3.1
- geometry shaders as of GL 3.2

The change to rna_scene.c could use some cleanup, since we don't really need a runtime query function.
2017-05-18 18:30:23 -04:00
Mike Erwin
8cb3c7bdec remove GPU_display_list_support query
Display lists are not part of modern OpenGL.

Only BGE used this, and I forced those uses to false. Commented out old BGE logic for reference.
2017-05-18 18:30:23 -04:00
Clément Foucault
13687e89d8 GPUViewport: Fix huge memory leak. 2017-05-18 20:32:36 +02:00
Dalai Felinto
740f33d8a2 Remove "Modern Viewport"
The "Modern Viewport" was an option in the Viewport panel that would use
the new fancy wire frame code and some depth debugging functionality.

This was introduced as a quick and dirty way to get the new drawing
system showing in the viewport.

Overtime we built a complete Draw Manager system, leaving this original
approach deprecated which adds clutter to Blender code since it would be
removed sooner or later.

Note: The new fancy wireframes and related shaders (white out other
objects) are still in Blender code, though you can't use them anymore.

If we are to have any of those drawing options they should be integrated
in the new draw manager, instead of integrated in the old drawing
pipeline as it was originally coded.
2017-05-18 18:46:46 +02:00
Clément Foucault
ec774fdb48 Eevee: Fix fresnel factor to match Unreal Engine specular input. 2017-05-18 18:35:55 +02:00
Clément Foucault
e52a7584be Eevee: Fix GPUShader not free. 2017-05-18 18:35:55 +02:00
Dalai Felinto
c2191912ca Freestyle is back for 2.8
It works with Cycles and Blender Internal for now.

The Blender Internal support will disappear, but we should be able to
integrate it with the Draw manager and use it with Clay, Eevee, ...
2017-05-18 17:34:03 +02:00
Dalai Felinto
c36eb9b291 Rename Iterator struct to BLI_Iterator 2017-05-18 16:53:02 +02:00
Clément Foucault
849b26c746 Draw Manager: Fix buffer reuse. 2017-05-18 16:50:48 +02:00
Sergey Sharybin
d92a9a5472 Use the correct depsgraph for freestyle
Freestyle itself is still not working, but that's to be addressed
separately.
2017-05-18 16:14:32 +02:00
Clément Foucault
7490b24241 Draw Manager: Fix instancing. Again. 2017-05-18 16:05:03 +02:00
Clément Foucault
242a044bd1 GPUMaterial: Add support for tangent node. 2017-05-18 16:05:03 +02:00
Dalai Felinto
c55c2dbfba Make sure external engines also render fine with depsgraph + freestyle wip
There is still a crash when using freestyle and Cycles,
but the changes here present are harmless
2017-05-18 14:48:13 +02:00
Campbell Barton
00164f3c70 Correct own error using u32 for back-buffer select 2017-05-18 22:33:34 +10:00
Campbell Barton
dad10ab118 DwM: Support flat-shaded w/ clay & eevee engines
Needed for sculpt mode drawing w/ engines, see: T51497
2017-05-18 20:43:53 +10:00
Bastien Montagne
5dd9e17266 DwM: Armature: Cleanup envelope bone code a bit.
Mainly adding 'wire' suffix to wire/distance drawing func and shader.

Also, match wire vertex shader behavior with solid one regarding
head/tail only drawing (i.e. alwas expect head bone mat, never tail one,
and assume that if a radius is negative, then we only draw on the other
end of the bone).
2017-05-18 12:13:19 +02:00
Bastien Montagne
23f256b24b DwM: Armature: add solid envelope bone drawing.
Envelope bones are now pretty much identical to old drawing code.

Note that currently new DwM drawing code does not seem to care about
wire/solid drawing modes at all, guess this is still TODO... For now we
hence just get both wire and solid for envelope bones, this can be
refined later.
2017-05-18 12:13:19 +02:00
Bastien Montagne
5919919955 DwM: Armature: refine drawing condition of envelope distance outline.
Should match better original 2.7x behavior now.
2017-05-18 12:13:19 +02:00
Campbell Barton
c75cde31db Re-use vertex position VBO in weight-paint mode 2017-05-18 14:53:43 +10:00
Campbell Barton
3900b7b1e7 Cleanup: simplify material checks w/ clay engine
Instead of manipulating args when checking for duplicates,
just convert the material and memcmp.
2017-05-18 13:06:51 +10:00
Campbell Barton
4047715af3 Cleanup: use pre-defined STRINGIFY macro 2017-05-18 11:22:24 +10:00
Clément Foucault
5ec6982a82 Draw Manager: Fix instancing. 2017-05-18 01:50:06 +02:00
Clément Foucault
11e7e0769a Eevee: fix orco. 2017-05-18 01:50:06 +02:00
Clément Foucault
00a5885136 Eevee: Refactor shaders defines 2017-05-18 01:50:06 +02:00
Clément Foucault
af3954fe90 Eevee: fix bug with postprocess buffer sharing. 2017-05-18 01:50:06 +02:00
Clément Foucault
ecee490d13 Eevee: Some changes to default shader.
Use old BI material prop and use a metallic approach.
2017-05-18 01:50:06 +02:00
Dalai Felinto
60cd996c0a Silence warnings in Mac (based on buildbot build report) 2017-05-17 18:13:10 +02:00
Dalai Felinto
970a7c8bb9 Fix blenderplayer 2017-05-17 17:55:31 +02:00
Luca Rood
cd8909fbc9 Fix typo in hair shader view vector 2017-05-17 17:27:48 +02:00
Luca Rood
f628cfd297 Fix T51535: View vector inverting in pespective/ortho 2017-05-17 16:42:38 +02:00
Bastien Montagne
1693d7d887 Fix annoying warning about unused debug var in release builds. 2017-05-17 14:37:30 +02:00
Bastien Montagne
d0ceb1821b DwM: Armature: fix bone distance outline drawing.
This indeed needed its own draw pass, thank to @fclem for the hints!

Also fixes a stupid mistake in bones head/tail coloring.
2017-05-17 14:33:34 +02:00
Bastien Montagne
3c799ba801 DwM: Armature: Add distance outline and wire drawing of envelope bones.
This is not complete, it does not implement 3D solid drawing of
envelope bones. 2D wire is hence always drawn for now.

Some notes:

I did not try to implement the 'capsule' approach suggested by @fclem, because:
  1. I spent enough time on this already, and finally got something working.
  2. I managed to get rid of geometry shader completely.
  3. Current approach allows us to use same shader for
     distance outline and envelope wire.

It's working fine, except for one glitch - superpositions of envelope
outlines do not work as expected, not sure what's wrong here, tried to
disable zbuff, enable GL_BLEND, no luck so far...
I think we need our own 'background' drawpass to get them working (also
to avoid them drawing over the wire lines).
2017-05-17 12:34:06 +02:00
Luca Rood
11c167ff76 Fix particle system batch_cache on object duplication 2017-05-17 11:19:36 +02:00
Campbell Barton
c104b7b0b3 DWM: reuse position VBO for vpaint select overlay 2017-05-17 19:21:16 +10:00
Campbell Barton
a769c4a3a0 Fix weight-painting out of facemask mode w/ hidden faces
Own error in recent commit
2017-05-17 19:08:09 +10:00
Dalai Felinto
c8e96a8b6b Fixup on weightpaint shader after rBfabd55a5e9 2017-05-17 10:35:36 +02:00
Dalai Felinto
fca52c42ae Clay hair: use builtin reflect function 2017-05-17 10:21:08 +02:00
Campbell Barton
fabd55a5e9 DWM: hide hidden verts in weight-paint mode 2017-05-17 18:09:40 +10:00
Campbell Barton
c18c3ff3d5 Cleanup: line length 2017-05-17 17:37:23 +10:00
Campbell Barton
d41f98406f DWM: minor changes to face-flag use 2017-05-17 17:27:20 +10:00
Campbell Barton
e74177d3b1 Correct own error in copying vertex color to VBO's 2017-05-17 17:14:10 +10:00
Campbell Barton
e074ac65a6 DWM: don't use engine drawing for paint modes
Also only use sculpt-mode drawing with the active object.
2017-05-17 17:06:55 +10:00
Campbell Barton
3926e3ef68 DWM: correct unselected face overlay 2017-05-17 16:41:21 +10:00
Campbell Barton
9995bd8532 DWM: use DRWContextState.obact 2017-05-17 16:08:36 +10:00