I keep the shader code in include files with the code wrapped as C++11 raw
strings. That way, you can edit them in a clean format and still include
the code as std::string's.
The code becomes embedded in the application and the build system
dependencies monitor the included shader files..
std::string fragment_shader_code = R"shader(
uniform sampler2D source;
void main()
{
// Sample the source texture...
vec3 color = texture2D( source, gl_TexCoord[0].st ).rgb;
// Compute output color
gl_FragColor = vec4( color, 1.0 );
} // end main /////////////////////////////////////////
)shader";
On Fri, Feb 18, 2022 at 4:41 AM Werner Modenbach <
[email protected]> wrote:
> Hi all,
> I'm using osg in a Qt environment.
> All my shader code is *not* located in the file system and also not as
> const in the code.
> Instead it is in the Qt-Resources. Does anybody know a way how to load
> include "files" from those resources?
>
> An alternative approach might be using the pragmatic shader composition
> instead.
> Unfortunately I couldn't find a description of how to use it and also no
> example code.
>
> Any hints for me?
> Thanks in advance
> Werner
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/4dfba532-bcae-197f-44e6-7779abaa35e9%40modenbach-ac.de
> <https://groups.google.com/d/msgid/osg-users/4dfba532-bcae-197f-44e6-7779abaa35e9%40modenbach-ac.de?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/osg-users/CADt6fWXCc6XdN2hMx8V2b1rXZGgkjJZqTnmxbYhHzM5eSHW6ug%40mail.gmail.com.