by Rachael » Thu Mar 28, 2024 3:22 pm
Honestly, it feels a bit pointless to work on coding for the old system if we want to refactor it. Plus, it's high time we gave the fade system a bit of a makeover, not just for user shaders but because it needs it anyway in order to be more flexible.
That being said, if you can make your PR on the existing shader system (it should already be possible by looking at how the burn and melt styles are done) then sure, we can merge it.
To be quite frank, I wouldn't spend too much time on the algorithm part. It seems smarter to use a custom texture, where the brightness of each pixel marks the moment it transitions to the new image. This way, the shader simply checks if it's time to switch from the old image to the new one based on the pixel's brightness. The shader can compare the timer value with the brightness of the texture's pixel to figure out whether to place the current pixel from the old screen or to the new screen. This might get a little tricky with trilinear filtering, but you can use some form of a "floor" function on the texture coordinates to fix that.
Honestly, it feels a bit pointless to work on coding for the old system if we want to refactor it. Plus, it's high time we gave the fade system a bit of a makeover, not just for user shaders but because it needs it anyway in order to be more flexible.
That being said, if you can make your PR on the existing shader system (it should already be possible by looking at how the burn and melt styles are done) then sure, we can merge it.
To be quite frank, I wouldn't spend too much time on the algorithm part. It seems smarter to use a custom texture, where the brightness of each pixel marks the moment it transitions to the new image. This way, the shader simply checks if it's time to switch from the old image to the new one based on the pixel's brightness. The shader can compare the timer value with the brightness of the texture's pixel to figure out whether to place the current pixel from the old screen or to the new screen. This might get a little tricky with trilinear filtering, but you can use some form of a "floor" function on the texture coordinates to fix that.