Closed consansri closed 1 year ago
Hi, shaders versions do not need to match according to OpenGL specs. Can you please post the error that you are getting?
This is my error code i'm getting if i just compile your chapter-21
Exception in thread "main" java.lang.RuntimeException: Error compiling Shader code: ERROR: 0:32: 'variable indexing sampler array' : not supported for this version or the enabled extensions ERROR: 0:32: '' : compilation terminated ERROR: 2 compilation errors. No code generated.
at org.lwjglb.engine.graph.ShaderProgram.createShader(ShaderProgram.java:47)
at org.lwjglb.engine.graph.ShaderProgram.lambda$new$0(ShaderProgram.java:21)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.lwjglb.engine.graph.ShaderProgram.<init>(ShaderProgram.java:21)
at org.lwjglb.engine.graph.SceneRender.<init>(SceneRender.java:31)
at org.lwjglb.engine.graph.Render.<init>(Render.java:31)
at org.lwjglb.engine.Engine.<init>(Engine.java:25)
at org.lwjglb.game.Main.main(Main.java:29)
Oh and exactly the same for chapter-20
Ok, I see this is due to variable indexing which is not suported untill OpenGL4.x. The straneg thing is that I do not get thate error. Can you please check if putting #version 400
solves the issue? I like the idea of showiong that you can mix versions.
Works perfectly fine with #version 400 :D
Thanks for reporting! Just uploaded a fix for this.
In chapter-20: glsl shader versions aren't the same in scene.vert and scene.frag That causes a compiling error.
works fine when updating version of scene.frag to #version 460
Just wanted to inform you :D
Keep up and great job!