From 1a05b9b14dcfc4d85e885bb12af1a6fb2d6a4c5c Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 29 Oct 2019 21:25:52 +0100 Subject: [PATCH] 1.0.4: - Adjust AmbientGlow shader to work EXACTLY like in UE1 (don't ask how I figured this out). - Fix Enforcer sometimes reloading when reloading is disabled. - Fix Enforcer pickups having no ambient glow. --- Readme.md | 2 +- gldefs.txt | 4 ++++ shaders/glsl/AmbientGlow.fp | 5 ++--- shaders/glsl/AmbientGlow_Brightmapped.fp | 8 +++----- shaders/glsl/MeshEnviroMap_AmbientGlow.fp | 5 ++--- zscript/enforcer.zsc | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Readme.md b/Readme.md index b854ccc..bd58bd7 100644 --- a/Readme.md +++ b/Readme.md @@ -61,7 +61,7 @@ This mod requires GZDoom 4.2.3 or later. ## In progress - - N/A, this is the 1.0.3 release + - N/A, this is the 1.0.4 release ## Planned diff --git a/gldefs.txt b/gldefs.txt index a313566..75973c5 100644 --- a/gldefs.txt +++ b/gldefs.txt @@ -484,6 +484,10 @@ HardwareShader Texture "models/JEClip.png" { Shader "shaders/glsl/AmbientGlow.fp" } +HardwareShader Texture "models/Jautot1.png" +{ + Shader "shaders/glsl/AmbientGlow.fp" +} HardwareShader Texture "models/BladeHopperT.png" { Shader "shaders/glsl/AmbientGlow.fp" diff --git a/shaders/glsl/AmbientGlow.fp b/shaders/glsl/AmbientGlow.fp index 7e54247..f47788a 100644 --- a/shaders/glsl/AmbientGlow.fp +++ b/shaders/glsl/AmbientGlow.fp @@ -1,8 +1,7 @@ -// imitation of the Unreal Engine 1.x ambient glow effect, timing may be off -#define PI 3.14159265 +// imitation of the Unreal Engine 1.x ambient glow effect vec4 ProcessLight( vec4 color ) { - float glow = (1.0+sin(timer*2*PI))*0.25; + float glow = 0.25+0.2*sin(timer*8); return vec4(min(color.rgb+vec3(glow),1.0),color.a); } diff --git a/shaders/glsl/AmbientGlow_Brightmapped.fp b/shaders/glsl/AmbientGlow_Brightmapped.fp index d8da495..5a2650e 100644 --- a/shaders/glsl/AmbientGlow_Brightmapped.fp +++ b/shaders/glsl/AmbientGlow_Brightmapped.fp @@ -1,11 +1,9 @@ -// imitation of the Unreal Engine 1.x ambient glow effect, timing may be off -// combining with brightmaps requires the brightmap to be embedded into the -// alpha channel of the diffuse texture -#define PI 3.14159265 +// imitation of the Unreal Engine 1.x ambient glow effect +// plus brightmapping vec4 ProcessLight( vec4 color ) { float bright = texture(brighttex,vTexCoord.st).x; - float glow = (1.0+sin(timer*2*PI))*0.25; + float glow = 0.25+0.2*sin(timer*8); return vec4(min(color.rgb+vec3(bright)+vec3(glow),1.0),color.a); } diff --git a/shaders/glsl/MeshEnviroMap_AmbientGlow.fp b/shaders/glsl/MeshEnviroMap_AmbientGlow.fp index b7cdab7..58c5107 100644 --- a/shaders/glsl/MeshEnviroMap_AmbientGlow.fp +++ b/shaders/glsl/MeshEnviroMap_AmbientGlow.fp @@ -1,8 +1,7 @@ -// imitation of the Unreal Engine 1.x ambient glow effect, timing may be off -#define PI 3.14159265 +// imitation of the Unreal Engine 1.x ambient glow effect vec4 ProcessLight( vec4 color ) { - float glow = (1.0+sin(timer*2*PI))*0.25; + float glow = 0.25+0.2*sin(timer*8); return vec4(min(color.rgb+vec3(glow),1.0),color.a); } diff --git a/zscript/enforcer.zsc b/zscript/enforcer.zsc index 5144ef9..0b80a6b 100644 --- a/zscript/enforcer.zsc +++ b/zscript/enforcer.zsc @@ -527,7 +527,7 @@ Class Enforcer : UTWeapon Dummy: TNT1 A 1 { - if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) player.SetPSprite(PSP_WEAPON,ResolveState("Reload")); + if ( flak_enforcerreload && (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) player.SetPSprite(PSP_WEAPON,ResolveState("Reload")); else if ( flak_enforcerreload && ((invoker.clipcount < min(invoker.default.clipcount,invoker.Ammo1.Amount)) || (invoker.slaveclipcount < min(invoker.default.slaveclipcount,invoker.Ammo1.Amount))) ) A_WeaponReady(WRF_ALLOWRELOAD); else A_WeaponReady(); if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) ) @@ -600,7 +600,7 @@ Class Enforcer : UTWeapon { if ( invoker.clipcount >= invoker.default.clipcount ) { - invoker.slavereload = (invoker.slaveactive&&(invoker.slaveclipcount