mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
xatlas: Revert to unmodified upstream code, add to COPYRIGHT
Imported by @reduz from b8ec29b6b6
Custom changes will be remade properly in the next commit.
This commit is contained in:
parent
1b3ea697c5
commit
1e39fee140
@ -391,6 +391,13 @@ Copyright: 2011, Khaled Mamou
|
||||
2003-2009, Erwin Coumans
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: ./thirdparty/xatlas/
|
||||
Comment: xatlas
|
||||
Copyright: 2018, Jonathan Young
|
||||
2013, Thekla, Inc
|
||||
2006, NVIDIA Corporation, Ignacio Castano
|
||||
License: Expat
|
||||
|
||||
Files: ./thirdparty/zlib/
|
||||
Comment: zlib
|
||||
Copyright: 1995-2017, Jean-loup Gailly and Mark Adler
|
||||
|
@ -1,5 +1,4 @@
|
||||
def can_build(env, platform):
|
||||
#return False #xatlas is buggy
|
||||
return (env['tools'] and platform not in ["android", "ios"])
|
||||
|
||||
def configure(env):
|
||||
|
14
thirdparty/README.md
vendored
14
thirdparty/README.md
vendored
@ -545,6 +545,20 @@ They can be reapplied using the patches included in the `vhacd`
|
||||
folder.
|
||||
|
||||
|
||||
## xatlas
|
||||
|
||||
- Upstream: https://github.com/jpcy/xatlas
|
||||
- Version: git (b8ec29b, 2018)
|
||||
- License: MIT
|
||||
|
||||
Files extracted from upstream source:
|
||||
|
||||
- `xatlas.{cpp,h}`
|
||||
|
||||
Note: License is marked as Public Domain in the files, but it was
|
||||
later clarified upstream to MIT license.
|
||||
|
||||
|
||||
## zlib
|
||||
|
||||
- Upstream: http://www.zlib.net
|
||||
|
14
thirdparty/xatlas/LICENSE
vendored
Normal file
14
thirdparty/xatlas/LICENSE
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
xatlas
|
||||
https://github.com/jpcy/xatlas
|
||||
Copyright (c) 2018 Jonathan Young
|
||||
|
||||
thekla_atlas
|
||||
https://github.com/Thekla/thekla_atlas
|
||||
Copyright (c) 2013 Thekla, Inc
|
||||
Copyright NVIDIA Corporation 2006 -- Ignacio Castano <icastano@nvidia.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2322
thirdparty/xatlas/xatlas.cpp
vendored
2322
thirdparty/xatlas/xatlas.cpp
vendored
File diff suppressed because it is too large
Load Diff
58
thirdparty/xatlas/xatlas.h
vendored
58
thirdparty/xatlas/xatlas.h
vendored
@ -3,15 +3,15 @@
|
||||
#ifndef XATLAS_H
|
||||
#define XATLAS_H
|
||||
#include <float.h> // FLT_MAX
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace xatlas {
|
||||
|
||||
typedef void (*PrintFunc)(const char *, ...);
|
||||
|
||||
struct Atlas;
|
||||
|
||||
struct CharterOptions {
|
||||
struct CharterOptions
|
||||
{
|
||||
float proxyFitMetricWeight;
|
||||
float roundnessMetricWeight;
|
||||
float straightnessMetricWeight;
|
||||
@ -20,7 +20,8 @@ struct CharterOptions {
|
||||
float maxChartArea;
|
||||
float maxBoundaryLength;
|
||||
|
||||
CharterOptions() {
|
||||
CharterOptions()
|
||||
{
|
||||
// These are the default values we use on The Witness.
|
||||
proxyFitMetricWeight = 2.0f;
|
||||
roundnessMetricWeight = 0.01f;
|
||||
@ -39,15 +40,18 @@ struct CharterOptions {
|
||||
}
|
||||
};
|
||||
|
||||
struct PackMethod {
|
||||
enum Enum {
|
||||
struct PackMethod
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
TexelArea, // texel_area determines resolution
|
||||
ApproximateResolution, // guess texel_area to approximately match desired resolution
|
||||
ExactResolution // run the packer multiple times to exactly match the desired resolution (slow)
|
||||
};
|
||||
};
|
||||
|
||||
struct PackerOptions {
|
||||
struct PackerOptions
|
||||
{
|
||||
PackMethod::Enum method;
|
||||
|
||||
// 0 - brute force
|
||||
@ -59,13 +63,14 @@ struct PackerOptions {
|
||||
// Avoid brute force packing, since it can be unusably slow in some situations.
|
||||
int quality;
|
||||
|
||||
float texelArea; // This is not really texel area, but 1 / texel width?
|
||||
float texelArea; // This is not really texel area, but 1 / texel width?
|
||||
uint32_t resolution;
|
||||
bool blockAlign; // Align charts to 4x4 blocks.
|
||||
bool conservative; // Pack charts with extra padding.
|
||||
bool blockAlign; // Align charts to 4x4 blocks.
|
||||
bool conservative; // Pack charts with extra padding.
|
||||
int padding;
|
||||
|
||||
PackerOptions() {
|
||||
PackerOptions()
|
||||
{
|
||||
method = PackMethod::ApproximateResolution;
|
||||
quality = 1;
|
||||
texelArea = 8;
|
||||
@ -76,8 +81,10 @@ struct PackerOptions {
|
||||
}
|
||||
};
|
||||
|
||||
struct AddMeshErrorCode {
|
||||
enum Enum {
|
||||
struct AddMeshErrorCode
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
Success,
|
||||
AlreadyAddedEdge, // index0 and index1 are the edge indices
|
||||
DegenerateColocalEdge, // index0 and index1 are the edge indices
|
||||
@ -90,20 +97,24 @@ struct AddMeshErrorCode {
|
||||
};
|
||||
};
|
||||
|
||||
struct AddMeshError {
|
||||
struct AddMeshError
|
||||
{
|
||||
AddMeshErrorCode::Enum code;
|
||||
uint32_t face;
|
||||
uint32_t index0, index1;
|
||||
};
|
||||
|
||||
struct IndexFormat {
|
||||
enum Enum {
|
||||
struct IndexFormat
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
HalfFloat,
|
||||
Float
|
||||
};
|
||||
};
|
||||
|
||||
struct InputMesh {
|
||||
struct InputMesh
|
||||
{
|
||||
uint32_t vertexCount;
|
||||
const void *vertexPositionData;
|
||||
uint32_t vertexPositionStride;
|
||||
@ -124,17 +135,20 @@ struct InputMesh {
|
||||
const uint16_t *faceMaterialData;
|
||||
};
|
||||
|
||||
struct OutputChart {
|
||||
struct OutputChart
|
||||
{
|
||||
uint32_t *indexArray;
|
||||
uint32_t indexCount;
|
||||
};
|
||||
|
||||
struct OutputVertex {
|
||||
struct OutputVertex
|
||||
{
|
||||
float uv[2];
|
||||
uint32_t xref; // Index of input vertex from which this output vertex originated.
|
||||
uint32_t xref; // Index of input vertex from which this output vertex originated.
|
||||
};
|
||||
|
||||
struct OutputMesh {
|
||||
struct OutputMesh
|
||||
{
|
||||
OutputChart *chartArray;
|
||||
uint32_t chartCount;
|
||||
uint32_t *indexArray;
|
||||
@ -152,7 +166,7 @@ void Generate(Atlas *atlas, CharterOptions charterOptions = CharterOptions(), Pa
|
||||
uint32_t GetWidth(const Atlas *atlas);
|
||||
uint32_t GetHeight(const Atlas *atlas);
|
||||
uint32_t GetNumCharts(const Atlas *atlas);
|
||||
const OutputMesh *const *GetOutputMeshes(const Atlas *atlas);
|
||||
const OutputMesh * const *GetOutputMeshes(const Atlas *atlas);
|
||||
const char *StringForEnum(AddMeshErrorCode::Enum error);
|
||||
|
||||
} // namespace xatlas
|
||||
|
Loading…
Reference in New Issue
Block a user