Is there a better way to write shaders
{Qt/Qml 5.2.0, creator 3.0}
The way to write the shader code in quotes for vertex and fragment shader properties of ShaderEffect seems a little inefficient for me. Lack indentation and other smart IDE features since it is after all a string. However i do see that I can create .vsh and .fsh files whenever i do add-new-files. Do you know how to use these in vertexshader and fragmentshader properties of ShaderEffect?
eg.,
Code:
shader file = VShader.vsh
Code:
ShaderEffect {
vertexshader: VShader.vsh //how do i wirte this
}
Re: Is there a better way to write shaders
Provide a function that will read the shader from file and expose it to QML (the function, of course).