how can i load a shader from outside the /data path folder? its possible ? when im try to compiled a shader load from another folder (i want one for fragments and another one for vertex s file) this error show:
OpenGL generated error 1282 trying to get the program link status, does your video card support shader programs?
im using ofFile to get the absolutePath. its work fine if the shaders are in the data folder
thanks!
J.
As far as I’m concerned, it works for me using an ofPath :
// path for loading files is starting from bin/data inside your app,
// so to get a folder called shaders inside your src/ folder :
filesystem::path path = filesystem::path("../../src/shader");
gShader.load(path/"pass.vert", path/"pass.frag", path/"tri.geom");
It works for me using Xcode and Openframeworks 10.1.
Also, I guess you should try to check the excellent addon from @hrs on 360 Projection here, and see how he uses the filesystem::path to reference his shaders.
! i think that problem exist only when i generate a new project, cos with the examples works fine…
i dont know. even i try “/folder/shader” and still not working. but if i do in some of the examples it works!
??
EDIT: my mistake. for some reason when copy+paste the shader to another folder the .glsl file its erased.
solve with the help of @pierre_tardif00