enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows

Home Page:http://www.limonengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Platform-dependent file paths in EasyFPS.fbx

jmcph4 opened this issue · comments

The file Data/Models/EasyFPS/easyFPS.fbx (see #81 for details on this) contains Windows-specific file paths, e.g.:

$ strings Data/Models/EasyFPS/easyFPS.fbx | grep D:
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Weapon_Albedo.png
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Hands_Albedo.pngCN
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Weapon_Albedo.png
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Weapon_Albedo.png1Q
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Hands_Albedo.png
D:\engin\Documents\sourceTree\LimonEngine\cmake-build-debug\Data\Models\EasyFPS\Data\Textures\EasyFPS\Hands_Albedo.png\S

Note irrelevant strings were removed from this shell output.

This causes issues when running the engine on non-Windows platforms, with failure occurring (directly, at least) here:

if (!surface) {
std::cerr << "TextureAsset Load from disk failed for " << name[0] << ". Error:" << std::endl << IMG_GetError()
<< std::endl;
exit(1);
} else {
//std::cout << "TextureAsset " << name[0] << " loaded from disk successfully." << std::endl;
}

Note that, immediately above this snippet, there is a FIXME directive in place which is likely relevant:

} else {
/**
* FIXME: This takes full path, which is not acceptable,
* we need to work with relative path to model for textures
*/
surface = IMG_Load(name[0].data());
}

@enginmanap After some quick Vim magic followed by some even quicker Googling, it looks like FBX is a proprietary binary format, so I might leave the actual game development to someone who knows what they're doing (i.e. you).

I am checking it with mint 18.3

Hi,

I fixed the issue with the file. Please check so I can close the issue.

I also have bad news. It turns out the version of Assimp Mint 18.3 has (3.5) can't handle the embedded textures of swat model. You might run in to that issue after gun starts working.

@enginmanap This appears to be fixed on master. I'm assuming that this is what you mean by the Assimp issues?

$ ./build/LimonEngine
No world file specified, trying to load ./Data/Maps/World001.xml
"fullScreen" setting not found, defaulting to falseOptions loaded successfully
SDL started.
trying to load shared library ./libcustomTriggers.so
Custom Trigger load failed!
Custom Actor load failed!
Custom Player extension load failed!
GLEW Init: Success!
Maximum number of texture image units is 16
Rendererer: Mesa DRI Intel(R) Bay Trail 
GL version: 3.3 (Core Profile) Mesa 13.0.6
Supported GLSL version is 3.30
found 169 extensions.
Cubemap array support is present. 
Uniform alignment size is 16
Uniform maxVertexUniformBlockCount size is 14
read name as ./Data/Maps/World001.xml
libpng warning: iCCP: known incorrect sRGB profile
add animation with name MainCharacterSkillet|MainAnimation
add animation with name MainCharacterSkillet|MainCharacterSkillet|MainCharacterSkillet|Sword|Take 001|BaseLa
animation created and added to sections
animation created and added to sections
animation created and added to sections
animation created and added to sections
animation created and added to sections
animation created and added to sections
animation created and added to sections
animation created and added to sections
fragment type shader ./Engine/Shaders/Model/fragment.glsl could not be compiled:
0:108(2): error: `return' with wrong type int, in function `ShadowCalculationPoint' returning float

Linking failed: 
error: linking with uncompiled shader
Uniform "diffuseSampler" could not be set
Uniform "ambientSampler" could not be set
Uniform "specularSampler" could not be set
Uniform "opacitySampler" could not be set
Uniform "opacitySampler" could not be set
Uniform "shadowSamplerDirectional" could not be set
Uniform "shadowSamplerPoint" could not be set
bind pose returned. for animation name []
Font manager started
atlas h: 17, w 16
No music found.
World doesn't have any object Groups.
LimonEngine: /build/assimp-Kf7LUe/assimp-3.3.1~dfsg/code/ValidateDataStructure.cpp:92: void Assimp::ValidateDSProcess::ReportError(const char*, ...): Assertion `false' failed.
Aborted

Possibly, but not sure.

You have 2 issues

  1. Shader compile fails. That appears to be driver being picky because I am testing intel IGPUs constantly. changing the line 107 of file ./Engine/Shaders/Model/fragment.glsl to return 1.0; shold fix it.

  2. That looks like one of the models doesn't fit the assumptions of Assimp. I think this might be the same issue I had on Mint, but to be sure, can you remove the swat object from the map file and try again?
    ./Data/Maps/World001.xml is the map file, and it should have an XML element as:

./Data/Models/Swat/Swat.fbx

@enginmanap Changing the return value fixed the shader compilation issues, but removing the SWAT object from Data/Maps/World001.xml didn't seem to change the output after that.

So the issue is with another model. There is a log line commented out in file src/Assets/ModelAsset.cpp at line 27:

//std::cout << "ASSIMP::Loading::" << name << std::endl;

can you uncomment that line and rebuild? It will give us the file its trying to load

@enginmanap Data/Models/Box/Box.obj

Can you check if the file content is correctly there? That file is part of Git LFS now.

@enginmanap Success! After I pulled all of the files via Git LFS the demo finally runs!

It runs with swat model?

@enginmanap Yes, I reverted my local changes to Data/Maps/World001.xml after I pulled the necessary files from Git LFS and then ran the engine.

Great news! If shooting around is not working, or Swat model is not following around/killing you, you might need to compile the other project within. It is called customTriggers.

Also performance might be bad, I didn't use mesa drivers for any testing to be honest. Can you share your average FPS?

@enginmanap I'm not sure it's even worth reporting my average FPS as the laptop I'm developing on is extremely low end. I'm just happy the engine builds and runs successfully on Debian.

Yep, it is cool!

About the performance, I have some suggestions. The default configuration has SSAO enabled, which has huge performance impact, you should disable it for sure. Also both resolution, and shadow resolutions are very high. They should be decreased for better performance. there is another setting fullScreen True is better for performance, but it makes debugging tidious. If you can't get acceptable performance in any way, please let me know.

Closing as solved.