Yes it possible )
at first of all you will need going to Shader.cpp and fix it in CommentOutFunction
bool Shader::BeginLoad(Deserializer& source)
{
Graphics* graphics = GetSubsystem<Graphics>();
if (!graphics)
return false;
// Load the shader source code and resolve any includes
timeStamp_ = 0;
String shaderCode;
if (!ProcessSource(shaderCode, source))
return false;
// Comment out the unneeded shader function
vsSourceCode_ = shaderCode;
psSourceCode_ = shaderCode;
//CommentOutFunction(vsSourceCode_, "void PS(");
//CommentOutFunction(psSourceCode_, "void VS(");
CommentOutFunction(vsSourceCode_, "PS_OUTPUT PS(");
CommentOutFunction(psSourceCode_, "VS_OUTPUT VS(");
// OpenGL: rename either VS() or PS() to main()
#ifdef URHO3D_OPENGL
vsSourceCode_.Replace("void VS(", "void main(");
psSourceCode_.Replace("void PS(", "void main(");
#endif
RefreshMemoryUse();
return true;
}
and then you are free to use structs in shaders
little example:
[pastebin]pjRA4tZ5[/pastebin]
actually I rewrite most of them in this style (except some part of post effect shaders), but now I want do some refactoring with names
because the Output or Input it’s very long names(IMO), instead these names I want to change it to OUT and IN
also I checking this shaders on DX9 by running std urho’s examples and it seams that all run OK even on DX9