jmorton06 / Lumos

Cross-Platform C++ 2D/3D game engine
MIT License
1.28k stars 142 forks source link

how can i build with opengl? #25

Closed alexbanks-git closed 4 years ago

alexbanks-git commented 5 years ago

cool project, I tried to build for Linux, but it crashes when I start Sandbox, because the vulkan is not initialized, there is a light library reactphysics3d for simulate physics, I would really like to see it in your project

jmorton06 commented 5 years ago

Thank you :). Do you have Vulkan set up on your PC? I don’t work on Linux too much so haven’t tested it for a while. If you want to use OpenGL you need to change the value in the settings file in the sandbox folder. Set renderapi to 0.

alexbanks-git commented 5 years ago

I tried to change the value "Renderapi=0", yes I installed a vulkan, but it looks like my hardware does not support it.

`

Vulkan Instance Version: 1.1.70

/build/vulkan-UL09PJ/vulkan-1.1.70+dfsg1/demos/vulkaninfo.c:2700: failed with VK_ERROR_INITIALIZATION_FAILED lin@lin:~/Desktop/Lumos/bin/Debug$ ./Sandbox [17:12:50] LUMOS: Profiler Enabled [17:12:50] LUMOS: Lumos Engine - Version 0.2.1 [17:12:50] LUMOS: Initialised JobSystem with [4 cores] [4 threads] [17:12:50] LUMOS: Initializing System [LUA] - Initialised Lua! [17:12:50] LUMOS: Creating window - Title : Sandbox, Width : 1280, Height : 800 Segmentation fault (стек памяти сброшен на диск)`

jmorton06 commented 5 years ago

Ah right sorry. I’ll try have a look when I get a chance. If OpenGL is selected the Vulkan stuff shouldn’t be touched

alexbanks-git commented 5 years ago

ok thanks i'll wait

jmorton06 commented 5 years ago

I think the Segmentation fault is due to an error with file loading. Not sure why as it used to work :/

alexbanks-git commented 5 years ago

maybe the path to the folder with the resources does not match in the project I did not find such a folder "/CoreTextures" deb

jmorton06 commented 5 years ago

There’s a virtual file system to map locations to the actual file path.

VFS::Get()->Mount("CoreTextures", root + "/lumos/res/textures");

So it should map it to the right directory

alexbanks-git commented 5 years ago

:)

alexbanks-git commented 5 years ago

I think I have crashes caused by shaders. changed a few lines: GLFWWindow.cpp add: glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

GLIMGUIRenderer.cpp ImGui_ImplOpenGL3_Init("#version 330");

Снимок экрана от 2019-10-08 11-14-13

Снимок экрана от 2019-10-08 11-26-15

jmorton06 commented 5 years ago

Ah great. Thank you for finding the issue. I'll add them changes in. (The artifacts on the spheres is some other issue somewhere with opengl :) )

jmorton06 commented 5 years ago

That issue should be fixed on the DEV branch now :)

alexbanks-git commented 5 years ago

excellent, because I don’t understand anything in shaders, I suffered with them in a test project)) (version 410+ changed to 330, and the model is invisible, but I thought the loader was fooling me..)

jmorton06 commented 5 years ago

Haha yeah can be just a very small problem and you end with a blank screen. RenderDoc is good for shader problems

alexbanks-git commented 5 years ago

GLShader.cpp: line 926;(master) void GLShader::SetUniformMat4(u32 location, const Maths::Matrix4& matrix) { //if here Maths::ValuePointer(matrix) then i have crush GLCall(glUniformMatrix4fv(location, 1, GL_FALSE /*GLTRUE*/, &matrix.values[0])); }

jmorton06 commented 5 years ago

I think that should be fixed now. Sorry it's not very stable