Compare commits

..

No commits in common. "3439211cb1767ff7f7daacfc119dfe9dffb16e5a" and "67ef4319eae4286e9f0251df06e98e2bb53b5824" have entirely different histories.

8 changed files with 8 additions and 81 deletions

View file

@ -351,76 +351,6 @@ float4 doors(float2 st : TEXCOORD0) : COLOR0 {
return color; return color;
} }
float4 doom(float2 st : TEXCOORD0) : COLOR0 {
float time=uProgress*0.02;
if(uProgress>50.){time=2.-uProgress*0.02;}
float diff=sin(ceil(st.x*100.)*2.2 + ceil(st.x*st.x*100.)*3.)*0.2 -0.4+time*2.0;
if(diff>0.){
if(uProgress>50.){st.y+=diff;}
else{st.y-=diff;}
}
float4 color = tex2D(uImage0, st);
if(st.y>1. || st.y<0.)color = float4(0,0,0,0);
return color;
}
/* NOTE: FBM is a bit heavier than other tasks, so this will have to wait until I'm doing ps_3_0 things.
float fract(float x){return x-floor(x);}
float mix(float x, float y, float a){return x*(1.-a)+y*a;}
// This FBM functionality from thebookofshaders.com, unfortunately I don't have time to design my own version currently.
float random (in float2 st) {
return fract(sin(dot(
st.xy,
float2(12.9898,78.233)
))*43758.5453123);
}
float noise (in float2 st) {
float2 i = floor(st);
float2 f = fract(st);
float a = random(i);
float b = random(i + float2(1.0, 0.0));
float c = random(i + float2(0.0, 1.0));
float d = random(i + float2(1.0, 1.0));
float2 u = f * f * (3.0 - 2.0 * f);
return mix(a, b, u.x)
+(c - a)* u.y * (1.0 - u.x)
+(d - b) * u.x * u.y;
}
#define FBM_OCTAVES 1
float fbm (in float2 st) {
// Initial values
float value = 0.0;
float amplitude = .5;
float frequency = 0.;
// Loop of octaves
for (int i = 0; i < FBM_OCTAVES; i++) {
value += amplitude * noise(st);
st *= 2.;
amplitude *= .5;
}
return value;
}
// End FBM
float4 fog(float2 st : TEXCOORD0) : COLOR0 {
//st=rotate(st,u_time);
float2 ce=float2(.5,.5);
float4 color = tex2D(uImage0, st);
color.a = 1.-length(st-ce)*fbm(st*2.5+uProgress*0.01);
//color.r=1.-length(st-ce)*fbm(2.5*st+fbm(st+u_time)+u_time)*6.;
//color.r=fbm(2.5*st+fbm(st+u_time));
return color;
}*/
technique Technique1 technique Technique1
{ {
pass Lines {PixelShader = compile ps_2_0 lines();} pass Lines {PixelShader = compile ps_2_0 lines();}
@ -436,6 +366,4 @@ technique Technique1
pass Collapse {PixelShader = compile ps_2_0 columns_sudden_angled();} pass Collapse {PixelShader = compile ps_2_0 columns_sudden_angled();}
pass Circle {PixelShader = compile ps_2_0 circle();} pass Circle {PixelShader = compile ps_2_0 circle();}
pass Doors {PixelShader = compile ps_2_0 doors();} pass Doors {PixelShader = compile ps_2_0 doors();}
pass Doom {PixelShader = compile ps_2_0 doom();}
// pass Rolling{PixelShader = compile ps_2_0 fog();}
} }

Binary file not shown.

View file

@ -10,10 +10,10 @@ using Terraria.ModLoader;
namespace smoothDeathTransitions { namespace smoothDeathTransitions {
public class TransitionPlayer : ModPlayer { public class TransitionPlayer : ModPlayer {
public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) /*public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
{ {
Player.respawnTimer=150; // For testing Player.respawnTimer=150; // For testing
} }*/
public string GetBiomeSpecificTransitions(){ public string GetBiomeSpecificTransitions(){
// This code is going to suck. // This code is going to suck.
@ -44,7 +44,6 @@ namespace smoothDeathTransitions {
if(Player.ZoneSkyHeight)return "Rising"; if(Player.ZoneSkyHeight)return "Rising";
if(Player.ZoneNormalUnderground || Player.ZoneNormalCaverns)return "Circle"; if(Player.ZoneNormalUnderground || Player.ZoneNormalCaverns)return "Circle";
if(Player.ZoneUnderworldHeight)return "Falling"; if(Player.ZoneUnderworldHeight)return "Falling";
if(Player.ZoneSandstorm)return "Doom";
return ModContent.GetInstance<TransitionsConfig>().DefaultTransition; return ModContent.GetInstance<TransitionsConfig>().DefaultTransition;
} }
@ -55,7 +54,7 @@ namespace smoothDeathTransitions {
public override void PreUpdate() public override void PreUpdate()
{ {
// Check if appropriate conditions // Check if appropriate conditions
if(Main.netMode != NetmodeID.Server && Main.LocalPlayer == Player){ if(Main.netMode != NetmodeID.Server){
// Check if the time is nigh // Check if the time is nigh
if(transitionTicker==0 && Player.dead && Player.respawnTimer<transitionTime/2){ if(transitionTicker==0 && Player.dead && Player.respawnTimer<transitionTime/2){
transitionTicker=transitionTime; transitionTicker=transitionTime;

View file

@ -17,7 +17,7 @@ namespace smoothDeathTransitions
[DefaultValue("Lines")] [DefaultValue("Lines")]
[TooltipKey("$DefaultTransitionTooltip")] [TooltipKey("$DefaultTransitionTooltip")]
[DrawTicks] [DrawTicks]
[OptionStrings(["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Collapse", "Circle", "Doors", "Doom", "Prideful"])] [OptionStrings(["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Collapse", "Circle", "Doors", "Prideful"])]
public string DefaultTransition; public string DefaultTransition;
[DefaultValue(160)] [DefaultValue(160)]

View file

@ -1,4 +1,4 @@
displayName = Smooth Death Transitions displayName = Smooth Death Transitions
author = Emerald Quartz author = Emerald Quartz
side = Client side = Client
version = 2.0.2 version = 2.0.1

View file

@ -12,7 +12,6 @@ Currently available transitions:
- Collapse - jagged diagonal letterboxing. - Collapse - jagged diagonal letterboxing.
- Circle - simple closing-in circle. - Circle - simple closing-in circle.
- Doors - two-sided shut and open. - Doors - two-sided shut and open.
- Doom - puts the screen through a paper shredder.
- Prideful - trans flag sweep that optionally replaces the Hallow's ordinary transition. - Prideful - trans flag sweep that optionally replaces the Hallow's ordinary transition.
Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition. Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition.

View file

@ -1,3 +1,5 @@
[h1]Smooth Death Transitions[/h1]
Updates the traditional death screen with smooth transition shaders when you respawn. Fully client-side (does not alter gameplay) and configurable. Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition for your position. Updates the traditional death screen with smooth transition shaders when you respawn. Fully client-side (does not alter gameplay) and configurable. Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition for your position.
Currently available transitions: Currently available transitions:
@ -13,7 +15,6 @@ Currently available transitions:
[*][b]Collapse[/b] - jagged diagonal letterboxing. [*][b]Collapse[/b] - jagged diagonal letterboxing.
[*][b]Circle[/b] - simple closing-in circle. [*][b]Circle[/b] - simple closing-in circle.
[*][b]Doors[/b] - two-sided shut and open. [*][b]Doors[/b] - two-sided shut and open.
[*][b]Doom[/b] - puts the screen through a paper shredder.
[*][b]Prideful[/b] - trans flag sweep that optionally replaces the Hallow's ordinary transition. [*][b]Prideful[/b] - trans flag sweep that optionally replaces the Hallow's ordinary transition.
[/list] [/list]

View file

@ -10,7 +10,7 @@ namespace smoothDeathTransitions
{ {
public class SmoothDeathTransitions : Mod public class SmoothDeathTransitions : Mod
{ {
public string[] transitionsAvailable = ["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Prideful", "Collapse", "Circle", "Doors", "Doom"]; public string[] transitionsAvailable = ["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Prideful", "Collapse", "Circle", "Doors"];
public override void Load(){ public override void Load(){
if(Main.netMode != NetmodeID.Server){ if(Main.netMode != NetmodeID.Server){
Asset<Effect> screenRef = Assets.Request<Effect>("Effects/transitions"); Asset<Effect> screenRef = Assets.Request<Effect>("Effects/transitions");