You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be more reasonably doable to inject custom shaders into the engine.
In particular, maintain a list of custom shaders for the primary stages and a mapping of their requirements?
Primary stages being: FORWARD/SOLID, FORWARD/TRANSPARENT, DEFERRED/SOLID, and DEFERRED/TRANSPARENT
The rest probably don't need custom injection so much? But also be open to having that option available maybe (separate/future issue?)
My idea is the shaders would be registered with a map of required data, be easily attached to standard Renderable properties, ...
Also they would be carefully crafted as to PARTIAL shader definitions, not writing the entire fragment or vertex main call, but rather a sub-function call or direct injection that allows defining values separately from the logic for EG wrapping data, inputs, or special required effects - such as light/shadow application in the FORWARD shaders. Would be disableable by booleans set in-shader
IE, might look like this in a FORWARD shader:
// Top of file#define FGE_LIGHTS_ENABLE 1// Main defs and logic
#inject forward_inclusions
// Start of injection area#define FGE_LIGHTS_ENABLE myVariableHere
// End of injection area// Additional logic#if FGE_LIGHTS_ENABLE
// Lighting logic#endif// Rest of file
Basically: the define could either be a static 1 or 0, OR it could be a variable name which will parse fine by later code? not sure.
That code would also have easy access to whatever variables it requests and maps...
The text was updated successfully, but these errors were encountered:
I think the graphics pipeline should adapt to what the shader requires if someone wants to mix 6 textures they could maybe pass a custom shader properties class to the custom shader telling the pipeline what to do with that shader. The pipeline would be like ok we got 6 textures so let's put those in.
Custom uniforms would be a really powerful thing to have. We can have actions that get invoked when the shader gets used allowing people to use their variables.
It should be more reasonably doable to inject custom shaders into the engine.
In particular, maintain a list of custom shaders for the primary stages and a mapping of their requirements?
Primary stages being:
FORWARD/SOLID, FORWARD/TRANSPARENT, DEFERRED/SOLID, and DEFERRED/TRANSPARENT
The rest probably don't need custom injection so much? But also be open to having that option available maybe (separate/future issue?)
My idea is the shaders would be registered with a map of required data, be easily attached to standard Renderable properties, ...
Also they would be carefully crafted as to PARTIAL shader definitions, not writing the entire fragment or vertex
main
call, but rather a sub-function call or direct injection that allows defining values separately from the logic for EG wrapping data, inputs, or special required effects - such as light/shadow application in the FORWARD shaders. Would be disableable by booleans set in-shaderIE, might look like this in a FORWARD shader:
Basically: the define could either be a static
1
or0
, OR it could be a variable name which will parse fine by later code? not sure.That code would also have easy access to whatever variables it requests and maps...
The text was updated successfully, but these errors were encountered: