Hi Robert; Yes I know we need endline sign on every line break. Actually we put endline sign by fout<<variableString<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<< *"\\n\""*<<std::endl; So there is one "\n" sign in shaderSource.substr(startOfLine,endOfLine-startOfLine) substring. Could you look at the attached samples and converted type of vertex shader. Do you see shadow_vert.cpp files distorted format?
If I am wrong, so sorry for inconvenience. Regards. 2009/5/21 Robert Osfield <[email protected]> > Hi Umit, > > The \n is used to make sure that the warnings you get back from the > OpenGL driver map to distrinct line numbers, without this all the > lines would be treated as a whole program ecoded in a single line. > > Robert. > > On Thu, May 21, 2009 at 3:49 PM, Ümit Uzun <[email protected]> wrote: > > Hi Robert; > > > > I have realized that when using --shader option in osg2cpp it parses > shader > > file in cpp but it add unneccessary endline sign(\n) every line's end. > > I think every shaderSource.substr(startOfLine,endOfLine-startOfLine) > command > > should be > > > shaderSource.substr(startOfLine,endOfLine-startOfLine-1) > > > > Regards. > > > > -- > > Ümit Uzun > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- Ümit Uzun
shadows.vert
Description: Binary data
char shadows_vert[] = "//hogbox standardised shadowmappig functions
\n"
"
\n"
"
\n"
"varying vec4 ShadowCood;
\n"
"
\n"
"void GenShadowCoords(in vec4 ecPosition)
\n"
"{
\n"
" ShadowCood.s = dot( ecPosition, gl_EyePlaneS[0] );
\n"
" ShadowCood.t = dot( ecPosition, gl_EyePlaneT[0] );
\n"
" ShadowCood.p = dot( ecPosition, gl_EyePlaneR[0] );
\n"
" ShadowCood.q = dot( ecPosition, gl_EyePlaneQ[0] );
\n"
"}
\n"
"
\n"
"\n";
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

