enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows
http://www.limonengine.com
GNU Lesser General Public License v3.0
580 stars 57 forks source link

Platform-dependent file paths in EasyFPS.fbx #83

Closed jmcph4 closed 5 years ago

jmcph4 commented 5 years ago

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:

https://github.com/enginmanap/limonEngine/blob/74902fd95a3d6a0eba818a71f6e2938b696fa029/src/Assets/TextureAsset.cpp#L46-L52

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

https://github.com/enginmanap/limonEngine/blob/74902fd95a3d6a0eba818a71f6e2938b696fa029/src/Assets/TextureAsset.cpp#L34-L40

jmcph4 commented 5 years ago

@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).

enginmanap commented 5 years ago

I am checking it with mint 18.3

enginmanap commented 5 years ago

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.

jmcph4 commented 5 years ago

@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
enginmanap commented 5 years ago

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
jmcph4 commented 5 years ago

@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.

enginmanap commented 5 years ago

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

jmcph4 commented 5 years ago

@enginmanap Data/Models/Box/Box.obj

enginmanap commented 5 years ago

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

jmcph4 commented 5 years ago

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

enginmanap commented 5 years ago

It runs with swat model?

jmcph4 commented 5 years ago

@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.

enginmanap commented 5 years ago

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?

jmcph4 commented 5 years ago

@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.

enginmanap commented 5 years ago

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.

jmcph4 commented 5 years ago

Closing as solved.