Vladimír Vondruš
843160f58a
python: throw instead of returning a falsy value in shader APIs.
7 years ago
Vladimír Vondruš
3f0aa76c28
python: expose Shaders::Flat.
7 years ago
Vladimír Vondruš
313e74142c
python: expose texturing in Phong.
7 years ago
Vladimír Vondruš
40891858d6
python: raise Python exceptions for shader API usage failures.
7 years ago
Vladimír Vondruš
7f82f76eba
python: test gl.AbstractShaderProgram.set_uniform() as well.
7 years ago
Vladimír Vondruš
3c9643ce74
python: expose textures and related APIs.
7 years ago
Vladimír Vondruš
fdf5671c4c
python: implicitly test for GL errors in all tests.
7 years ago
Vladimír Vondruš
79ac50e11a
python: expose gl.Renderer.error.
...
Need that for tests.
7 years ago
Vladimír Vondruš
d818e40698
python: implemented vector swizzles.
7 years ago
Vladimír Vondruš
f9851bdb1e
python: expose shader interface APIs.
...
Custom shaders now possible.
7 years ago
Vladimír Vondruš
14f7810870
python: finish the magic and docs for Matrix[34].scaling() and friends.
...
This is so ugly it's beautiful. The translation needed a metaclass to
work properly, but the undoubtedly worst/best is making those exposed
nicely in the docs.
7 years ago
Vladimír Vondruš
d50b79d698
python: expose gl.Version and related utilities.
7 years ago
Vladimír Vondruš
128c2aa0af
python: use an underscore for the less readable PixelFormat values.
7 years ago
Vladimír Vondruš
9dc569945f
python: a better way to skip GL tests.
...
Because we want to test building GLX, EGL and WGL implementations.
7 years ago
Vladimír Vondruš
067c45e792
python: skip numpy tests if it's not installed.
7 years ago
Vladimír Vondruš
fa3c0bdd05
python: better name for the gl.Framebuffer attachment owners property.
7 years ago
Vladimír Vondruš
3b7cfa4117
python: bind framebuffer reading.
7 years ago
Vladimír Vondruš
2ac4ca3338
python: expose basic Framebuffer.
7 years ago
Vladimír Vondruš
b5e4253960
python: expose GL::RenderbufferFormat and GL::Renderbuffer.
7 years ago
Vladimír Vondruš
59969c3f67
python: expose (Mutable)ImageView.
7 years ago
Vladimír Vondruš
d5379c10eb
python: expose buffer objects owned by gl.Mesh.
...
Makes testing much easier.
7 years ago
Vladimír Vondruš
1e4a9c424e
python: bind PixelFormat and PixelStorage.
...
Just the uncompressed ones for now.
7 years ago
Vladimír Vondruš
3dcb176c80
python: bind Math::Range.
7 years ago
Vladimír Vondruš
2d2d6d5762
magnum: one more test to really check all variants.
7 years ago
Vladimír Vondruš
c2ac530fc2
python: additions to the math benchmark.
7 years ago
Vladimír Vondruš
22a17cb5b8
python: slightly improve perf of __getitem__ on matrices/vectors.
...
Also test them properly. The full optimization is waiting for a pybind
PR to get merged.
7 years ago
Vladimír Vondruš
d1d6cb9ec0
python/magum/math: switch to our own buffer protocol implementation.
...
Also don't needlessly define buffer protocol again for subclasses (such
as Matrix3 or Color4) as the base can handle that just fine.
7 years ago
Vladimír Vondruš
7549d107de
python: implement buffer protocol for Vector types as well.
...
This makes Vector3 to np.array conversion about 20x faster. Yes, *that*
much. Crazy. Timings from the benchmark added in previous commit before:
np.array([]) 0.66096 µs
np.array([1.0, 2.0, 3.0]) 0.70623 µs
a = array.array("f", [1.0, 2.0, 3.0]); np.array(a) 0.57877 µs
a = Vector3(1.0, 2.0, 3.0); np.array(a) 18.18542 µs
after:
np.array([]) 0.57162 µs
np.array([1.0, 2.0, 3.0]) 0.68309 µs
a = array.array("f", [1.0, 2.0, 3.0]); np.array(a) 0.53958 µs
a = Vector3(1.0, 2.0, 3.0); np.array(a) 0.74818 µs
There's still some overhead that could be removed I think, making the
Vector3-to-numpy conversion faster than list-to-numpy.
7 years ago
Vladimír Vondruš
6f6f6dacba
python: benchmark math / numpy / buffer protocol things.
...
Lots of optimization opportunities here. In particular, the conversion
of Vector3 to np.array is *crazy slow*, turns out to be caused mainly by
the overhead of exception throwing in pybind11. In case of Matrix3 to
np.array conversion there's no such overhead because the buffer protocol
takes care of that.
Another thing is that pybind11 buffer protocol interface has a
relatively large overhead compared to e.g. python's own array.array. I
blame the unneded allocations.
7 years ago
Vladimír Vondruš
7fba2a030e
python: test at least the temporary property.
7 years ago
Vladimír Vondruš
58e1b3c5d9
python: make scenegraph features actually instantiable from python.
7 years ago
Vladimír Vondruš
d5b5b55d2f
python: make sure all Matrix static constructors return proper type.
...
And test for those.
7 years ago
Vladimír Vondruš
2cfb061d7b
python: expose TRS SceneGraph implementation.
7 years ago
Vladimír Vondruš
52a0650cd2
python: expose at least underscored Matrix[34]._translation property.
...
Still need to figure out a way to expose the property with the same name
as a static function, but this has to suffice for now.
7 years ago
Vladimír Vondruš
012bccffbd
python: make room for more scenegraph transformation implementations.
...
Also might make it more parallel, hopefully.
7 years ago
Vladimír Vondruš
82862b8bcd
python: numpy compatibility for matrices and vectors.
7 years ago
Vladimír Vondruš
124980cec4
python: return proper type when doing operations on Color.
7 years ago
Vladimír Vondruš
dc1ef106bf
python: improve matrix bindings code coverage.
7 years ago
Vladimír Vondruš
452d9478ab
python: make it possible to create matrices from nested tuples.
...
Ugh, I need to drop this std::tuple. It makes code complicated for no
reason.
7 years ago
Vladimír Vondruš
464154adca
python: implement conversions between different underlying types.
...
Such a tiny feature and such a pain when it's not there.
7 years ago
Vladimír Vondruš
ecc616b48c
python: expose minimum of GL::Renderer.
7 years ago
Vladimír Vondruš
2c82dc8b3d
python: make Matrix4 operations return Matrix4, not Matrix4x4.
...
Similarly for Matrix3. Also make it implicitly convertible from the base
type.
7 years ago
Vladimír Vondruš
2ae83a0c26
python: make ArrayView properly convertible from Python array.
...
Also fix element sizes that aren't 1.
7 years ago
Vladimír Vondruš
2b0dfaa22a
python: expose MeshTools::compile().
7 years ago
Vladimír Vondruš
4b58ba5204
python: Cube and Square from Primitives.
7 years ago
Vladimír Vondruš
293c5eca64
python: *very* little from Trade.
7 years ago
Vladimír Vondruš
8b1efde15f
python: add generic MeshPrimitive and MeshIndexType enums.
7 years ago
Vladimír Vondruš
0db853a483
python: expose the (almost) full Phong shader.
...
Except textures.
7 years ago
Vladimír Vondruš
998c428355
python: expose Color3 and Color4.
...
Mainly for RGB -> RGBA shortcuts. Need to invent some nice decoding from
a string.
7 years ago
Vladimír Vondruš
ad01c1a306
python: initial SceneGraph bits.
7 years ago