Browse Source

*Tools: deinlined heavy functions, removed redundant `inline`.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
5bf61ceb74
  1. 10
      src/DebugTools/ForceRenderer.h
  2. 2
      src/DebugTools/Implementation/ForceRendererTransformation.h
  3. 16
      src/DebugTools/ObjectRenderer.cpp
  4. 6
      src/DebugTools/ObjectRenderer.h
  5. 2
      src/DebugTools/Profiler.h
  6. 14
      src/DebugTools/ShapeRenderer.h
  7. 88
      src/MeshTools/Clean.h
  8. 8
      src/MeshTools/CombineIndexedArrays.h
  9. 6
      src/MeshTools/CompressIndices.cpp
  10. 20
      src/MeshTools/Interleave.h
  11. 74
      src/MeshTools/Subdivide.h
  12. 2
      src/MeshTools/Test/SubdivideCleanBenchmark.h
  13. 2
      src/MeshTools/Test/SubdivideTest.cpp
  14. 2
      src/MeshTools/Tipsify.h
  15. 4
      src/TextureTools/DistanceField.cpp

10
src/DebugTools/ForceRenderer.h

@ -44,10 +44,10 @@ See ForceRenderer documentation for more information.
*/ */
class ForceRendererOptions { class ForceRendererOptions {
public: public:
inline constexpr ForceRendererOptions(): _color(1.0f), _size(1.0f) {} constexpr ForceRendererOptions(): _color(1.0f), _size(1.0f) {}
/** @brief Color of rendered arrow */ /** @brief Color of rendered arrow */
inline constexpr Color4<> color() const { return _color; } constexpr Color4<> color() const { return _color; }
/** /**
* @brief Set color of rendered arrow * @brief Set color of rendered arrow
@ -55,13 +55,13 @@ class ForceRendererOptions {
* *
* Default is 100% opaque white. * Default is 100% opaque white.
*/ */
inline ForceRendererOptions* setColor(const Color4<>& color) { ForceRendererOptions* setColor(const Color4<>& color) {
_color = color; _color = color;
return this; return this;
} }
/** @brief Scale of rendered arrow */ /** @brief Scale of rendered arrow */
inline constexpr Float scale() const { return _size; } constexpr Float scale() const { return _size; }
/** /**
* @brief Set scale of rendered arrow * @brief Set scale of rendered arrow
@ -69,7 +69,7 @@ class ForceRendererOptions {
* *
* Default is `1.0f`. * Default is `1.0f`.
*/ */
inline ForceRendererOptions* setSize(Float size) { ForceRendererOptions* setSize(Float size) {
_size = size; _size = size;
return this; return this;
} }

2
src/DebugTools/Implementation/ForceRendererTransformation.h

@ -37,7 +37,7 @@ template<> inline Matrix3 forceRendererTransformation<2>(const Vector2& forcePos
return Matrix3::from({force, Vector2(-force.y(), force.x())}, forcePosition); return Matrix3::from({force, Vector2(-force.y(), force.x())}, forcePosition);
} }
template<> inline Matrix4 forceRendererTransformation<3>(const Vector3& forcePosition, const Vector3& force) { template<> Matrix4 forceRendererTransformation<3>(const Vector3& forcePosition, const Vector3& force) {
const Matrix4 translation = Matrix4::translation(forcePosition); const Matrix4 translation = Matrix4::translation(forcePosition);
const Float forceLength = force.length(); const Float forceLength = force.length();

16
src/DebugTools/ObjectRenderer.cpp

@ -37,10 +37,10 @@ namespace {
template<UnsignedInt> struct Renderer; template<UnsignedInt> struct Renderer;
template<> struct Renderer<2> { template<> struct Renderer<2> {
inline static ResourceKey shader() { return {"VertexColorShader2D"}; } static ResourceKey shader() { return {"VertexColorShader2D"}; }
inline static ResourceKey vertexBuffer() { return {"object2d-vertices"}; } static ResourceKey vertexBuffer() { return {"object2d-vertices"}; }
inline static ResourceKey indexBuffer() { return {"object2d-indices"}; } static ResourceKey indexBuffer() { return {"object2d-indices"}; }
inline static ResourceKey mesh() { return {"object2d"}; } static ResourceKey mesh() { return {"object2d"}; }
static const std::array<Vector2, 8> positions; static const std::array<Vector2, 8> positions;
static const std::array<Color3<>, 8> colors; static const std::array<Color3<>, 8> colors;
@ -82,10 +82,10 @@ const std::array<UnsignedByte, 12> Renderer<2>::indices{{
}}; }};
template<> struct Renderer<3> { template<> struct Renderer<3> {
inline static ResourceKey shader() { return {"VertexColorShader3D"}; } static ResourceKey shader() { return {"VertexColorShader3D"}; }
inline static ResourceKey vertexBuffer() { return {"object3d-vertices"}; } static ResourceKey vertexBuffer() { return {"object3d-vertices"}; }
inline static ResourceKey indexBuffer() { return {"object3d-indices"}; } static ResourceKey indexBuffer() { return {"object3d-indices"}; }
inline static ResourceKey mesh() { return {"object3d"}; } static ResourceKey mesh() { return {"object3d"}; }
static const std::array<Vector3, 12> positions; static const std::array<Vector3, 12> positions;
static const std::array<Color3<>, 12> colors; static const std::array<Color3<>, 12> colors;

6
src/DebugTools/ObjectRenderer.h

@ -43,10 +43,10 @@ See ObjectRenderer documentation for more information.
*/ */
class ObjectRendererOptions { class ObjectRendererOptions {
public: public:
inline constexpr ObjectRendererOptions(): _size(1.0f) {} constexpr ObjectRendererOptions(): _size(1.0f) {}
/** @brief Size of the rendered axes */ /** @brief Size of the rendered axes */
inline constexpr Float size() const { return _size; } constexpr Float size() const { return _size; }
/** /**
* @brief Set size of the rendered axes * @brief Set size of the rendered axes
@ -54,7 +54,7 @@ class ObjectRendererOptions {
* *
* Default is `1.0f`. * Default is `1.0f`.
*/ */
inline ObjectRendererOptions* setSize(Float size) { ObjectRendererOptions* setSize(Float size) {
_size = size; _size = size;
return this; return this;
} }

2
src/DebugTools/Profiler.h

@ -171,7 +171,7 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
* Same as calling `start(Profiler::otherSection)`. * Same as calling `start(Profiler::otherSection)`.
* @note Does nothing if profiling is disabled. * @note Does nothing if profiling is disabled.
*/ */
inline void start() { start(otherSection); } void start() { start(otherSection); }
/** /**
* @brief Stop profiling * @brief Stop profiling

14
src/DebugTools/ShapeRenderer.h

@ -66,10 +66,10 @@ class ShapeRendererOptions {
Solid Solid
}; };
inline constexpr ShapeRendererOptions(): _color(1.0f), _pointSize(0.25f), _renderMode(RenderMode::Wireframe) {} constexpr ShapeRendererOptions(): _color(1.0f), _pointSize(0.25f), _renderMode(RenderMode::Wireframe) {}
/** @brief Shape rendering mode */ /** @brief Shape rendering mode */
inline constexpr RenderMode renderMode() const { return _renderMode; } constexpr RenderMode renderMode() const { return _renderMode; }
/** /**
* @brief Set shape rendering mode * @brief Set shape rendering mode
@ -77,13 +77,13 @@ class ShapeRendererOptions {
* *
* Default is @ref RenderMode "RenderMode::Wireframe". * Default is @ref RenderMode "RenderMode::Wireframe".
*/ */
inline ShapeRendererOptions* setRenderMode(RenderMode mode) { ShapeRendererOptions* setRenderMode(RenderMode mode) {
_renderMode = mode; _renderMode = mode;
return this; return this;
} }
/** @brief Color of rendered shape */ /** @brief Color of rendered shape */
inline constexpr Color4<> color() const { return _color; } constexpr Color4<> color() const { return _color; }
/** /**
* @brief Set color of rendered shape * @brief Set color of rendered shape
@ -91,13 +91,13 @@ class ShapeRendererOptions {
* *
* Default is 100% opaque white. * Default is 100% opaque white.
*/ */
inline ShapeRendererOptions* setColor(const Color4<>& color) { ShapeRendererOptions* setColor(const Color4<>& color) {
_color = color; _color = color;
return this; return this;
} }
/** @brief Point size */ /** @brief Point size */
inline constexpr Float pointSize() const { return _pointSize; } constexpr Float pointSize() const { return _pointSize; }
/** /**
* @brief Set point size * @brief Set point size
@ -106,7 +106,7 @@ class ShapeRendererOptions {
* Size of rendered crosshairs, representing Shapes::Point shapes. * Size of rendered crosshairs, representing Shapes::Point shapes.
* Default is `0.25f`. * Default is `0.25f`.
*/ */
inline ShapeRendererOptions* setPointSize(Float size) { ShapeRendererOptions* setPointSize(Float size) {
_pointSize = size; _pointSize = size;
return this; return this;
} }

88
src/MeshTools/Clean.h

@ -41,9 +41,54 @@ namespace Implementation {
template<class Vertex, std::size_t vertexSize = Vertex::Size> class Clean { template<class Vertex, std::size_t vertexSize = Vertex::Size> class Clean {
public: public:
inline Clean(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices): indices(indices), vertices(vertices) {} Clean(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices): indices(indices), vertices(vertices) {}
void operator()(typename Vertex::Type epsilon = Math::TypeTraits<typename Vertex::Type>::epsilon()) { void operator()(typename Vertex::Type epsilon = Math::TypeTraits<typename Vertex::Type>::epsilon());
private:
class IndexHash {
public:
std::size_t operator()(const Math::Vector<vertexSize, std::size_t>& data) const {
return *reinterpret_cast<const std::size_t*>(Utility::MurmurHash2()(reinterpret_cast<const char*>(&data), sizeof(data)).byteArray());
}
};
struct HashedVertex {
UnsignedInt oldIndex, newIndex;
HashedVertex(UnsignedInt oldIndex, UnsignedInt newIndex): oldIndex(oldIndex), newIndex(newIndex) {}
};
std::vector<UnsignedInt>& indices;
std::vector<Vertex>& vertices;
};
}
/**
@brief %Clean the mesh
@tparam Vertex Vertex data type
@tparam vertexSize How many initial vertex fields are important (for
example, when dealing with perspective in 3D space, only first three
fields of otherwise 4D vertex are important)
@param[in,out] indices Index array to operate on
@param[in,out] vertices Vertex array to operate on
@param[in] epsilon Epsilon value, vertices nearer than this distance will
be melt together.
Removes duplicate vertices from the mesh.
@todo Different (no cycle) implementation for integral vertices
@todo Interpolate vertices, not collapse them to first in the cell
@todo Ability to specify other attributes for interpolation
*/
template<class Vertex, std::size_t vertexSize = Vertex::Size> inline void clean(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices, typename Vertex::Type epsilon = Math::TypeTraits<typename Vertex::Type>::epsilon()) {
Implementation::Clean<Vertex, vertexSize>(indices, vertices)(epsilon);
}
namespace Implementation {
template<class Vertex, std::size_t vertexSize> void Clean<Vertex, vertexSize>::operator()(typename Vertex::Type epsilon) {
if(indices.empty()) return; if(indices.empty()) return;
/* Get mesh bounds */ /* Get mesh bounds */
@ -105,47 +150,8 @@ template<class Vertex, std::size_t vertexSize = Vertex::Size> class Clean {
moved[moving] = epsilon/2; moved[moving] = epsilon/2;
} }
} }
}
private:
class IndexHash {
public:
inline std::size_t operator()(const Math::Vector<vertexSize, std::size_t>& data) const {
return *reinterpret_cast<const std::size_t*>(Utility::MurmurHash2()(reinterpret_cast<const char*>(&data), sizeof(data)).byteArray());
}
};
struct HashedVertex {
UnsignedInt oldIndex, newIndex;
HashedVertex(UnsignedInt oldIndex, UnsignedInt newIndex): oldIndex(oldIndex), newIndex(newIndex) {}
};
std::vector<UnsignedInt>& indices;
std::vector<Vertex>& vertices;
};
} }
/**
@brief %Clean the mesh
@tparam Vertex Vertex data type
@tparam vertexSize How many initial vertex fields are important (for
example, when dealing with perspective in 3D space, only first three
fields of otherwise 4D vertex are important)
@param[in,out] indices Index array to operate on
@param[in,out] vertices Vertex array to operate on
@param[in] epsilon Epsilon value, vertices nearer than this distance will
be melt together.
Removes duplicate vertices from the mesh.
@todo Different (no cycle) implementation for integral vertices
@todo Interpolate vertices, not collapse them to first in the cell
@todo Ability to specify other attributes for interpolation
*/
template<class Vertex, std::size_t vertexSize = Vertex::Size> inline void clean(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices, typename Vertex::Type epsilon = Math::TypeTraits<typename Vertex::Type>::epsilon()) {
Implementation::Clean<Vertex, vertexSize>(indices, vertices)(epsilon);
} }
}} }}

8
src/MeshTools/CombineIndexedArrays.h

@ -64,7 +64,7 @@ class CombineIndexedArrays {
} }
private: private:
template<class ...T> inline static std::size_t indexCount(const std::vector<UnsignedInt>& first, const std::vector<T>&... next) { template<class ...T> static std::size_t indexCount(const std::vector<UnsignedInt>& first, const std::vector<T>&... next) {
CORRADE_ASSERT(sizeof...(next) == 0 || indexCount(next...) == first.size(), "MeshTools::combineIndexedArrays(): index arrays don't have the same length, nothing done.", 0); CORRADE_ASSERT(sizeof...(next) == 0 || indexCount(next...) == first.size(), "MeshTools::combineIndexedArrays(): index arrays don't have the same length, nothing done.", 0);
return first.size(); return first.size();
@ -89,9 +89,9 @@ class CombineIndexedArrays {
} }
/* Terminator functions for recursive calls */ /* Terminator functions for recursive calls */
inline static std::size_t indexCount() { return 0; } static std::size_t indexCount() { return 0; }
template<std::size_t size> inline static void writeCombinedIndices(std::vector<Math::Vector<size, UnsignedInt>>&) {} template<std::size_t size> static void writeCombinedIndices(std::vector<Math::Vector<size, UnsignedInt>>&) {}
template<std::size_t size> inline static void writeCombinedArrays(const std::vector<Math::Vector<size, UnsignedInt>>&) {} template<std::size_t size> static void writeCombinedArrays(const std::vector<Math::Vector<size, UnsignedInt>>&) {}
}; };
} }

6
src/MeshTools/CompressIndices.cpp

@ -34,9 +34,9 @@ namespace Magnum { namespace MeshTools {
namespace { namespace {
template<class> constexpr Mesh::IndexType indexType(); template<class> constexpr Mesh::IndexType indexType();
template<> inline constexpr Mesh::IndexType indexType<UnsignedByte>() { return Mesh::IndexType::UnsignedByte; } template<> constexpr Mesh::IndexType indexType<UnsignedByte>() { return Mesh::IndexType::UnsignedByte; }
template<> inline constexpr Mesh::IndexType indexType<UnsignedShort>() { return Mesh::IndexType::UnsignedShort; } template<> constexpr Mesh::IndexType indexType<UnsignedShort>() { return Mesh::IndexType::UnsignedShort; }
template<> inline constexpr Mesh::IndexType indexType<UnsignedInt>() { return Mesh::IndexType::UnsignedInt; } template<> constexpr Mesh::IndexType indexType<UnsignedInt>() { return Mesh::IndexType::UnsignedInt; }
template<class T> inline std::tuple<std::size_t, Mesh::IndexType, char*> compress(const std::vector<UnsignedInt>& indices) { template<class T> inline std::tuple<std::size_t, Mesh::IndexType, char*> compress(const std::vector<UnsignedInt>& indices) {
char* buffer = new char[indices.size()*sizeof(T)]; char* buffer = new char[indices.size()*sizeof(T)];

20
src/MeshTools/Interleave.h

@ -42,7 +42,7 @@ namespace Implementation {
class Interleave { class Interleave {
public: public:
inline Interleave(): _attributeCount(0), _stride(0), _data(nullptr) {} Interleave(): _attributeCount(0), _stride(0), _data(nullptr) {}
template<class ...T> std::tuple<std::size_t, std::size_t, char*> operator()(const T&... attributes) { template<class ...T> std::tuple<std::size_t, std::size_t, char*> operator()(const T&... attributes) {
/* Compute buffer size and stride */ /* Compute buffer size and stride */
@ -75,30 +75,30 @@ class Interleave {
buffer->setData(attribute, usage); buffer->setData(attribute, usage);
} }
template<class T, class ...U> inline static typename std::enable_if<!std::is_convertible<T, std::size_t>::value, std::size_t>::type attributeCount(const T& first, const U&... next) { template<class T, class ...U> static typename std::enable_if<!std::is_convertible<T, std::size_t>::value, std::size_t>::type attributeCount(const T& first, const U&... next) {
CORRADE_ASSERT(sizeof...(next) == 0 || attributeCount(next...) == first.size() || attributeCount(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, nothing done.", 0); CORRADE_ASSERT(sizeof...(next) == 0 || attributeCount(next...) == first.size() || attributeCount(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, nothing done.", 0);
return first.size(); return first.size();
} }
template<class... T> inline static std::size_t attributeCount(std::size_t, const T&... next) { template<class... T> static std::size_t attributeCount(std::size_t, const T&... next) {
return attributeCount(next...); return attributeCount(next...);
} }
template<class ...T> inline static std::size_t attributeCount(std::size_t) { template<class ...T> static std::size_t attributeCount(std::size_t) {
return ~std::size_t(0); return ~std::size_t(0);
} }
template<class T, class ...U> inline static typename std::enable_if<!std::is_convertible<T, std::size_t>::value, std::size_t>::type stride(const T&, const U&... next) { template<class T, class ...U> static typename std::enable_if<!std::is_convertible<T, std::size_t>::value, std::size_t>::type stride(const T&, const U&... next) {
return sizeof(typename T::value_type) + stride(next...); return sizeof(typename T::value_type) + stride(next...);
} }
template<class... T> inline static std::size_t stride(std::size_t gap, const T&... next) { template<class... T> static std::size_t stride(std::size_t gap, const T&... next) {
return gap + stride(next...); return gap + stride(next...);
} }
private: private:
template<class T, class ...U> inline void write(char* startingOffset, const T& first, const U&... next) { template<class T, class ...U> void write(char* startingOffset, const T& first, const U&... next) {
write(startingOffset+writeOne(startingOffset, first), next...); write(startingOffset+writeOne(startingOffset, first), next...);
} }
@ -122,9 +122,9 @@ class Interleave {
} }
/* Terminator functions for recursive calls */ /* Terminator functions for recursive calls */
inline static std::size_t attributeCount() { return 0; } static std::size_t attributeCount() { return 0; }
inline static std::size_t stride() { return 0; } static std::size_t stride() { return 0; }
inline void write(char*) {} void write(char*) {}
std::size_t _attributeCount; std::size_t _attributeCount;
std::size_t _stride; std::size_t _stride;

74
src/MeshTools/Subdivide.h

@ -37,41 +37,9 @@ namespace Implementation {
template<class Vertex, class Interpolator> class Subdivide { template<class Vertex, class Interpolator> class Subdivide {
public: public:
inline Subdivide(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices): indices(indices), vertices(vertices) {} Subdivide(std::vector<UnsignedInt>& indices, std::vector<Vertex>& vertices): indices(indices), vertices(vertices) {}
void operator()(Interpolator interpolator) { void operator()(Interpolator interpolator);
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::subdivide(): index count is not divisible by 3!", );
std::size_t indexCount = indices.size();
indices.reserve(indices.size()*4);
/* Subdivide each face to four new */
for(std::size_t i = 0; i != indexCount; i += 3) {
/* Interpolate each side */
UnsignedInt newVertices[3];
for(int j = 0; j != 3; ++j)
newVertices[j] = addVertex(interpolator(vertices[indices[i+j]], vertices[indices[i+(j+1)%3]]));
/*
* Add three new faces (0, 1, 3) and update original (2)
*
* orig 0
* / \
* / 0 \
* / \
* new 0 ----- new 2
* / \ / \
* / 1 \ 2 / 3 \
* / \ / \
* orig 1 ----- new 1 ---- orig 2
*/
addFace(indices[i], newVertices[0], newVertices[2]);
addFace(newVertices[0], indices[i+1], newVertices[1]);
addFace(newVertices[2], newVertices[1], indices[i+2]);
for(std::size_t j = 0; j != 3; ++j)
indices[i+j] = newVertices[j];
}
}
private: private:
std::vector<UnsignedInt>& indices; std::vector<UnsignedInt>& indices;
@ -107,6 +75,44 @@ template<class Vertex, class Interpolator> inline void subdivide(std::vector<Uns
Implementation::Subdivide<Vertex, Interpolator>(indices, vertices)(interpolator); Implementation::Subdivide<Vertex, Interpolator>(indices, vertices)(interpolator);
} }
namespace Implementation {
template<class Vertex, class Interpolator> void Subdivide<Vertex, Interpolator>::operator()(Interpolator interpolator) {
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::subdivide(): index count is not divisible by 3!", );
std::size_t indexCount = indices.size();
indices.reserve(indices.size()*4);
/* Subdivide each face to four new */
for(std::size_t i = 0; i != indexCount; i += 3) {
/* Interpolate each side */
UnsignedInt newVertices[3];
for(int j = 0; j != 3; ++j)
newVertices[j] = addVertex(interpolator(vertices[indices[i+j]], vertices[indices[i+(j+1)%3]]));
/*
* Add three new faces (0, 1, 3) and update original (2)
*
* orig 0
* / \
* / 0 \
* / \
* new 0 ----- new 2
* / \ / \
* / 1 \ 2 / 3 \
* / \ / \
* orig 1 ----- new 1 ---- orig 2
*/
addFace(indices[i], newVertices[0], newVertices[2]);
addFace(newVertices[0], indices[i+1], newVertices[1]);
addFace(newVertices[2], newVertices[1], indices[i+2]);
for(std::size_t j = 0; j != 3; ++j)
indices[i+j] = newVertices[j];
}
}
}
}} }}
#endif #endif

2
src/MeshTools/Test/SubdivideCleanBenchmark.h

@ -39,7 +39,7 @@ class SubdivideCleanBenchmark: public QObject {
void subdivideAndCleanMeshBetween(); void subdivideAndCleanMeshBetween();
private: private:
static inline Magnum::Vector4 interpolator(const Magnum::Vector4& a, const Magnum::Vector4& b) { static Magnum::Vector4 interpolator(const Magnum::Vector4& a, const Magnum::Vector4& b) {
return (a+b).xyz().normalized(); return (a+b).xyz().normalized();
} }
}; };

2
src/MeshTools/Test/SubdivideTest.cpp

@ -54,7 +54,7 @@ class SubdivideTest: public TestSuite::Tester {
Type data; Type data;
}; };
inline static Vector1 interpolator(Vector1 a, Vector1 b) { return (a[0]+b[0])/2; } static Vector1 interpolator(Vector1 a, Vector1 b) { return (a[0]+b[0])/2; }
}; };
SubdivideTest::SubdivideTest() { SubdivideTest::SubdivideTest() {

2
src/MeshTools/Tipsify.h

@ -39,7 +39,7 @@ namespace Implementation {
class MAGNUM_MESHTOOLS_EXPORT Tipsify { class MAGNUM_MESHTOOLS_EXPORT Tipsify {
public: public:
inline Tipsify(std::vector<UnsignedInt>& indices, UnsignedInt vertexCount): indices(indices), vertexCount(vertexCount) {} Tipsify(std::vector<UnsignedInt>& indices, UnsignedInt vertexCount): indices(indices), vertexCount(vertexCount) {}
void operator()(std::size_t cacheSize); void operator()(std::size_t cacheSize);

4
src/TextureTools/DistanceField.cpp

@ -45,12 +45,12 @@ class DistanceFieldShader: public AbstractShaderProgram {
explicit DistanceFieldShader(); explicit DistanceFieldShader();
inline DistanceFieldShader* setRadius(Int radius) { DistanceFieldShader* setRadius(Int radius) {
setUniform(radiusUniform, radius); setUniform(radiusUniform, radius);
return this; return this;
} }
inline DistanceFieldShader* setScaling(Vector2 scaling) { DistanceFieldShader* setScaling(Vector2 scaling) {
setUniform(scalingUniform, scaling); setUniform(scalingUniform, scaling);
return this; return this;
} }

Loading…
Cancel
Save