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.
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.
-
-
- 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
I can think of two ways the engine might manage the effect:
1. By sending the entire scene (minus any Spectres) as a texture to a shader which has been applied to each frame of the Spectre(s).
2. Or send a black scene with just the Spectres drawn in greyscale as a texture to a post-processing shader.
Going by what Graf has said in a recent feature request, option 1 won't be possible until the Vulkan renderer is ready. But that doesn't mean it would automatically work either without additional development which option 2 requires as well (but could happen sooner than Vulkan?).
I know it's not the same thing but you could substitute this as a placeholder in your mods until Fill Spectre gets the support it needs. It was my attempt at a sprite version of Fill Spectre so it won't suffer the drawbacks of the purple detection.
1. By sending the entire scene (minus any Spectres) as a texture to a shader which has been applied to each frame of the Spectre(s).
2. Or send a black scene with just the Spectres drawn in greyscale as a texture to a post-processing shader.
Going by what Graf has said in a recent feature request, option 1 won't be possible until the Vulkan renderer is ready. But that doesn't mean it would automatically work either without additional development which option 2 requires as well (but could happen sooner than Vulkan?).
I know it's not the same thing but you could substitute this as a placeholder in your mods until Fill Spectre gets the support it needs. It was my attempt at a sprite version of Fill Spectre so it won't suffer the drawbacks of the purple detection.
-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
I remember I see somewhere mod which draw monsters on player screen if it in player fov, like wallhack from cs. Probably on/in some marisa mod... video, more preciesly.
So technically, I think, its possible to turn in shader if spectre in player fov, and only at position of the spectre sprite on player screen. Of course if shader can "chew" posotion of a monster on player screen as coordinates for shader effect.
So technically, I think, its possible to turn in shader if spectre in player fov, and only at position of the spectre sprite on player screen. Of course if shader can "chew" posotion of a monster on player screen as coordinates for shader effect.
-
-
- 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
Thanks for confirming that Apeirogon, all I had were suspicions from reading through wiki entries! And those tend to break my brain
The shader already knows where the monster is on the screen but through chroma-keying, which is the big conundrum

The shader already knows where the monster is on the screen but through chroma-keying, which is the big conundrum

-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
There are gutawer math library
https://gitlab.com/Gutawer/gzdoom-gutam ... ree/master
which have some lines which you can use for it, like
https://gitlab.com/Gutawer/gzdoom-gutam ... x.zsc#L165
I think I can help with it, but it require from me to remeber how handle with matrix and other stuff, since from last time I was considered equation more complex than "2+2=5" passed more than ten years.
Plus, mathematics =/= programming.
https://gitlab.com/Gutawer/gzdoom-gutam ... ree/master
which have some lines which you can use for it, like
https://gitlab.com/Gutawer/gzdoom-gutam ... x.zsc#L165
I think I can help with it, but it require from me to remeber how handle with matrix and other stuff, since from last time I was considered equation more complex than "2+2=5" passed more than ten years.
Plus, mathematics =/= programming.
-
-
- 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
Oh I think I see now: You want to have ZScript tell the shader where in 3D space the Spectre is and what rotation/scale to use. Then the shader will read from a texture containing the Spectre's sprite sheet, apply billboarding transformations and then lens the background using it's luminance? That would mean no more chroma-keying
Apart from the lensing part I had actually thought of that technique as a means to cure sprite clipping but decided it was too ambitious due to the number of sprites in the game and my poor maths. For one monster though it sounds pretty plausible!
Edit: Oh, and because the Spectre is see-through you don't even need to consider lighting! (Another reason I dismissed the sprite clipping solution).

Apart from the lensing part I had actually thought of that technique as a means to cure sprite clipping but decided it was too ambitious due to the number of sprites in the game and my poor maths. For one monster though it sounds pretty plausible!
Edit: Oh, and because the Spectre is see-through you don't even need to consider lighting! (Another reason I dismissed the sprite clipping solution).
-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
Not exactly, say to zscript it, specter in this case, position on player screen, and then use shader on that piece of screen.
Because, I think, without changing/exposing to zscript inner gzdoom drawer, which almost impossible, draw() function cant use shader directly to actor SPRITE, only to/on piece of player screen where this sprite draws gzdoom itself.
Im not so familiar with ui functions, because I dont use them much....well, at all, and with gutawer math stuff, for same reason, so another potential problem here is, how check so that specter is in player fov. Maybe gutawer matrix already return what player actualy see......or maybe not. I have some thoughs how do so in game scope, every tick, but Im not sure this suits for ui scope, because mouse movement/player fov changing processed more ofthen than every tick. So....field testing required.
Because, I think, without changing/exposing to zscript inner gzdoom drawer, which almost impossible, draw() function cant use shader directly to actor SPRITE, only to/on piece of player screen where this sprite draws gzdoom itself.
Im not so familiar with ui functions, because I dont use them much....well, at all, and with gutawer math stuff, for same reason, so another potential problem here is, how check so that specter is in player fov. Maybe gutawer matrix already return what player actualy see......or maybe not. I have some thoughs how do so in game scope, every tick, but Im not sure this suits for ui scope, because mouse movement/player fov changing processed more ofthen than every tick. So....field testing required.
-
-
- 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
Is this the sort of thing you mean? Marisa'a Mod Cause that would be coolApeirogon wrote:Probably on/in some marisa mod...

-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
Not exactly what I remember, but at the second screenshot it draw hiden part of acid pool on screen, so I think it works same way. I ask her how she did it.
-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
So, marise give me this link to her mod. I understood some part of it, but some part is a pure magic for me. I see there are sine and cosine with arctangents, but in total I cant realize what means what.
Okay, using my "pen and paper" IBM PC and laws of geometrical optics I get something. "static Vector3 WorldToScreen" return coortdinate of points relative to player/camera position/slope/pitch/yaw/etc. and "static Vector2 ToViewport", if you give to it vector calculated in WorldToScreen, return exact position of that point at/on player screen. But, in one pass it returns only one point.
So now I need to figure out how check can player see spectre or not using ui part of gzdoom, if it possible.
Okay, using my "pen and paper" IBM PC and laws of geometrical optics I get something. "static Vector3 WorldToScreen" return coortdinate of points relative to player/camera position/slope/pitch/yaw/etc. and "static Vector2 ToViewport", if you give to it vector calculated in WorldToScreen, return exact position of that point at/on player screen. But, in one pass it returns only one point.
So now I need to figure out how check can player see spectre or not using ui part of gzdoom, if it possible.
-
-
- 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
As my neck cranes up at that looming wall of shiny code I can feel my once-trailing shadow slink beneath my feet 

-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
Not all thats bad. If you know some actions over matrices this would be more easy to understand.Pixel Eater wrote:I feel the maw of despair swalowing me...
I figure out that marisas example was modified to her needs. It would have cost to me 600 euro, if I would buy mathcad to check what wrong with it. But I pirated it

So, I fall back to gutawer code and at example of marisas code create my own. It works, but it have some BACK effect.
https://youtu.be/mGzd1Mt-4DA
Something with pitch, I think.
-
-
- 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
I can already tell that's progressing nicely!
Let me know if there's anything I can do on my end
Let me know if there's anything I can do on my end

-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
If you know how calculate dimensions change of object, because of perspective, tell me.
I fix pitch bug/feature/beg-o-feature, and now last thing that needed is found a perspective "distortions". This needed to define area inside of which shader must apply.
Again, I think I can learn how to do so by myself, but this require enormous amount of time, because now I know nothing about it and from what side I must approach to it. Matrix and stuff I know because Im studied for an electrician and its was necessary to understand how solder two wires one to another
.
But now Im a helpless baby in dirty diaper.
After I write this, I started to revise gutawer math stuff, and found out that he have template for perspective matrixes
I fix pitch bug/feature/beg-o-feature, and now last thing that needed is found a perspective "distortions". This needed to define area inside of which shader must apply.
Again, I think I can learn how to do so by myself, but this require enormous amount of time, because now I know nothing about it and from what side I must approach to it. Matrix and stuff I know because Im studied for an electrician and its was necessary to understand how solder two wires one to another

But now Im a helpless baby in dirty diaper.
After I write this, I started to revise gutawer math stuff, and found out that he have template for perspective matrixes
Spoiler:I can even define it, there are some tips about it. But I dont know what do next with it.
-
-
- 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
Are the variables going into the function (double fovy, double aspect, double zNear, double zFar) known by yourself/your code or are you unsure what to do with the returned values?
-
- Posts: 1603
- Joined: Mon Jun 12, 2017 12:57 am
Re: Fill Spectre v3
This.Pixel Eater wrote:are you unsure what to do with the returned values?
I found this book
https://www.amazon.com/Computer-Graphic ... 0136053580
at my native language, so now I have something like this I commented it, so you should not have problems with send info to shader.
Its still rude and buggy/ged, and probably dont optimized, but I worked on it.
You do not have the required permissions to view the files attached to this post.