Age | Commit message (Collapse) | Author |
|
defines a uniform that reflects the eye being rendered in stereo mode:
0.0 for the left eye, 0.5 for the right eye.
In non stereo mode, the value of the uniform is fixed to 0.0.
The typical use of this uniform is in stereo mode to sample stereo textures
containing the left and right eye images in a top-bottom order.
python:
shader = obj.meshes[0].materials[mat].getShader()
shader.setUniformEyef("eye")
shader:
uniform float eye;
uniform sampler2D tex;
void main(void)
{
vec4 color;
float ty, tx;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*0.5;
// ty will be between 0 and 0.5 for the left eye render
// and 0.5 and 1.0 for the right eye render.
color = texture(tex, vec2(tx, ty));
...
}
|
|
The assembler version in Windows used to return the previous value
of the variable while all the other versions return the new value.
This is now fixed for consistency.
Note: this bug had no effect on blender because no part of the code
use the return value of these functions, but the future BGE DeckLink
module makes use of it to implement reference counter.
|
|
bge.logic.setRender(flag) to enable/disable render.
The render pass is enabled by default but it can be disabled with
bge.logic.setRender(False).
Once disabled, the render pass is skipped and a new logic frame starts
immediately. Note that VSync no longer limits the fps when render is off
but the 'Use Frame Rate' option in the Render Properties still does.
To run as many frames as possible, untick the option
This function is useful when you don't need the default render, e.g.
when doing offscreen render to an alternate device than the monitor.
Note that without VSync, you must limit the frame rate by other means.
fbo = bge.render.offScreenCreate(width,height,[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
Use this method to create an offscreen buffer of given size, with given MSAA
samples and targetting either a render buffer (bge.render.RAS_OFS_RENDER_BUFFER)
or a texture (bge.render.RAS_OFS_RENDER_TEXTURE). Use the former if you want to
retrieve the frame buffer on the host and the latter if you want to pass the render
to another context (texture are proper OGL object, render buffers aren't)
The object created by this function can only be used as a parameter of the
bge.texture.ImageRender() constructor to send the the render to the FBO rather
than to the frame buffer. This is best suited when you want to create a render
of specific size, or if you need an image with an alpha channel.
bge.texture.<imagetype>.refresh(buffer=None, format="RGBA", ts=-1.0)
Without arg, the refresh method of the image objects is pretty much a no-op, it
simply invalidates the image so that on next texture refresh, the image will
be recalculated.
It is now possible to pass an optional buffer object to transfer the image (and
recalculate it if it was invalid) to an external object. The object must implement
the 'buffer protocol'. The image will be transfered as "RGBA" or "BGRA" pixels
depending on format argument (only those 2 formats are supported) and ts is an
optional timestamp in the image depends on it (e.g. VideoFFmpeg playing a video file).
With this function you don't need anymore to link the image object to a Texture
object to use: the image object is self-sufficient.
bge.texture.ImageRender(scene, camera, fbo=None)
Render to buffer is possible by passing a FBO object (see offScreenCreate).
bge.texture.ImageRender.render()
Allows asynchronous render: call this method to render the scene but without
extracting the pixels yet. The function returns as soon as the render commands
have been send to the GPU. The render will proceed asynchronously in the GPU
while the host can perform other tasks.
To complete the render, you can either call refresh() directly of refresh the texture
to which this object is the source. Asynchronous render is useful to achieve optimal
performance: call render() on frame N and refresh() on frame N+1 to give as much as
time as possible to the GPU to render the frame while the game engine can perform other tasks.
Support negative scale on camera.
Camera scale was previously ignored in the BGE.
It is now injected in the modelview matrix as a vertical or horizontal flip
of the scene (respectively if scaleY<0 and scaleX<0).
Note that the actual value of the scale is not used, only the sign.
This allows to flip the image produced by ImageRender() without any performance
degradation: the flip is integrated in the render itself.
Optimized image transfer from ImageRender to buffer.
Previously, images that were transferred to the host were always going through
buffers in VideoTexture. It is now possible to transfer ImageRender
images to external buffer without intermediate copy (i.e. directly from OGL to buffer)
if the attributes of the ImageRender objects are set as follow:
flip=False, alpha=True, scale=False, depth=False, zbuff=False.
(if you need to flip the image, use camera negative scale)
|
|
|
|
working on OS X.
|
|
Differential Revision: https://developer.blender.org/D2038
|
|
sense when no preview is available...
|
|
Use to fill an array of bytes to random values.
|
|
Own stupid off-by-one regression in rB019ce363b01bba0afe1 and later...
|
|
Thai font is a complex script that assumes full featured unicode layout engine,
while Blender only knows about basic kerning (offset of a char based on the previous one).
So this commit edits Thai part of our i18n font to fix the very bad spacing of thai chars
we had in Blender so far.
Work done by Hồ Châu, many thanks!
|
|
|
|
|
|
|
|
Stipple isnt left on during object drawing
|
|
|
|
|
|
A new option '-a' can be passed to the blenderplayer. It forces the
framebuffer to have an alpha channel.
This can be used in VideoTexture to return a image with alpha channel
with ImageViewport (provided alpha is set to True on the ImageViewport
object and that the background color alpha channel is 0, which is the
default).
Without the -a option, the frame buffer has no alpha channel and
ImageViewport always returns an opaque image, no matter what.
In Linux, the player window will be rendered transparently over
the desktop.
In Windows, the player window is still rendered opaque because
transparency of the window is only possible using the 'compositing'
functions of Windows. The code is there but not enabled (look for
WIN32_COMPOSITING) because 1) it doesn't work so well 2) it requires
a DLL that is only available on Vista and up.
give precedence to AA over Swap copy:
Certain GPU (intel) will not allow MSAA together with swap copy.
Previously, swap copy had priority over MSAA: fewer AA samples would be
chosen if it was the condition to get swap copy. This patch reverse the
logic: swap copy will be abandonned if another swap method (undefined or
exchange) will provide the number of AA samples requested. If no AA
samples is requested, swap copy still has the priority of course.
|
|
|
|
Also add utility functions: GPU_basic_shader_bind_enable/disable
so we don't have to get the previous state every time and manipulate it
|
|
The purpose of the patch is to replace deprecated glShadeModel.
To decrease glShadeModel calls I've set GL_SMOOTH by default
Reviewers: merwin, brecht
Reviewed By: brecht
Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D1958
|
|
particular scene.
Regression from recent rB2c5dc66d5effd4072f438afb, if last item of last chunk of a mempool was valid,
it would not be returned by mempool iterator step, which would always return NULL in that case.
|
|
Please do not do cleanups in minimal configuration, doing that has been
proven to only cause issues without solving anything meaningful ;)
|
|
|
|
|
|
Replace glDrawPixels w/ glaDrawPixelsTex
|
|
Drawing a single stick bone set the alignment to 1, applying this setting to the rest of Blender.
|
|
|
|
Could give barely measurable speedup on a complex rigs.
|
|
Became obsolete after recent changes.
|
|
bones
Avoid annoying checks form inside operations loop, gives few percent speedup in
files like army_of_blenrigs.
|
|
|
|
It's still not completely working - there are still some glitches - but far better than before.
To make buttons of the uiList work, you have to add a 'check' callback to the operator that invokes the menu. Only if it returns True, the uiList gets refreshed. To avoid this we have to make the region refresh tagging in the entire button handling a bit smarter.
Changes I had to do:
* Call uiList handling from menu/popup handling if needed.
* Make uiList handling use special popup refresh tag if placed in menu.
* Allow popups invoked from py operator to tag for refresh by using operator 'check' callback.
* Tag popup for refresh when resizing uiList.
Mostly fixes T48612.
|
|
|
|
|
|
|
|
Caused problem w/ basic-shader
|
|
|
|
|
|
|
|
|
|
Don't store maximum length of text per undo step,
or attempt to pack all data in a single array.
Was storing 32766 characters per undo step, irrespective of actual text length.
|
|
|
|
|
|
The way cloth is coded, structural springs are only effective when stretched, while bending springs act only when shrunk. However, when cloth is exactly in its rest shape, neither have any effect, and effectively don't exist for the implicit solver.
This creates a stability problem in the initial frames of the simulation, especially considering that gravity seems to act so precisely that it doesn't disturb the strict equality of lengths, so in parts of the cloth this springless state can continue for quite a while.
Here is an example of things going haywire because of this and some suspicious logic in collision code acting together: {F314558}
Changing the condition so that structural springs are active even at exactly rest length fixes this test case. The use of >= is also supported by the original paper that the cloth implementation in blender is based on.
Reviewers: lukastoenne
Reviewed By: lukastoenne
Projects: #bf_blender
Differential Revision: https://developer.blender.org/D2028
|
|
|
|
|
|
All text was displaying black.
BLF uses alpha-only textures which aren't supported by the basic-shader,
Workaround this by using texture swizzle so the RGB components of the texture are set to 1.
|
|
This hopefully fixes T48383 by avoiding two numerical problems that I found in the volume code.
Reviewers: sergey, dingto, brecht
Reviewed By: sergey, dingto, brecht
Maniphest Tasks: T48383
Differential Revision: https://developer.blender.org/D2051
|
|
It's not obvious that they use the mouse coordinate of the initial key-press event (behavior since rBf1f33ba7be2d), so added comment.
Also corrected other comments.
|
|
Looks like a line was forgotten in the 'BOTH' case in code...
|