allow shaders to be reloaded with a pair of toggleShaderEffects
actions
This commit is contained in:
parent
3a8c8830e8
commit
54db2c2c3b
|
@ -31,7 +31,7 @@ float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET
|
|||
float4 color = shaderTexture.Sample(samplerState, tex);
|
||||
|
||||
// Inverts the rgb values (xyz) but don't touch the alpha (w)
|
||||
// color.xyz = 1.0 - color.xyz;
|
||||
color.xyz = 1.0 - color.xyz;
|
||||
|
||||
float2 relativeCursorPos = CursorPosition / BufferSize;
|
||||
if (tex.y >= relativeCursorPos.y) {
|
||||
|
|
|
@ -246,6 +246,12 @@ bool DxEngine::_HasTerminalEffects() const noexcept
|
|||
void DxEngine::ToggleShaderEffects()
|
||||
{
|
||||
_terminalEffectsEnabled = !_terminalEffectsEnabled;
|
||||
// If we're enabling the shader, try reloading it.
|
||||
// It's not as good as hot reloading the hlsl file itself, but it's good enough.
|
||||
if (_terminalEffectsEnabled)
|
||||
{
|
||||
_SetupTerminalEffects();
|
||||
}
|
||||
LOG_IF_FAILED(InvalidateAll());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue