Repository navigation
Description
Describe the bug
This bug was initially discovered two years ago, and now I had the luck to discover it again. Either way, I have more details on the bug, so I thought, let's start a new fresh issue for it.
I added below the code lines that I tracked down. As you see in material.h, there is float* specified as argument, while in the material.inl and MaterialSystem.cpp, ai_real* is specified as argument. So the project is not able to compile under double precision.
Also, this should be more of an issue if you look at the definition of aiColor4D:

which is always a float. So the API is rather broken in my opinion. I first replaced the float* to ai_real*, which corrupted the stack..., now I know why.
Simple replacing it with float*, doesn't work that easily. For that, I would need a lot more time to understand everything, which is not feasible, sorry.
Link to similar issue: #4685
(There was also a fix attached below, which never got merged, I don't know if it is the right solution to this problem.)
To Reproduce
Steps to reproduce the behavior:
Simply build with ASSIMP_DOUBLE_PRECISION enabled using VS2022 17.11 Preview 6. I am using a custom premake5 build for assimp, but it's clear that the fault is in the code, not the build itself.
Expected behavior
It should compile if you enable double precision.
Platform (please complete the following information):
- OS: Windows 11
- Version: 23H2
Additional context
Affected code:
- aiGetMaterialFloatArray (material.h): https://github.com/assimp/assimp/blob/a37d748c172a294004b99461f8c3febff68b1426/include/assimp/material.h#L1525C1-L1525C52
- aiGetMaterialFloat (material.h):
assimp/include/assimp/material.h
Line 1552 in a37d748
inline aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat, - aiMaterial::Get() (material.inl):
assimp/include/assimp/material.inl
Line 181 in a37d748
aiReturn aiMaterial::Get(const char* pKey,unsigned int type, - aiGetMaterialFloatArray (MaterialSystem.cpp):
assimp/code/Material/MaterialSystem.cpp
Line 89 in a37d748
aiReturn aiGetMaterialFloatArray(const aiMaterial *pMat,
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
sagaceilo commentedon Aug 8, 2024
Tried today it not even compile with ASSIMP_DOUBLE_PRECISION. Throwing a bunch of errors with msimatched implementation of many aiMaterial functions.
Probably broken with: da281b7
kimkulling commentedon Nov 29, 2024
Closed by #5902