A ViewShader represents a shader object, expected to be used by a Meta_ViewFilter.
The inputs to the shader will be set by this nodes children, each of which are expected to be one of the Meta_ShaderABC metanodes (e.g. Meta_ShaderVec3f, Meta_ShaderSampler etc.).
Expected Implementation Details:-
When the SourceCode property changes a search for "#pragma rex Meta_ViewShader with their defined default values, allowing the user to easily configure the shader from the property panel or a script. If these #pragma's are missing in the source the user will have to manually create the child Meta_MaterialParameter nodes and set their values.
string - the source code of the shader. Usually a full GLSL shader but could be just a GLSL function used by a bigger shader.
string - friendly description of what the shader does, for presenting to the user.
Target (int)- determines when the shader runs and which buffers it has access to.
StereoMode (int) - specifies whether the shader applies to mono or stereo views, or both.
Values for Idx_StereoMode.
The filter is applied regardless of whether stereo is enabled. (Symbols - C: "StereoModeAny", Lua: __ViewShader_StereoModeAny)
The filter is applied only when rendering in mono. (Symbols - C: "StereoModeMonoOnly", Lua: __ViewShader_StereoModeMonoOnly)
The filter is applied only when rendering in stereo. (Symbols - C: "StereoModeStereoOnly", Lua: __ViewShader_StereoModeStereoOnly)
Values for Idx_Target.
The filter is applied to each viewport immediately after it is drawn, and can use all buffers. (Symbols - C: "TargetViewport", Lua: __ViewShader_TargetViewport)
The filter is applied to each viewport after the HDR pass (Symbols - C: "TargetViewportAfterHDR", Lua: __ViewShader_TargetViewportAfterHDR)
The filter is applied to the entire window after everything including the GUI is drawn, but can use only the colour buffer. (Symbols - C: "TargetWindow", Lua: __ViewShader_TargetWindow)