Minor fixes and improvements
This commit is contained in:
@@ -331,11 +331,11 @@ void MeshAccelerationStructure::Add(Model* model, int32 lodIndex)
|
||||
}
|
||||
}
|
||||
|
||||
void MeshAccelerationStructure::Add(ModelData* modelData, int32 lodIndex, bool copy)
|
||||
void MeshAccelerationStructure::Add(const ModelData* modelData, int32 lodIndex, bool copy)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
lodIndex = Math::Clamp(lodIndex, 0, modelData->LODs.Count() - 1);
|
||||
ModelLodData& lod = modelData->LODs[lodIndex];
|
||||
const ModelLodData& lod = modelData->LODs[lodIndex];
|
||||
_meshes.EnsureCapacity(_meshes.Count() + lod.Meshes.Count());
|
||||
for (int32 i = 0; i < lod.Meshes.Count(); i++)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
void Add(Model* model, int32 lodIndex);
|
||||
|
||||
// Adds the model geometry for the build to the structure.
|
||||
void Add(ModelData* modelData, int32 lodIndex, bool copy = false);
|
||||
void Add(const ModelData* modelData, int32 lodIndex, bool copy = false);
|
||||
|
||||
// Adds the triangles geometry for the build to the structure.
|
||||
void Add(Float3* vb, int32 vertices, void* ib, int32 indices, bool use16BitIndex, bool copy = false);
|
||||
|
||||
@@ -81,7 +81,7 @@ class GPUModelSDFTask : public GPUTask
|
||||
ConditionVariable* _signal;
|
||||
AssetReference<Shader> _shader;
|
||||
Model* _inputModel;
|
||||
ModelData* _modelData;
|
||||
const ModelData* _modelData;
|
||||
int32 _lodIndex;
|
||||
Int3 _resolution;
|
||||
ModelBase::SDFData* _sdf;
|
||||
@@ -104,7 +104,7 @@ class GPUModelSDFTask : public GPUTask
|
||||
});
|
||||
|
||||
public:
|
||||
GPUModelSDFTask(ConditionVariable& signal, Model* inputModel, ModelData* modelData, int32 lodIndex, const Int3& resolution, ModelBase::SDFData* sdf, GPUTexture* sdfResult, const Float3& xyzToLocalMul, const Float3& xyzToLocalAdd)
|
||||
GPUModelSDFTask(ConditionVariable& signal, Model* inputModel, const ModelData* modelData, int32 lodIndex, const Int3& resolution, ModelBase::SDFData* sdf, GPUTexture* sdfResult, const Float3& xyzToLocalMul, const Float3& xyzToLocalAdd)
|
||||
: GPUTask(Type::Custom)
|
||||
, _signal(&signal)
|
||||
, _shader(Content::LoadAsyncInternal<Shader>(TEXT("Shaders/SDF")))
|
||||
@@ -350,7 +350,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
bool ModelTool::GenerateModelSDF(Model* inputModel, ModelData* modelData, float resolutionScale, int32 lodIndex, ModelBase::SDFData* outputSDF, MemoryWriteStream* outputStream, const StringView& assetName, float backfacesThreshold, bool useGPU)
|
||||
bool ModelTool::GenerateModelSDF(Model* inputModel, const ModelData* modelData, float resolutionScale, int32 lodIndex, ModelBase::SDFData* outputSDF, MemoryWriteStream* outputStream, const StringView& assetName, float backfacesThreshold, bool useGPU)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
auto startTime = Platform::GetTimeSeconds();
|
||||
|
||||
@@ -98,7 +98,7 @@ API_CLASS(Namespace="FlaxEngine.Tools", Static) class FLAXENGINE_API ModelTool
|
||||
|
||||
// Optional: inputModel or modelData
|
||||
// Optional: outputSDF or null, outputStream or null
|
||||
static bool GenerateModelSDF(class Model* inputModel, class ModelData* modelData, float resolutionScale, int32 lodIndex, ModelBase::SDFData* outputSDF, class MemoryWriteStream* outputStream, const StringView& assetName, float backfacesThreshold = 0.6f, bool useGPU = true);
|
||||
static bool GenerateModelSDF(class Model* inputModel, const class ModelData* modelData, float resolutionScale, int32 lodIndex, ModelBase::SDFData* outputSDF, class MemoryWriteStream* outputStream, const StringView& assetName, float backfacesThreshold = 0.6f, bool useGPU = true);
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
|
||||
Reference in New Issue
Block a user