Pyra Learning OpenGL ES 2.0 for Pyra


levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
12,317
Location
Somewhere off the coast of the EU
Okay, I installed git-lfs then ran lfs fetch which reported downloading some 1.4MB. My ship.glb file remains at 132 bytes and when I look at it is like you say a reference with a sha256sum and a size in it. Meanwhile my built code still crashes. Maybe I'll try the download from github later.
 

kaprikawn

Very Active Member
Joined
Sep 28, 2008
Messages
390
Location
UK
Website
kaprikawn.wordpress.com
Okay, I installed git-lfs then ran lfs fetch which reported downloading some 1.4MB. My ship.glb file remains at 132 bytes and when I look at it is like you say a reference with a sha256sum and a size in it. Meanwhile my built code still crashes. Maybe I'll try the download from github later.
In the assets directory, can you try :
Code:
git lfs install
rm ship.glb
git checkout .
EDIT: I've just tried this on a Mint VM instance I've got, and it worked there.
 
Last edited:

kaprikawn

Very Active Member
Joined
Sep 28, 2008
Messages
390
Location
UK
Website
kaprikawn.wordpress.com
I've introduced batch rendering to improve the performance of rendering the floor :

https://kaprikawn.wordpress.com/2020/02/23/learning-to-learn-opengl-es-2-0-part-27-batch-rendering/

@levi I think I know why yours isn't working now, it's probably because the updated gltf files haven't been copied into the build directory. I thought CMake did that, but I now think it doesn't. I've updated the 'run' script to cope with that now, so it should just work after you pull down the latest master version (or tag v3.8). Or if not just run

Code:
./run --fullscreen --clean
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
12,317
Location
Somewhere off the coast of the EU
Thanks, yes that's running well on my system now. Even on a repo where I hadn't installed git-lfs first and then ran ./run a second time after rechecking out the bigger files it spotted those changes and ran as per your gif on your blog.
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
12,317
Location
Somewhere off the coast of the EU
If you're interested in working better with gdb, print (or 'p' if you're lazy I think) is the command to print out the value of supplied expressions, and break (or 'b') is for setting a break point in a specified file and function (using the file:function notation), and you can also set conditions using if [condition] at the end. But if you're happy in vscode then I don't blame you to be honest!
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
12,317
Location
Somewhere off the coast of the EU
Okay, currently having trouble with enemypod.glb; I've updated as documented and redid all of the lfs stuff because I wasn't sure I'd done it on this machine yet. It seems to stop saying that enemypod.glb isn't a glb file. But looking at the file, it begins:
Code:
glTF^B^@^@^@^Le^A^@h    ^@^@JSON{"asset":{"generator":"Khronos glTF Blender I/O v1.1.46","version":"2.0"},"scene":0,"scenes":[{"name":"Scene","nodes":[0,1,2,3]}],"nodes":[{"mesh":0,"name":"EnemyPod"},{"name":"Light","rotation":[0.16907575726509094,0.7558803558349609,-0.27217137813568115,0.570947527885437],"translation":[4.076245307922363,5.903861999511719,-1.0054539442062378]},{"name":"Camera","rotation":[0.483536034822464,0.33687159419059753,-0.20870360732078552,0.7804827094078064],"translation":[7.358891487121582,4.958309173583984,6.925790786743164]},{"mesh":1,"name":"Collider","scale":[0.7885456085205078,0.6418082118034363,0.8866353034973145]}],"materials":[{"doubleSided":true,"emissiveFactor":[0,0,0],"name":"Material",...
That looks like valid data to me, and not the references I had before I did all of the git-lfs stuff, so I'm not sure what that error means.

Code:
Failed to compile vertex shader : 
0:1(1): error: syntax error, unexpected $end
..snip..
[OpenGL error] (1281)
glEnableVertexAttribArray( bombsPositionID_ )
/home/williain/devt/projects/gles2.0/pyragles/src/hud.cpp
33
[OpenGL error] (1281)
glEnableVertexAttribArray( bombsTexCoordID_ )
/home/williain/devt/projects/gles2.0/pyragles/src/hud.cpp
34
failed to load png
[OpenGL error] (1281)
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, localBuffer )
/home/williain/devt/projects/gles2.0/pyragles/src/texture.cpp
57
Failed to compile vertex shader : 
0:1(1): error: syntax error, unexpected $end

..snip..
[OpenGL error] (1281)
glEnableVertexAttribArray( healthPositionID_ )
/home/williain/devt/projects/gles2.0/pyragles/src/hud.cpp
48
[OpenGL error] (1281)
glEnableVertexAttribArray( healthColourID_ )
/home/williain/devt/projects/gles2.0/pyragles/src/hud.cpp
49
These errors lead directly to the error about enemypod.glb, and maybe they're more important than the final error it ends up with. I've snipped out repeated errors about vertex shader errors.
 

kaprikawn

Very Active Member
Joined
Sep 28, 2008
Messages
390
Location
UK
Website
kaprikawn.wordpress.com
Hmm, I'll take a look, but it looks almost certainly like a problem with the shader. At a guess, I'd say the file is missing. There should be a bunch of shader*.glsl files in the assets directory, three or four of them I think. Looking at it, I'd say you were missing shaderBasic.glsl.

Try running projectBuild.sh in the root directory, that should set up the assets directory within the build directory (i.e. copying them from the src/assets directory to build/assets)..

I'll see about adding a check to see whether the shader file exists before it tries to compile it, and give the appropriate error if not.
 

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
12,317
Location
Somewhere off the coast of the EU
Okay, running projectBuild.sh seems to have helped. It still doesn't work for me here, but I remember giving up on this machine before now, although I think at the time it was just that the game was running so slow on this old machine. I thought I'd give it another go after your refactoring, but I get another seg fault:
Code:
Changing game state to PLAY
./run: line 89:  4041 Segmentation fault      (core dumped) GALLIUM_HUD=".dfps;cpu0+cpu1+cpu2+cpu3+cpu4+cpu5+cpu6+cpu7;GPU-load;VRAM-usage" ./pyragles --invertY
Unless you've got a bright idea, I'll check on my newer machine later. I wouldn't worry too much about getting it running here.
 
Top