Hello Guest

Recent Posts

Pages: 1 ... 8 9 [10]
91
Vulkan / Vulkan shader creation crash
« Last post by darkyellow on June 14, 2019, 08:59:13 »
Hi

I get a full crash when trying to create my shaders in vulkan

Stack: [0x00007ff574677000,0x00007ff574778000],  sp=0x00007ff574773fe8,  free space=1011k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libVkLayer_khronos_validation.so+0x7d35e4]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.system.JNI.callPPPPI(JJJJJ)I+0
j  org.lwjgl.vulkan.VK10.nvkCreateShaderModule(Lorg/lwjgl/vulkan/VkDevice;JJJ)I+39
j  org.lwjgl.vulkan.VK10.vkCreateShaderModule(Lorg/lwjgl/vulkan/VkDevice;Lorg/lwjgl/vulkan/VkShaderModuleCreateInfo;Lorg/lwjgl/vulkan/VkAllocationCallbacks;Ljava/nio/LongBuffer;)I+24
j  mycode.VkShader.createShaderStages()V+108

I have successfully compiled my shader using glslangValidator -V and this is my code to load the shader

Code: [Select]
       LongBuffer shaderModuleBuffer = memAllocLong(1);
        shaderStages = VkPipelineShaderStageCreateInfo.calloc(shaderInfo.shaderCount());

        VkShaderModuleCreateInfo createInfoShaderModuleVertex = VkShaderModuleCreateInfo.calloc()
                .sType(VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
                .pCode(shaderInfo.getVertexShaderBuffer())
                .flags(0);
        errorCheck("", vkCreateShaderModule(logicalDevice.getLogicalDevice(), createInfoShaderModuleVertex, null, shaderModuleBuffer));

The byte buffer with the pCode matches the size of whats on the os (so giving confidence its the same), it is also flipped correctly. The toString of it is "java.nio.HeapByteBuffer[pos=0 lim=2436 cap=2436]". Other parts of the vulkan code are working fine (like image creation,  validation, swap chain creation etc)

When turning off the validation layers I get

Stack: [0x00007fd111ce6000,0x00007fd111de7000],  sp=0x00007fd111de4e48,  free space=1019k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x189291]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.system.JNI.callPPPPI(JJJJJ)I+0
j  org.lwjgl.vulkan.VK10.nvkCreateShaderModule(Lorg/lwjgl/vulkan/VkDevice;JJJ)I+39
j  org.lwjgl.vulkan.VK10.vkCreateShaderModule(Lorg/lwjgl/vulkan/VkDevice;Lorg/lwjgl/vulkan/VkShaderModuleCreateInfo;Lorg/lwjgl/vulkan/VkAllocationCallbacks;Ljava/nio/LongBuffer;)I+24
j  mycode.VkShader.createShaderStages()V+108

Do you have any ideas what is going wrong? Would incorrect byte data cause the crash?
92
General Java Game Development / AssImp GLTF Embedded Texture questions
« Last post by dajack05 on June 13, 2019, 15:08:19 »
Hey everyone!

So, I've got asset loading working, and AssImp has made my life so much better. That said, I'm trying to use GLTF, and I can't seem to wrap my head around the proper usage of embedded textures.

I understand that AssImp loads the texture from the glb file directly. And I get that when the filename is something like "*1" it means that it is an embedded texture.

Here's where I am stuck. I load a GLB, I recognize that it has an embedded texture and then I want to bind it to a GL Texture. Normally I'd use "glTexImage2D" but I need access to a ByteBuffer to pass it.

Am I missing something here? I know there are a whole host of aiGet* methods I am not super familiar with, but I'm at a loss here.

Thanks for the help!
-
Daniel Jackson
93
Lightweight Java Gaming Library / Re: Travis Build, Natives Not Loading
« Last post by TheDudeFromCI on June 08, 2019, 01:18:52 »
Thank you very much for your help, I highly appreciate it. I'll be trying that method in the next build. I have also looked into updating the project to the newest version of LWJGL as well for other reasons which should hit the build server in a week or two. Thank you again.
94
Lightweight Java Gaming Library / Re: Travis Build, Natives Not Loading
« Last post by spasi on June 04, 2019, 08:57:45 »
Looks like LWJGL finds libassimp.so but loading it fails. However, in LWJGL 3.1.6 we cannot see the failure reason, this has been fixed in 3.2.0.

The most likely issue is that Assimp has a dependency that is not satisfied on the Travis instance. What's the output of `ldd libassimp.so` there? You can use curl to get it in the CI build, from here.
95
Lightweight Java Gaming Library / Re: Travis Build, Natives Not Loading
« Last post by TheDudeFromCI on June 04, 2019, 02:28:47 »
Update: after more fiddling with the Travis.yml, it now prints the LWJGL debug.

Code: [Select]
[02:27:12][Info][Time-limited test] Loading the resource [Res: unit_tests/cube.fbx].
[LWJGL] Version: 3.1.6 build 14
[LWJGL] OS: Linux v4.4.0-101-generic
[LWJGL] JRE: 1.8.0_151 amd64
[LWJGL] JVM: Java HotSpot(TM) 64-Bit Server VM v25.151-b12 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] Using SharedLibraryLoader...
[LWJGL] Extracting: file:/home/travis/.m2/repository/org/lwjgl/lwjgl/3.1.6/lwjgl-3.1.6-natives-linux.jar!/liblwjgl.so
[LWJGL] Loaded from org.lwjgl.librarypath: /tmp/lwjgltravis/3.1.6-build-14/liblwjgl.so
[LWJGL] Loading library: assimp
[LWJGL] Using SharedLibraryLoader...
[LWJGL] Extracting: file:/home/travis/.m2/repository/org/lwjgl/lwjgl-assimp/3.1.6/lwjgl-assimp-3.1.6-natives-linux.jar!/libassimp.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
java.lang.NullPointerException
at org.lwjgl.system.Checks.check(Checks.java:99)
at org.lwjgl.system.Pointer$Default.<init>(Pointer.java:52)
at org.lwjgl.system.SharedLibrary$Default.<init>(SharedLibrary.java:18)
at org.lwjgl.system.linux.LinuxLibrary.<init>(LinuxLibrary.java:19)
at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:124)
at org.lwjgl.system.Library.loadNative(Library.java:329)
at org.lwjgl.system.Library.loadNative(Library.java:313)
at org.lwjgl.system.Library.loadNative(Library.java:235)
at org.lwjgl.assimp.Assimp.<clinit>(Assimp.java:1859)
at net.whg.frameworks.external.AssimpAPIBridge.load(AssimpAPIBridge.java:13)
at net.whg.we.resource.MeshConverterFuture.run(MeshConverterFuture.java:48)
at java.lang.Thread.run(Thread.java:748)
[LWJGL] libassimp.so not found in java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Exception in thread "Thread-7" java.lang.ExceptionInInitializerError
at net.whg.frameworks.external.AssimpAPIBridge.load(AssimpAPIBridge.java:13)
at net.whg.we.resource.MeshConverterFuture.run(MeshConverterFuture.java:48)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.lwjgl.system.Checks.check(Checks.java:99)
at org.lwjgl.system.Pointer$Default.<init>(Pointer.java:52)
at org.lwjgl.system.SharedLibrary$Default.<init>(SharedLibrary.java:18)
at org.lwjgl.system.linux.LinuxLibrary.<init>(LinuxLibrary.java:19)
at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:124)
at org.lwjgl.system.Library.loadNativeFromSystem(Library.java:300)
at org.lwjgl.system.Library.loadNative(Library.java:286)
at org.lwjgl.assimp.Assimp.<clinit>(Assimp.java:1859)
... 3 more
96
Lightweight Java Gaming Library / Re: Travis Build, Natives Not Loading
« Last post by TheDudeFromCI on June 03, 2019, 23:54:37 »
I updated my Travis config file to the following, however, the output log has not changed in any way.

Code: [Select]
language: java

jdk:
  - oraclejdk8

before_install:
  - cd WraithEngine

env:
  - Dorg.lwjgl.util.Debug=true Dorg.lwjgl.util.DebugLoader=true

after_success:
  - mvn jacoco:report coveralls:report
97
Lightweight Java Gaming Library / Re: Travis Build, Natives Not Loading
« Last post by spasi on June 03, 2019, 09:37:30 »
What output do you get if you run the CI build with -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true?
98
Lightweight Java Gaming Library / Travis Build, Natives Not Loading
« Last post by TheDudeFromCI on June 03, 2019, 06:18:53 »
Hello,

I'm currently working on a personal game engine project. For this project, I am using Travis and Maven for unit testing and code coverage. While tests all work fine on my laptop, even pulling and building from a completely clean slate, some of the tests which require LWJGL libraries in order to run while failing on Travis. The library in question is Assimp.

Travis Build Log:
Code: [Select]
[05:10:33][Info][Time-limited test] Loading the resource [Res: unit_tests/cube.fbx].
Exception in thread "Thread-7" java.lang.ExceptionInInitializerError
at net.whg.frameworks.external.AssimpAPIBridge.load(AssimpAPIBridge.java:13)
at net.whg.we.resource.MeshConverterFuture.run(MeshConverterFuture.java:48)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.lwjgl.system.Checks.check(Checks.java:99)
at org.lwjgl.system.Pointer$Default.<init>(Pointer.java:52)
at org.lwjgl.system.SharedLibrary$Default.<init>(SharedLibrary.java:18)
at org.lwjgl.system.linux.LinuxLibrary.<init>(LinuxLibrary.java:19)
at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:124)
at org.lwjgl.system.Library.loadNativeFromSystem(Library.java:300)
at org.lwjgl.system.Library.loadNative(Library.java:286)
at org.lwjgl.assimp.Assimp.<clinit>(Assimp.java:1859)
... 3 more

The code on the line in question is simply the line indicated below.
Code: [Select]
@Override
public AssimpScene load(File file)
{
>>>>> AIPropertyStore settings = Assimp.aiCreatePropertyStore();
Assimp.aiSetImportPropertyInteger(settings, Assimp.AI_CONFIG_PP_SLM_VERTEX_LIMIT, 65535);

AIScene scene = Assimp.aiImportFile(file.toString(),
Assimp.aiProcess_Triangulate | Assimp.aiProcess_GenSmoothNormals | Assimp.aiProcess_FlipUVs
| Assimp.aiProcess_CalcTangentSpace | Assimp.aiProcess_LimitBoneWeights
| Assimp.aiProcess_SplitLargeMeshes | Assimp.aiProcess_OptimizeMeshes
| Assimp.aiProcess_JoinIdenticalVertices);

Assimp.aiReleasePropertyStore(settings);

if (scene == null)
return null;

AssimpScene s = new AssimpSceneBridge(scene);
Assimp.aiReleaseImport(scene);

return s;
}

I'm not sure how to approach the issue of configuring the native library path to load in this scenario, and any advice to point me in the right direction would be wonderful. I've spent several hours on Google looking this problem up, but to no avail. It also worth noting I am currently using LWJGL version 3.1.6.

Thank you in advance and have an amazing day.
99
You are are right, the tutorial was created in 2014, so the author did not have access to LWJGL  3.2.0 or later.

Now I can simply import the the highest version of GL classes in my code, and it works like a charm:

Code: [Select]
      //import the highest version of GL classes
      import static org.lwjgl.opengl.GL46.*;

      glBindVertexArray(model.getVaoID());
      glEnableVertexAttribArray(0);
      glDrawElements(GL_TRIANGLES, model.getVertexCount(),  GL_UNSIGNED_INT, 0);
      glDisableVertexAttribArray(0);
      glBindVertexArray(0);

It also saves quite bit of typing too :-)
100
The tutorial probably was written against LWJGL < 3.2.0. Before 3.2.0, a GLxx classes did not inherit from the GLyy class where yy denoted the previous GL version prior to version xx. There you had to invoke the static methods of the GLxx class where the particular function/method you wanted to invoke was introduced in GL version xx.
Starting with LWJGL 3.2.0 you can just use GL functions introduced prior to and including version xx by calling static methods of class GLxx.
So it's just a question of which LWJGL version that particular tutorial was written against and whether the author actually knew about the added class hierarchy.
Pages: 1 ... 8 9 [10]