Fill Spectre v3.1

Re: Fill Spectre v3

Postby Pixel Eater » Sat Jun 16, 2018 7:52 pm

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.
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Sun Jun 17, 2018 1:53 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Sun Jun 17, 2018 2:30 am

Thanks for confirming that Apeirogon, all I had were suspicions from reading through wiki entries! And those tend to break my brain :lol:
The shader already knows where the monster is on the screen but through chroma-keying, which is the big conundrum :?
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Mon Jun 18, 2018 6:13 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Mon Jun 18, 2018 7:07 am

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 :D
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).
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Mon Jun 18, 2018 8:28 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Mon Jun 18, 2018 4:13 pm

Apeirogon wrote:Probably on/in some marisa mod...

Is this the sort of thing you mean? Marisa'a Mod Cause that would be cool :D
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Tue Jun 19, 2018 10:13 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Apeirogon » Fri Jun 22, 2018 10:53 am

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Fri Jun 22, 2018 8:35 pm

As my neck cranes up at that looming wall of shiny code I can feel my once-trailing shadow slink beneath my feet :shock:
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Sun Jun 24, 2018 6:07 am

Pixel Eater wrote:I feel the maw of despair swalowing me...

Not all thats bad. If you know some actions over matrices this would be more easy to understand.

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 :roll:.
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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Sun Jun 24, 2018 7:00 am

I can already tell that's progressing nicely!

Let me know if there's anything I can do on my end :thumb:
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Mon Jun 25, 2018 9:20 am

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 :P .
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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3

Postby Pixel Eater » Mon Jun 25, 2018 4:41 pm

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?
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Fill Spectre v3

Postby Apeirogon » Tue Jun 26, 2018 8:47 am

Pixel Eater wrote:are you unsure what to do with the returned values?

This.

I found this book
https://www.amazon.com/Computer-Graphic ... 0136053580
at my native language, so now I have something like this
shader test.zip

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.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

PreviousNext

Return to Shaders

Who is online

Users browsing this forum: No registered users and 0 guests