Code Monkey home page Code Monkey logo

Comments (20)

ohenley avatar ohenley commented on May 25, 2024 1

from orka.

onox avatar onox commented on May 25, 2024 1

If I remember correctly I think I just ended up compiling and installing it in the command line. Are you using GPS? json-ada and orka are 2 separate projects, thus you somehow need to tell GPS that they are indeed 2 separate projects, not 1 project with 2 folders. Then hopefully GPS shouldn't complain. I'm not sure how to do this in GPS.

On the SO page you inked:

using config.gpr for 2 projects in the chain is a bad idea. Rename one of them. gprbuild has no way of knowing which is which

There's is no config.gpr file in the install folder (make PREFIX=C:/some/folder/that/shows/up/in/gnatls install). There's only a json_ada.gpr file in PREFIX/share/gpr/. When you compile orka, gprbuild should find config.gpr (of orka) in the orka repository.

If I have a folder with a 1000 git repositories, it should still be valid that they all have private config.gpr files. They're all separate projects after all.

On my computer gnatls -v shows:

Project Search Path:
   <Current_Directory>
   /home/onox/.local/share/gpr
   /usr/x86_64-linux-gnu/lib/gnat
   /usr/x86_64-linux-gnu/share/gpr
   /usr/share/gpr
   /usr/lib/gnat

As you can see gprbuild will first try to find config.gpr in the current directory. So on the command line there should be no problems.

If that doesn't work, have you tried https://www.msys2.org/ and pretend you're on Linux? You can install GNAT via pacman -S mingw/mingw-w64-gcc-ada. See the wiki for how to use pacman.

from orka.

onox avatar onox commented on May 25, 2024 1

I've fixed the problem with wglGetProcAddress: it returns null for OpenGL 1.1 functions, so the code will now fallback to GetProcAddress if the previous function returns null.

Also fixed creating the default framebuffer, renderbuffer, vertex array object, and feedback object.

After modifying config.gpr and orka-glfw.gpr I can now succesfully run the tools and examples.

from orka.

onox avatar onox commented on May 25, 2024

Thanks for creating this issue. I have access to a W10 machine, but I've never bothered/tried to build it on Windows. Did you use GNAT 2017?

from orka.

ohenley avatar ohenley commented on May 25, 2024

Hey! yes I used GNAT 2017.

from orka.

onox avatar onox commented on May 25, 2024

Hi @ohenley, a couple of months have passed, but could you try again? 😄 The project should now compile with at least GNAT CE 2018. Make sure to update json-ada.

I got a linker error though about wglGetProcAddress. I fixed this by changing it to GetProcAddress in src/gl/windows/gl-loader.ads. (Not committed because it might be a driver issue).

I got another linker error about all the glfw* functions. I tried copying glfw3.dll to all the possible file locations of GNAT, but that didn't seem to fix it. I'm not familiar with Windows (10), so maybe you manage to fix it.

from orka.

ohenley avatar ohenley commented on May 25, 2024

from orka.

ohenley avatar ohenley commented on May 25, 2024

from orka.

onox avatar onox commented on May 25, 2024

then move to orka an do

make PREFIX=C:/foo/bar

PREFIX is only used when installing Orka (to a location where the user has write access). It's not used during the compilation step. Whether gprbuild can find json-ada depends on GNAT CE's project search paths. I think you can see this on Windows as well with gnatls -v.

As you can see, json_ada is not found. Then I tried to set the absolute path in orka.gpr --> with "C:/foo/bar/share/gpr/json_ada.gpr" and its ok. So I am missing something for sure. Maybe it could be a good idea to exemplify this in the readmes.

I'll try to improve the instructions in README.md a bit by mentioning the project search path.

Why dont you put it as a git submodule of orka?

I don't like git submodules that much.

(Me too, re-installing the glfw libs for the gnat linker to pick it is not straight forward at all. Even choosing the right lib version is sketchy... now where to place them is like a guess game.)

Where did you end up installing glfw3.dll?

from orka.

ohenley avatar ohenley commented on May 25, 2024

Ok, on my side building using GNAT CE 2018 I get 'duplicate' error caused the config.gpr in json-ada and config.gpr in orka:

config.gpr:15:18: duplicate project name "config"
config.gpr:15:18: already in "...\json-ada\config.gpr"

I asked on SO about it because maybe I was missing something on how to make this config work but it looks like it should not:

https://stackoverflow.com/questions/53281765/with-in-duplicate-gprbuild-name-files?noredirect=1#comment93454595_53281765

How do you go about it? Thx.

from orka.

ohenley avatar ohenley commented on May 25, 2024

Works! But now, like so, I stuck at the link error about wglGetProcAddress

from orka.

onox avatar onox commented on May 25, 2024

I just tried building it again in GPS:

  1. Make sure you git pull to get the latest commits.

  2. Open tools.gpr and check that GPS properly switches to this .gpr file

  3. Copy glfw3.dll from 64-bit Windows binaries to the git repository and to the bin/ folder in the git repository.

  4. In GPS in the Scenario tab, set Build Mode to "default", Windowing_System to "windows", and "Library_Type" to "static" (with "relocatable" I had problems that I had to copy the liborka.dll and liborka-glfw.dll to the bin/ folder)

  5. If GNAT complains about SSE4.1, then you need to set "-O2 -march=native" as the compiler switches. For me it didn't work to set them in the Compiler_Flags scenario variable, instead I added them to Compiler_Switches in config.gpr.

  6. If GNAT still complains about missing -lglfw3, then you need to add with "glfw"; to orka-glfw.gpr and create the file glfw.gpr in the git repository:

library project GLFW is

   for Source_Files use ();

   for Library_Dir use ".";
   for Library_Name use "glfw3";
   for Library_Kind use "relocatable";

   for Externally_Built use "true";

end GLFW;
  1. Build via Build > Project > Build All. Enable "Create object dirs".

  2. Try to run orka-info from GPS via Build > Run > orka-info.adb or run them from the bin/ folder.

Note 1: For me creating glfw.gpr and adding glfw3.dll from the 64-bit glfw Windows binaries was needed to get GLFW to link.

Note 2: I had to set Library_Type (in scenario tab) to "static". With "relocatable" GPS couldn't find the .dll files it had built seconds ago, so then I would need to copy liborka.dll and liborka-glfw.dll to the bin/ folder.

Note 3: I tried to link with libEGL dll's I found on my system instead of -lopengl32, but got "skipping incompatible" errors 😞

from orka.

onox avatar onox commented on May 25, 2024

@ohenley What GPU do you have btw? Intel, AMD, Nvidia?

from orka.

ohenley avatar ohenley commented on May 25, 2024
  1. I was able to build tools.gpr on Windows10.
  • Exact same steps until linking glfw3
  • For glfw3 to link I did not create a glfw.gpr file etc. What I did is install libglfw3ddl.a to MY_GNAT_CE_INSTALL/2018/bin/ and in orka-glfw.gpr change the linker option from "-lglfw3" to "-lglfw3dll"
  1. My GPU is an integrated intel (Acer laptop)
    Major version: 3
    Minor version: 2
    Vendor: Intel
    Renderer: Intel(R) UHD Graphics 620
    OpenGL version: 3.2.0 - Build 22.20.16.4735
    GLSL version: 1.50 - Build 22.20.16.4735

from orka.

ohenley avatar ohenley commented on May 25, 2024

But this:

$ ./orka-gltf.exe ./models busterDrone.gltf
Flushing 0 messages in the debug log:
Set callback for debug messages
[19:59:05.788891 HIGH] [SHADER_COMPILER:ERROR] 0: SHADER_ID_COMPILE error has be en generated. GLSL compile failed for shader 1, "": ERROR: 0:10: 'restrict' : sy ntax error syntax error
Error: raised ORKA.RENDERING.PROGRAMS.MODULES.SHADER_COMPILE_ERROR : shaders/too ls/gltf.vert:ERROR: 0:10: 'restrict' : syntax error syntax error

Call stack traceback locations:
0x5cc3b4 0x5d0fce 0x41109d 0x67da3c 0x4013b3 0x4014e6 0x7ffc974e3032 0x7ffc979b1 46f

[19:59:05.799851 DEBUG] [OTHER] 0: Shutting down GLFW

Maybe it would be a good idea to provide a working gltf model

from orka.

ohenley avatar ohenley commented on May 25, 2024

examples.gpr builds too. Here are the exe that does not work:

$ ./gl_test-subroutines.exe
Listing shaders attached to program...
Kind: VERTEX_SHADER
Status: TRUE
Kind: FRAGMENT_SHADER
Status: TRUE
Loaded shaders
Loaded data
Subroutines:
Functions: 2
Uniforms: 1
Function length: 8
Uniform length: 13
Name function 0: update_x
Name uniform 0: update_pos[0]

Execution of C:\Users\olivier\Desktop\perso\Ada\orka\bin\gl_test-subroutines.exe terminated by unhandled exception
raised GL.OBJECTS.PROGRAMS.SUBROUTINE_INACTIVE_ERROR : Subroutine update_z is inactive (unused)
Call stack traceback locations:
0x47535b 0x402692 0x4c70fc 0x4013b3 0x4014e6 0x7ffc974e3032 0x7ffc979b146f


$ ./orka_test-test_10_compute.exe
Flushing 0 messages in the debug log:
Set callback for debug messages
[20:11:18.918926 HIGH] [SHADER_COMPILER:ERROR] 0: SHADER_ID_COMPILE error has been generated. GLSL compile failed for shader 1, "": ERROR: 0:9: '#extension' : 'GL_ARB_shader_ballot' is not supported
ERROR: 0:15: 'buffer' : syntax error syntax error
[20:11:18.922346 DEBUG] [OTHER] 0: Shutting down GLFW

Execution of C:\Users\olivier\Desktop\perso\Ada\orka\bin\orka_test-test_10_compute.exe terminated by unhandled exception
raised ORKA.RENDERING.PROGRAMS.MODULES.SHADER_COMPILE_ERROR : test-10-module-1.comp:ERROR: 0:9: '#extension' : 'GL_ARB_shader_ballot' is not supported
ERROR: 0:15: 'buffer' : syntax error syntax error

Call stack traceback locations:
0x4ce404 0x4d309f 0x401878 0x5160dc 0x4013b3 0x4014e6 0x7ffc974e3032 0x7ffc979b146f

from orka.

onox avatar onox commented on May 25, 2024

Hi, with the Intel drivers on Windows I get these GLSL errors as well. In the shaders you need to replace #version 330 core with #version 450 core. For orka-info you need to modify tools/orka_info.adb line 25.

I don't know if this issue happens just with Intel on Windows, or whether it happens with AMD and Nvidia as well. I could set the versions to 4.5, but that would force Intel Ivy Bridge users on Linux to override the Mesa version. (They have 4.2 + 99 % of the extensions of 4.3 to 4.6).

from orka.

onox avatar onox commented on May 25, 2024

The glTF loader is not that flexible and has some ugly code (procedures Count_Parts and Add_Parts in Orka.Resources.Models.glTF).

The glTF model needs to have 3 attributes (position, vertex, and UV attribute) and only 1 primitive per mesh part (meaning, the index type needs to be sufficiently large for the biggest mesh part).

I'll try to find some public .gltf models that work out of the box and list them here.

from orka.

onox avatar onox commented on May 25, 2024

@ohenley I've found a model that works:

https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/DamagedHelmet/glTF

  1. Download the .bin and the .gltf files.
  2. Adjust Light_Position in tools/orka_gltf.adb on line 57.
  3. Adjust the light radius and intensity in resources/shaders/tools/gltf.frag on lines 39 and 40 (I've set the intensity to 10.0)

You can also load files in Blender and export it to .gltf with the glTF exporter.

from orka.

onox avatar onox commented on May 25, 2024

Closing this stale issue. With a bit of luck the crates should link with EGL on the msys2 platform and a surfaceless EGL context can be used. Someone contributing a win32 backend to AWT is still appreciated.

from orka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.