Age | Commit message (Collapse) | Author |
|
an unused coordinate missing.
|
|
That was really crappy indeed. Now we have a separate API
for low level OpenGL programs, plus a nice interface for GPU, also
removes some GL calls from main code as a plus :)
The source for the programs is also moved to nice external .glsl files
(not sure which extension convention GPU assemply uses)
|
|
ATI driver does not like declaration of gl_FragColor and glFragData in
the same source file (even though only one of the two is ever
referenced), just use one of the two.
|
|
and on screen rendering.
Aaaaah, the beauty of driver implementations of OpenGL!
Turns out the problem here is that drivers calculate df/dy differently
in some cases (probably because OpenGL counts y reverse to how the
window system does, so drivers can get confused).
Fixed this for the ATI case based on info we have so far, there's also
the Intel case which will be handled separately (missing info on Intel's
renderer string etc).
Unfortunately we can't really fix this for the general case so we'll
have to haldle cases as they come in our tracker and by adding silly
string comparisons in our GPU initialization module <sigh>.
|
|
cards (see T44072)
|
|
This patch will fix the world GLSL (mist, background, ambient) update for the BGE.
Reviewers: moguri, brecht
Reviewed By: moguri, brecht
Subscribers: panzergame
Differential Revision: https://developer.blender.org/D151
|
|
Quite a few things wrong here:
* Mac did not support EXT_draw_instanced, only ARB_draw_instanced
* Draw instanced did not work unless data came from vertex buffer, which
is second time we see weird things with vertex arrays in mac
* There were a few stupid mistakes by me as well, such as binding to
uniform locations for the wrong shaders (it's a wonder it ever worked
:p)
|
|
A new checkbox "High quality" is provided in camera settings to enable
this. This creates a depth of field that is much closer to the rendered
result and even supports aperture blades in the effect, but it's more
expensive too. There are optimizations to do here since the technique is
very fill rate heavy.
People, be careful, this -can- lock up your screen if depth of field
blurring is too extreme.
Technical details:
This uses geometry shaders + instancing and is an adaptation of
techniques gathered from
http://bartwronski.com/2014/04/07/bokeh-depth-of-field-going-insane-
http://advances.realtimerendering.com/s2011/SousaSchulzKazyan%20-
%20in%20Real-Time%20Rendering%20Course).ppt
TODOs:
* Support dithering to minimize banding.
* Optimize fill rate in geometry shader.
|
|
pointing out on irc.
|
|
Previous behaviour would get occlusion at borders which could create
over occlusion at edges of the screen.
|
|
Basically, before drawing X-Rays, we now bind a second depth buffer.
After drawing XRays, we do an extra resolve pass where we overwrite the
non-XRay depth buffer in pixels where the depth is not maximum (which
means background pixel, since depth is cleared before drawing X-Ray
objects).
This ensures both scene and X-Rays keep their depth values and are ready
for compositing. Well, the odd effect due to depth discontinuities can be
expected, and X-Rays are a bit more expensive (extra buffer + resolve pass)
but at least X-Rays won't invalidate depth values anymore. Whee!
|
|
background.
For SSAO supporting this is no problem, for DOF we would ideally do
blurred alpha, but alpha channel in blurred buffers is occupied by coc
field, so use original color alpha instead. It's not entirely correct
but it's better than nothing.
|
|
The issue was caused by the recently added attribute, which is to be
added to the shader function even tho it's not supported.
|
|
This reverts commit ebd4a6e0dd3bdd511f3857dc9192df848f388200.
Trailing '}' is added in C, also we add some extra code as needed.
|
|
|
|
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
|
|
So make it so comparison doesn't imply type-cast.
|
|
Make it so by checking operand sign.
|
|
bounds instead of window bounds). Fixes remaining part of T43346
|
|
internal.
Similar to fix for T42074 we need to multiply with energy -after-
texture application.
|
|
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
|
|
rendered result more closely (all three parameters should match now)
|
|
more closely
|
|
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.
|
|
environmental mapping when crossing the seam boundary.
Also output our favourite magenda on missing texture.
|
|
This is added in the spirit of the general cycles GLSL system
which is pretty much WIP still.
This will only work on cycles at the moment but generating for blender
internal is possible too of course though it will be done in a separate
commit.
This hasn't been tested with all and every node in cycles, but
environment and regular textures with texture coordinates work.
There is some difference between the way cycles treats some coordinates,
which is in world space and the way GLSL treats them, which is in view
space.
We might want to explore and improve this further in the future.
...also </drumroll>
|
|
|
|
Also included mirror ball shader, which was missing.
|
|
Allow binding a texture to a different texture attachment than the
first.
Also fix a number error in seperable gaussian blur shader.
|
|
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D781
|
|
Even though GLSL allows to have polymorphic functions our codegen
is not aware of this at all.
Let's rename the functions for now, but in the future would be handy
to make codegen aware of the polymorphic functions.
|
|
Orthographic case needs different handling.
|
|
shader nodes (Blender Render)
Quite striaghtforward implementation, with the only weird thing that for some reason
my video driver wasn't happy with calling the function "clamp" giving some weirdo
shader compilation error messages.
Called the GPU function clamp_val which can handle float and vec3.
|
|
tangents are directions and should be transformed like directions.
|
|
|
|
The solution is to do the multiplication with the energy in the shader
after texture application.
We might be able to avoid setting dyncol completely, but this needs
better investigation. Some shader paths also look a bit redundant.
Also, texture mapping is not supported very well for light lamps, might
also need investigation.
|
|
|
|
|
|
Few things:
- reflect() takes arguments in this order: N, I, it was swapped
in the previous code for some reason.
- Normal and view vectors are to be normalized. For the view
vector we're now using shade_view() in order to deal with the
ortho camera. However, Cycles does not support ortho camera
for reflection, but this is easy to do in a separate commit.
- Reflection vector is to be in the world space. Kudos to
Antony Riakiotakis for figuring this out!
|
|
avoid software fallback.
|
|
Checked with Brecht, Cycles indeed expects generated to be in 0..1 space
instead of -1..1 as it is in BI.
|
|
Soft light and Linear light blend modes weren't implemented in glsl
Reviewers: psy-fi
Maniphest Tasks: T41456
Differential Revision: https://developer.blender.org/D744
|
|
|
|
ATIs.
This is actually a test to see if this can be enabled on ATI cards.
According to various sources, newer ATI cards supporting GLSL 3.0
support gl_ClippingDistance in shaders, which is the forward compatible
way to do custom clipping.
This fix will bind 6 additional varying variables on ATIs, which may
lead to some shaders not compiling due to limiting out of those
variables, or to performance degradation. Also I do not have an ATI
handy to test.
Having those in mind, this commit may well be reverted later.
Clipping planes are usually 4 (6 is for cube clipping), but making
shaders depend on viewport state is really bad, and would lead to
recompilation, so I took the worst case here to avoid that.
Hopefully driver does some optimization there.
|
|
Clipping border causes a software fallback on ATIs. We have disabled it
in that case but from minor digging on the net seems like Intels support
this, so enable.
|
|
|
|
|
|
|
|
To prevent only shadow lamps from producing negative colors, shr->diff
and shr->spec should've been clamped to positive values after lamp loop.
|
|
Reviewed By: dingto, brecht
Differential Revision: https://developer.blender.org/D507
|