🔧 Improve T-Rex effect
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* The source code has received a **major refactoring**. This will make the addition of new effects much easier in the future.
|
||||
* The **layout of the settings dialog** has been reworked to make it easier to expand it in the future.
|
||||
* The lower limit of the **animation time of the TV Effect** has been reduced.
|
||||
* The T-Rex-Attack effect is not shown in fully transparent regions of a window any more.
|
||||
|
||||
#### Fixes
|
||||
|
||||
|
||||
+6
-3
@@ -214,15 +214,18 @@ if (utils.isInShellProcess()) {
|
||||
vec2 offset = vec2(dFdx(scratchMap), dFdy(scratchMap)) * uProgress * 0.5;
|
||||
cogl_color_out = texture2D(uTexture, coords + offset);
|
||||
|
||||
// Hide scratched out parts.
|
||||
cogl_color_out *= (scratchMap > uProgress ? 1 : 0);
|
||||
|
||||
// Add colorful flashes.
|
||||
float flashIntensity = 1.0 / FLASH_INTENSITY * (scratchMap - uProgress) + 1;
|
||||
if (flashIntensity < 0 || flashIntensity >= 1) {
|
||||
flashIntensity = 0;
|
||||
}
|
||||
|
||||
// Hide flashes where there is now window.
|
||||
flashIntensity *= cogl_color_out.a;
|
||||
|
||||
// Hide scratched out parts.
|
||||
cogl_color_out *= (scratchMap > uProgress ? 1 : 0);
|
||||
|
||||
vec3 flashColor = vec3(${color.red / 255},
|
||||
${color.green / 255},
|
||||
${color.blue / 255}) * ${color.alpha / 255};
|
||||
|
||||
Reference in New Issue
Block a user