Vladimír Vondruš
cc9db2d610
MeshTools: show the more common way of using custom shader attributes.
3 years ago
Vladimír Vondruš
b07d1aae8b
MeshTools: fix concatenate() for more than 4 GB of data.
...
This isn't as easy to auto-test, unfortunately, so hopefully the comment
will ensure it doesn't regress again.
3 years ago
Vladimír Vondruš
fdfa6b31e2
Trade: fix MeshData checks for index/vertex data over 4 GB.
3 years ago
Vladimír Vondruš
582776aeef
Trade: additional sanity assertions for {Mesh,Scene}Data bounds checks.
3 years ago
Vladimír Vondruš
d0aca29ba5
Trade: rewrite MeshData bound assertions similarly to SceneData.
...
There it's done in a significantly more robust way, without relying on
`begin < end` but rather a negative stride.
3 years ago
Vladimír Vondruš
0679cccdf3
Trade: test handling of MeshData and SceneData over 4 GB.
...
Passes for SceneData but fails for MeshData due to 32-bit types used by
accident. The two also have a vastly different calculations in the range
checks, should unify that first.
3 years ago
Vladimír Vondruš
51f9a31d3c
Trade: reorder test case definitions to match declaration order.
3 years ago
Vladimír Vondruš
7e79216c34
doc: use a shorthand expression for populating a GL::Buffer.
3 years ago
Vladimír Vondruš
5f0aa9582d
doc: mention the new SpngImporter in the file format tables.
3 years ago
Vladimír Vondruš
d4cc7dc318
Math: MSVC 2015, nobody asked you to fail here.
3 years ago
Vladimír Vondruš
3e59bf23a1
Doc++, to sync with Python bindings.
3 years ago
Vladimír Vondruš
62c395708e
Math: ability to construct a Color3 from RG and B.
3 years ago
Vladimír Vondruš
b38d3eea89
Shaders: add SSBO support to all shaders.
...
For when there's so much to render that it wouldn't fit into an UBO and
splitting draw calls and binding buffers under an offset is unwanted
overhead.
3 years ago
Vladimír Vondruš
f1df71a000
Shaders: remove various redundant ifdefs.
3 years ago
Vladimír Vondruš
0bc0287ad4
Shaders: no, we don't use any textures in the Line shader.
...
Bad copypaste, bad.
3 years ago
Vladimír Vondruš
521489ac2e
Shaders: don't assert for ARB_uniform_buffer_object presence twice.
...
Done this way only in the Phong shader, everywhere else it's just the
MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED() macro. Some WIP code that I
forgot to clean up?
3 years ago
Vladimír Vondruš
a2b4c85847
Shaders: don't pass light count that gets unused to format().
...
Not sure what was this about originally.
3 years ago
Vladimír Vondruš
b338e35f0c
Shaders: fix instanced MeshVisualizer test on ES2 and WebGL 1.
...
Seems like I never got around to test this variant? Huh.
3 years ago
Vladimír Vondruš
8153adbc1c
Shaders: don't format & pass _LOCATION defines on ES < 3.1 and WebGL.
...
Saves quite a few unnecessary allocations and string operations.
3 years ago
Vladimír Vondruš
1847c7201d
Shaders: use explicit texture location and binding on ES3.1+.
...
No reason not to, reduces the amount of unnecessary driver calls quite
significantly.
3 years ago
Vladimír Vondruš
7707341e47
Shaders: minor cleanup.
3 years ago
Vladimír Vondruš
218aef5016
Shaders: don't define & format irrelevant skinning values for UBOs.
...
The UBO use case doesn't need any initializers or uniform locations for
these, it's just wasted allocations.
3 years ago
Vladimír Vondruš
fdd9d798b3
Shaders: decouple light array size and per-draw light count.
...
So it's possible to have light culling enabled on, say, 64 lights, but
with only at most 3 applied each draw, allowing the shader compiler to
unroll the loop if it makes sense. This also better prepares for SSBO
support where the total light count would be unbounded and thus the
value ignored, and thus the value can be 0.
3 years ago
Vladimír Vondruš
a00952cf95
Shaders: light count isn't used to test anything here.
3 years ago
Vladimír Vondruš
6995ad4fa7
Shaders: update outdated docs about passing stuff to constructors.
...
There's a Configuration class now.
3 years ago
Vladimír Vondruš
1a33796784
Shaders: um what was this comment about, even?
...
Probably some leftover from when I tried a bitmask-based approach
(which failed to deliver as it was too slow to iterate through in the
shader)? Uhh.
3 years ago
Vladimír Vondruš
f2fd6bdccf
Shaders: use zero per-vertex count to disable skinning, not total count.
...
This prepares for SSBO support where the total count is unbounded (and
thus the value is ignored, thus it can be 0).
Also regroup the doc paragraphs so it's clear what's related to UBO
usage and what applies to classic uniforms as well.
3 years ago
Vladimír Vondruš
5d330c28b4
GL: don't try to test texture views w/o texture storage.
...
I wonder how this even passed the test before, given my PKGBUILD also
has a variant that disables ARB_texture_storage?
3 years ago
Vladimír Vondruš
b73f8eca0b
GL: document what's the reasonable value for Framebuffer::clearDepth().
3 years ago
Vladimír Vondruš
862c48517f
Math: add Vector2::{r,g}() and Vector3::rg().
...
For consistency with X/Y accessors. No reason to not have them.
3 years ago
Vladimír Vondruš
73c881f5ae
Math: mention that cross product can be used to calculate triangle area.
3 years ago
Vladimír Vondruš
bd0230865a
Shaders: mark the line shader as experimental.
...
I still expect the API to change slightly to accomodate for line
stipple or textured lines (such as possibly having different smoothness
alongside and across the segment), plus there are some TODOs that might
change how it behaves in certain corner cases.
3 years ago
Vladimír Vondruš
e9e05ecf6c
Shaders: use same index order as MeshTools::compileLines() has.
...
To avoid pointless differences and impossible-to-reproduce bugs.
3 years ago
Vladimír Vondruš
54f7824f2d
doc: update changelog.
3 years ago
Vladimír Vondruš
cfa8604118
Shaders: add a "screenshot" for LineGL.
...
OMG PRETTY!!!
3 years ago
Vladimír Vondruš
f3cc5bd1c1
Shaders,MeshTools: adapt image comparison thresholds to SwiftShader.
3 years ago
Vladimír Vondruš
e615637c21
Shaders,MeshTools: adapt image compare thresholds for NVidia & llvmpipe.
...
Well, most of them, there's two outliers on NVidia that need further
investigation.
3 years ago
Vladimír Vondruš
e3c7410ac7
MeshTools: initial utility for compiling a mesh for the line shader.
...
Currently just the bare minimum, more features such as handling
multiple contiguous strips and loops inside a single mesh or an
overlapping layout will come later.
3 years ago
Vladimír Vondruš
a26d77afb4
MeshTools: remove excessive indentation in a test.
3 years ago
Vladimír Vondruš
327d0cb749
MeshTools: clarify why actually the API isn't on ES2.
3 years ago
Vladimír Vondruš
c8d8fd7e19
Shaders: add debug output for LineVertexAnnotations as well.
...
Need to inspect a generated mesh.
3 years ago
Vladimír Vondruš
c209c27d93
Slight clean up in ImageFlags*D debug printer tests.
...
Not sure why it was printing that random number also for flags that
had actual values.
3 years ago
Vladimír Vondruš
dff1a1ce60
Math: add also castInto(T[], T[]) overloads.
...
For generic code, which would otherwise have to invent some SFINAE
"use castInto() if the types are different and Utility::copy()
otherwise" nastiness in every such case, and that's just annoying.
3 years ago
Vladimír Vondruš
43acb7a5c4
Math: castInto() between [Unsigned]Int and [Unsigned]Long wasn't tested.
...
But it was covered, I suppose due to some other code calling it already.
3 years ago
Vladimír Vondruš
506841f4a9
Shaders: initial implementation of a line shader.
...
The shader requires the input data to be laid out in a rather specific
way, and there will be a dedicated MeshTools utility for it in the
following commits. For independence though, the shader tests use a
custom helper.
The initial implementation has certain corner cases which will be
eventually resolved. For now they are pinned down with repro cases in
the test. But apart from that, it's pretty much usable in practice.
Remaining join styles (round and miter-clip) as well as stipple support
will eventually follow as well.
3 years ago
Vladimír Vondruš
681c98605b
MeshTools: have a separate assert message for input and output.
...
Otherwise it may be hard to guess which of them is failing. *Ideally*
the assert would also contain the stride vs type size, maybe I do
that next time I spend that much time investigating why it asserts.
3 years ago
Vladimír Vondruš
bf347109c9
MeshTools: make generateIndices() work with indexed MeshData.
...
This way one no longer needs to duplicate() the original first, leading
to an enlarged size of vertex data for no reason.
3 years ago
Vladimír Vondruš
971c0d90a7
MeshTools: rename test variable for clarity.
3 years ago
Vladimír Vondruš
d88ec88187
MeshTools: generate*Indices() overloads taking a 2D index buffer.
...
So these can be used directly in the generateIndices() implementation
that takes a MeshData.
3 years ago
Vladimír Vondruš
cfb5b015f7
MeshTools: test generate*Indices() assertions through the top-level API.
...
It delegates to the *Into() implementation but that shouldn't mean the
assert isn't checked there.
3 years ago