Replies: 3 comments 1 reply
-
The VSG provides shader compilation as long as you compile the VSG with glslang, which would make it easy for an editor to provide new GLSL code and have it compiled automatically and displayed. I think vsgImGui would be a natural tool to use for editing shaders and controlling input values. Personally I'd allow the program to provide any combination of vertex, geometry, fragment etc. shaders, and allow models to be loaded as well as default quad across the whole window. The most straight forward way to implement this would be to provide the data would be as uniforms. The VSG already can provide the ViewportData as part of the vsg::ViewDependentState - the vsgPoints library's brick.vert leverages this controlling point sizes. You could also provide user defined input values as well if you so wished. Essentially it could be shader toy that allows you to play with far more than the web browser based cousin. |
Beta Was this translation helpful? Give feedback.
-
The VSG is supports #pragma(tic) shader composition so you could enable optional compilation of different code paths. If you built the functionality on top of vsg::ShaderSet then you could also output complete definitions of all the data types and functions in the ShaderSet making it possible to use with other VSG based applications. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your comments, @robertosfield . My initial goal is much less ambitious. I just want to be able to read a fragmant shader source file given on the command line and render it like in shadertoy. Following your suggestion, I had a look at the |
Beta Was this translation helpful? Give feedback.
-
Shadertoy is a online web toy that allows the program to write a fragment shader program, while the vertex shader just passes through the four coordinates of a unit quad that fills the viewport.
The fragment shader has a few uniforms, e.g. iTime, iTimeDelta, and iResolution.
I'd like to write a vsg based program, as a learning exercise, that replicates this behavior. But I have a few questions:
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions