Fill Spectre v3.1

Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v2 + DooM 64 Sprites

Post by Pixel Eater »

Thanks for the video! I'm curious why the lower left quadrant is remaining fixed. It's as if the shader is centered on the corner of the screen and not the middle :?

Have a go at this one:
FillSpectreDebug.pk3
I've disabled the section that does the depth calculations so hopefully we can see if that's causing the weird offset. Funnily enough the contour effect seems to have changed, maybe for the better?
You do not have the required permissions to view the files attached to this post.
User avatar
Trusty McLegit
Posts: 264
Joined: Sun Feb 07, 2016 8:42 pm

Re: Fill Spectre v2 + DooM 64 Sprites

Post by Trusty McLegit »

I think it worked... There's a black outline around the sides of the sprite but I assume that's unavoidable? Also, the effect doesn't apply through two or more spectres
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v2 + DooM 64 Sprites

Post by Pixel Eater »

That's super :)

Yeah I suspect the engine adds that outline to graphics with transparencies.
The effect failing when they cross paths is known but I'm confident someone around here with better coding chops than me will figure it out :mrgreen:
User avatar
NightFright
Spotlight Team
Posts: 1279
Joined: Fri May 02, 2008 12:29 pm
Location: Germany

Re: Fill Spectre v2 + DooM 64 Sprites

Post by NightFright »

Absolutely epic. That came out of nowhere and is pretty much the best proof why we all love GZDoom and its possibilities. Respect!
Last edited by NightFright on Fri Dec 08, 2017 7:50 am, edited 1 time in total.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v2 + DooM 64 Sprites

Post by Pixel Eater »

Thanks NightFright, I'm glad you like it :cheers:
User avatar
ZZYZX
 
 
Posts: 1381
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Fill Spectre v2 + DooM 64 Sprites

Post by ZZYZX »

For whatever reason the version from the first post broke on my GZDoom g3.3pre-239-g8fce9d9. It only fills properly in 0..1 coords, that is, only upper right quarter of the screen. All others are solid line:
https://i.imgur.com/bpbbjjt.png
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v2 + DooM 64 Sprites

Post by Pixel Eater »

Take a look at the first post of this page, there's a debug version that should fix this problem. If not I have version 3 coming out in a couple of days (provided my house doesn't fall down from these storms!) that does things differently :wink:
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Post by Pixel Eater »

If you can't stand the pixelly look, I'm finding that using XBRZ 4x is working well with a Tolerance(1st) of around .569 as long as the Spectre stays in close range (and they're usually placed to ambush I've noticed). FXAA is good on Low too but I still don't recommend using filtering.
xbrz4.jpg
Spinky.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Xeotroid
Posts: 386
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: Fill Spectre v3

Post by Xeotroid »

I don't know if this can be fixed in the shader or it has to be changed in GZDoom itself, but the shader doesn't like sprites with alpha channels rendered in front of Spectres, as seen here: https://streamable.com/b4vv4
Image
Of course, this isn't a problem in vanilla Doom or with old mods that don't have any graphics with alpha channel, I noticed this only when playing mods that do.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Post by Pixel Eater »

Yeah it's unlikely that can be fixed- except by turning off translucency. However with the new software fuzz mode there's a chance that this could be duplicated :woh:
dpJudas
 
 
Posts: 2869
Joined: Sat May 28, 2016 1:01 pm

Re: Fill Spectre v3

Post by dpJudas »

The new software fuzz mode was made based on the following observations:

1) The fuzz algorithm does two things. It reads slightly above or below the current pixel and it shades it. As it reads the pixels it wrote itself, some pixels appear darker than other pixels (as mentioned by Linguica on DW). This darkening pattern can be calculated, which is exactly what the table is about in fuzz_software.

2) The human eye is a lot better at noticing intensity changes than color. The first thing JPEG does, for example, is to throw away half the color information by downscaling the colors to half the original image. As a result of this, a player is far more likely to notice the shades of the original fuzz than the offsetting of the background itself (the distortion Linguica mentions). OpenGL (and multi-threaded software render) doesn't support reading from the framebuffer like Doom originally did, but it does allow the shade. So by using a new table with just the shade you get something very few people will be able to tell apart from the original effect.

3) The original effect looks wrong/different/shit in any resolution above 320x200. Upscale the effect so it stays looking like it did originally in 320x200. The tricky part here is mostly that the "fuzz pos" advances by how many pixels are drawn in each column - the software fuzz mode gets around this problem by adding some random advancing based on the screen position and the frame rendered.

The alternative version by Linguica cannot be implemented by OpenGL as it essentially attempts to make the distortion more apparent at the cost of a more flat shade. This is precisely the kind of thing you cannot do with OpenGL. The more flat the shade gets, the more the eye can concentrate on the color distortion/intensity change in the background.

Edit: I forgot to mention that the Linguica version somewhat can be approximated by using the technique you do here in Fill Spectre. But ultimately that method has the limitation with transparency and also copying neighboring pixels makes it grab some of the pixels from in front of the spectre.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Post by Pixel Eater »

dpJudas wrote:So by using a new table with just the shade you get something very few people will be able to tell apart from the original effect.
Oh, wow. I was totally convinced that the warping was occuring, nice one! :too happy:
dpJudas wrote:Edit: I forgot to mention that the Linguica version somewhat can be approximated by using the technique you do here in Fill Spectre. But ultimately that method has the limitation with transparency and also copying neighboring pixels makes it grab some of the pixels from in front of the spectre.
I actually came close to attempting that before the pleasant surprise of the new software mode. I guess I could have a go at it still, though the borrowing of eclipsing pixels isn't something I'd thought of before :mono:
User avatar
doomfiend
Posts: 526
Joined: Sun Aug 27, 2006 6:10 am
Location: some where

Re: Fill Spectre v3

Post by doomfiend »

is there a way that the shader can only effect the spectre sprite and not any monster / projectile using the pink / purple colours if one were to use a color translation? take colourful hell as an example. any pink / purple projectile has this odd spectre shader applied
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Post by Pixel Eater »

There *may* be a way to turn the shader off automatically when there are no Spectres on screen but I can't be sure yet. I'm only just scratching the surface of ZScript now. Even still, the issue would arise again when Spectres are present. To really solve the problem though it would require some modifications to the engine that are beyond my skillset and would require a volunteer with the experience and time. Until someone offers though I will get around to seeing if the first option is possible- I would like to update a lot of my older projects in time.
User avatar
doomfiend
Posts: 526
Joined: Sun Aug 27, 2006 6:10 am
Location: some where

Re: Fill Spectre v3

Post by doomfiend »

what I'm kind of wondering for a work around would be for the engine to add a new flag like Renderstyle "Fillspectre" and it would apply this warping effect to the sprite and does what it needs on the back-end, or what it could also do is automatically set the sprite colour via translation to magenta / cyan or something and handle it for that actor only if the original sprite with its varying shades / colours mess with the effect. I love the effect if Im doing vanilla stuff but I also love little mods to spice things up from time to time. My mod in particular simply hard uses purple translations to let the player know those are void enemies and purple projectiles / attacks if the player gets hit reverses your controls as if the player has a "confusion" debuff on them for 1-2 seconds unfortunately I had to remove the shader from the mod for now as all purple enemies have an odd effect when present. still though the fact that this was possible to begin with was jaw dropping. I loved it and I wholeheartedly think this is how spectres should be. the current ones we have spectres are extremely easy to see no matter what fuzz style I use. but I've actually had to keep a keen eye out and ears ready for lurking spectre's in dark areas.

Return to “Shaders”