Sergey Sharybin
261cd7f6bf
Fix T43649: Geometry node breaks GLSL shading
...
The issue was caused by the recently added attribute, which is to be
added to the shader function even tho it's not supported.
2015-02-13 15:24:35 +05:00
Antony Riakiotakis
090623c6b6
Revert "Add missing trailing '}' in GLSL files"
...
This reverts commit ebd4a6e0dd .
Trailing '}' is added in C, also we add some extra code as needed.
2015-02-12 19:39:10 +01:00
Campbell Barton
ebd4a6e0dd
Add missing trailing '}' in GLSL files
2015-02-13 05:12:15 +11:00
Antony Riakiotakis
5e613198e5
Viewport compositing - first code
...
This commit introduces a few ready made effects for the 3D viewport
and OpenGL rendering.
Included effects are Depth of Field, accessible from camera view
and screen space ambient occlusion. Those effects can be turned on and
tweaked from the shading panel in the 3D viewport.
Off screen rendering will use the settings of the current camera.
WIP documentation can be found here:
http://wiki.blender.org/index.php/User:Psy-Fi/Framebuffer_Post-processing
2015-02-12 18:54:41 +01:00
Campbell Barton
d4934f8f6d
cleanup: style/indentation
2015-02-11 18:39:28 +11:00
Campbell Barton
b12f3cbee7
cleanup: style
2015-02-07 04:50:21 +11:00
Campbell Barton
4cbf2ebdc9
Cleanup: style
2015-02-06 13:55:20 +11:00
Nicholas Bishop
e922903ae8
Use MAX_CUSTOMDATA_LAYER_NAME for size of GPUInput.attribname array
...
Before this was hardcoded to 32, which I think was incorrect because
this is used to store a customdata layer name.
Reviewers: psy-fi, campbellbarton, sergey
Reviewed By: campbellbarton, sergey
Differential Revision: https://developer.blender.org/D1040
2015-02-05 11:20:24 +01:00
Sergey Sharybin
3b0c4d888c
GLSL: On some cards '>' can't operate on 'float' and 'int'
...
So make it so comparison doesn't imply type-cast.
2015-02-04 15:54:42 +05:00
Antony Riakiotakis
c48c20b498
Fix T43530 using blender on remote connection crashes
...
Issue here is that remote connection will use OpenGL 1.1.
There was a call here that would free VBOs always without a check,
however the VBO free function pointer is NULL on such contexts causing a
crash.
This must have been causing some of the crashes with old contexts. While
I think supporting those systems is not such a good idea in general,
they can have a few more moments of support I guess.
Things might be better now for systems using OGL 1.1 though there are
still things that could be done better here - for instance going to
dyntopo can crash immediately because we don't have a fallback
implementation there. It might be worth reimplementing sculpting with
vertex arrays for the legacy case too, but I guess if we move on to
OpenGL 2.1 soon this is a bit of a wasted effort.
2015-02-03 16:18:19 +01:00
Antony Riakiotakis
3ff9e52dca
Fix T43380 modulo operation in GLSL does not return negatives.
...
Make it so by checking operand sign.
2015-02-03 15:08:42 +01:00
Antony Riakiotakis
23e3dbb726
Selection: avoid uninitialized memory read with occlusion queries
2015-02-02 17:45:07 +01:00
Antony Riakiotakis
750506be97
Adjust GLSL drawing of window coordinates from camera view (use camera
...
bounds instead of window bounds). Fixes remaining part of T43346
2015-02-02 14:26:05 +01:00
Campbell Barton
f90891d87e
Add PIL_check_seconds_timer_i to avoid casting
...
note, win32 casts still casts from double.
2015-02-01 02:00:08 +11:00
Antony Riakiotakis
332cf291e4
Fix T43250, lamp node did not use energy when used with nodes in blender
...
internal.
Similar to fix for T42074 we need to multiply with energy -after-
texture application.
2015-01-27 16:34:40 +01:00
Bastien Montagne
fca515838e
Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
...
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
Nicholas Bishop
d44890ee75
Code cleanup: de-duplicate codegen texid assignment
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:10 +01:00
Nicholas Bishop
c5f5012c5a
Code cleanup: use GPUDynamicType instead of int
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:07 +01:00
Nicholas Bishop
8174ea2684
Code cleanup: use GPUDataSource enum instead of int
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:04 +01:00
Nicholas Bishop
3a3d68cd88
Code cleanup: use bool instead of int
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:01 +01:00
Nicholas Bishop
fdb55e3719
Code cleanup: use an enum for GPUNodeLink.image
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:59 +01:00
Nicholas Bishop
6cfc55c4f9
Code cleanup: use enums instead of defines
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:55 +01:00
Nicholas Bishop
42eaf82d10
Code cleanup: move struct GPUFunction and related code out of header
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:53 +01:00
Nicholas Bishop
4c3a49ef34
Code cleanup: use lowercase "gpu" prefix for static functions
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:50 +01:00
Nicholas Bishop
548d222d81
Code cleanup: remove do-nothing function GPU_node_end
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:47 +01:00
Nicholas Bishop
2233a3556d
Code cleanup: remove some UNUSED parameters from static functions
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:44 +01:00
Nicholas Bishop
d1f88c05aa
Code cleanup: retype various fields/parameters from int to GPUType
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:40 +01:00
Nicholas Bishop
a59e590e7f
Code cleanup: remove parameter from GPU_node_link_create()
...
In all but one call the value 0 (aka GPU_NONE) was passed in. Clearer
to just default to GPU_NONE and change the one caller that sets a real
type to do it explicitly.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:34 +01:00
Nicholas Bishop
27284e4f34
Code cleanup: minor comment improvements
...
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:31 +01:00
Nicholas Bishop
8cafa0afa6
Code cleanup: give anomymous enum used for CustomData.type a name
...
Used this in GPU module to clarify what some "ints" really are.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:34:39 +01:00
Campbell Barton
6d78936c43
cleanup: style
2015-01-24 01:59:09 +11:00
Kévin Dietrich
448d143ad0
Fix T43273: vector math cross product inconsistent
...
GLSL missed the normalization step.
Reviewers: psy-fi, sergey, mont29
Reviewed By: mont29, sergey
Subscribers: mont29
Maniphest Tasks: T43273
Differential Revision: https://developer.blender.org/D1000
2015-01-17 14:58:48 +01:00
Antony Riakiotakis
8a547af2bd
Remove border clamping. Usually we just want to clamp to edge instead.
...
Note - checked all glTexImage functions and we never use that. Border is
ifdefed out too here.
2015-01-05 14:25:22 +01:00
Antony Riakiotakis
3414d01411
Use float format for high bit depth textures if available - storage
...
requirements are the same but we may avoid some clipping of float values
for HDRs when used in shaders.
2015-01-05 11:23:54 +01:00
Campbell Barton
aab4f2b762
cleanup: redundant casts & const cast correctness
2015-01-01 23:42:28 +11:00
Antony Riakiotakis
7f356c20dc
Modify shader for texture coordinates of objects to also match the
...
rendered result more closely (all three parameters should match now)
2014-12-31 15:48:16 +01:00
Antony Riakiotakis
f31f28c3f4
Corrections to world texture coordinates to match the rendered result
...
more closely
2014-12-31 15:00:18 +01:00
Campbell Barton
0ae4d7d405
Fix for GPU_materials_free accessing NULL pointer
2014-12-18 02:14:51 +01:00
Antony Riakiotakis
3e61478b1b
Fix T42917 shadow maps not working on ATIs.
...
This is yet another issue with framebuffers. There are two issues: We
need the framebuffer fully bound to check for completeness and when we
bind a depth texture as frame buffer we need to disable read/write.
2014-12-16 21:52:55 +01:00
Antony Riakiotakis
1b2fc74792
Fix typo in VBO
2014-12-16 20:20:41 +01:00
Antony Riakiotakis
137f557246
Remove NULL checking variable after using it.
2014-12-16 12:09:33 +01:00
Antony Riakiotakis
d6beaad01c
Fix T42875 GLSL display not correct in vertex array mode.
...
GLSL used a global variable to store the enabled vertex attributes which
were not set for vertex arrays after the VBO refactor.
2014-12-12 17:59:06 +01:00
Sergey Sharybin
d9ddc99a27
Fix T42184: Normal not displayed correctly in Material Viewport
...
There was a differences between how Cycles and BI treats Normal shader:
- Different normal direction assumption
- Different policy about vector normalization
Previous idea of trying to use single function and flip the output if
needed becomes more tricky, so i've just added new GLSL function which
corresponds to how Cycles deals with the Normal shader.
2014-12-10 19:12:54 +05:00
Antony Riakiotakis
e1e984e437
Fix T42807, variance shadow map broken afterFBO changes.
...
This code was a bit do-it-yourself instead of relying on the API. Should
be OK now.
2014-12-05 16:01:18 +01:00
Dalai Felinto
409043c69d
GPU: code cleanup, no fundamental changes
2014-12-03 17:56:20 -02:00
Antony Riakiotakis
a6bb564c99
Another crappy mistake in VBO code.
2014-12-03 20:20:04 +01:00
Antony Riakiotakis
4afd5db47e
Only annoy coders with warnings, not users.
2014-12-03 19:49:48 +01:00
Antony Riakiotakis
4ee53074aa
Dim down default (no) material for cycles so it matches default material
...
in blender internal
2014-12-01 16:21:02 +01:00
Campbell Barton
46c80d5d11
Correct includes for win32
2014-11-29 19:12:33 +01:00
Campbell Barton
1cb59394ae
Cleanup: use const, avoid float -> double in matrix invert
2014-11-29 17:49:38 +01:00