cogles2fixedpipelineshaders embed shader file

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kaliber
Posts: 117
Joined: Sat Jan 17, 2009 12:51 pm

cogles2fixedpipelineshaders embed shader file

Post by kaliber »

in file COGLES2FixedpipelineShaders.cpp there is :

Code: Select all

const c8  VertexShaderFile[] =    "/mnt/.../COGLES2FixedPipeline.vsh";
        const c8  FragmentShaderFile[] =  "/mnt/.../COGLES2FixedPipeline.fsh";
i dont want to put the shader file in the sdcard
and since android JNI cant get access to asset folder easily, so i want to put the shaders inside the .cpp file.
is there any tutorial ? or some link ? or your help ?
:D :D :D
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: cogles2fixedpipelineshaders embed shader file

Post by shadowslair »

So, you just copy the shader program and paste it in the .cpp. Then load it as a string (const c8 VertexShader[] = "MyShaderCodeGoesHere, VertexShader, PixelShaderBlaBlaETC."; ), what`s the problem? The shaders usually are in separate files just for user convenience. Then you use the addHighLevelShaderMaterial, not the addHighLevelShaderMaterialFromFiles.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: cogles2fixedpipelineshaders embed shader file

Post by hybrid »

The shader path is already changeable, you can use a define to set a new prefix. Changing to in file shaders is only possible by altering the cpp files, though.
Post Reply