Fill Spectre v3.1

Re: Fill Spectre v3

Postby Pixel Eater » Tue Jun 26, 2018 4:09 pm

This is looking good so far. The magick + signs are a little wonky but seem to show perspective skewing (maybe just reversed?)

I tried changing this line to:
Code: Select allExpand view
if(e.thing.bismonster == true && e.thing.checkclass("Spectre") == true)

And surprisingly it actually worked for me :lol:


Edit: I just added 'x 2' after each 'coordinate_numbers[i].height' in the magick code section and it stretched the bounding box to the full height of the Spectre :)
Code: Select allExpand view
Screen.drawText(smallfont, Font.CR_White, position_on_screen.x + (coordinate_numbers[i].radius * defect),position_on_screen.y + (coordinate_numbers[i].height * 2 * defect * level.pixelstretch), "+");
Screen.drawText(smallfont, Font.CR_White, position_on_screen.x - (coordinate_numbers[i].radius * defect),position_on_screen.y + (coordinate_numbers[i].height * 2 * defect * level.pixelstretch), "+");

Will that work or am I just adding bandaids?
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 » Wed Jun 27, 2018 5:15 am

I dont know. Magic is a magic because I dont know whats going on there.
For me, with "default" numbers, it works fine. Only with boss monsters, large I mean, frame from + too stretched.

I do so because I thought that it can work using laws/theorems/axioms of similar triangles (or how it named in english?) like at picture
HRODA6A4 — копия.png

and it works for my sreen resolution, my fov, my aspect ratio, my etc.

Looks like gzdoom project scene to/on spherical surface, which represent screen, not to/on flat. Try set fov to 180 and see what I says.
I try add some amendment for transforming it to spherical coordinates.

But if I fail, I just found all 8 vertices of actor bounding box, which means "execute all code in "for(int i = 0; i < coordinate_numbers.size(); i++)" brackets 8 times", and then find points on a screen which can be ignored since it inside of "actor on screen area" rectangle of bigger size. But for this CPU dont say "thanks for optimizations".
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

Re: Fill Spectre v3

Postby Pixel Eater » Wed Jun 27, 2018 5:40 am

Apeirogon wrote:But for this CPU dont say "thanks for optimizations".
I'm not sure what will happen when there are multiple Spectre 'hotspots' happening (even overlapping) and the shader must distinguish them apart. That could get messy, performance-wise :(
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.1

Postby doomfiend » Wed Jun 27, 2018 9:38 pm

Would it be possible if a spectre was behind a fillspectre it would be invisible? It could help with CPU work load and not make a mess of things? If I knew how to help / understand code I would totally experiment around with some theories lol
User avatar
doomfiend
 
Joined: 27 Aug 2006
Location: some where

Re: Fill Spectre v3.1

Postby Pixel Eater » Wed Jun 27, 2018 11:13 pm

Drawing the Spectre behind isn't too much of an issue and could eventually be increased up to around Five in a row (RetroSpectre already has this) thanks to Rachael's scary-good "alpha extractiony" technique. But what I'm worried will hurt is sending unpredictable numbers of hitbox datapoints to the shader which may need lots of logic (shader Kryptonite) to decide whether it's made a "hit". And to make it more confusing the boxes will be skewed by perspective. I am hoping it's something that can be overcome, because I like where Apeirogon is taking this :)

Feel free to share any theories you have, I promise I won't steal them :wink:
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.1

Postby Apeirogon » Thu Jun 28, 2018 9:14 am

what will happen when there are multiple Spectre 'hotspots' happening (even overlapping)

All points will be calculated in one pass of "for(every monster in array)" block, and only the send it to shader.
If rectangle overlap each other it only means that shader apply two/three/sixteen times to that screen area.

What happens next I dont know, its from the field of shader knowledge.



I think thatll be the last version. Only need to test on PC from a grim darkness of a past, how it handle with this.
shader test Ъ.zip
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

Re: Fill Spectre v3.1

Postby Pixel Eater » Thu Jun 28, 2018 9:24 pm

Thanks Apeirogon! I've combined the shader into the main project and made a little progress, though it's rough :?
You do not have the required permissions to view the files attached to this post.
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.1

Postby Apeirogon » Fri Jun 29, 2018 2:05 am

Spectre, when chase player, crawls out of the "shader frame"!? This is because of gzdoom interpolations. Summon spectre, type in consol i_timescale 0.1 and look. But firstly add to player enter event something like
Code: Select allExpand view
players[ consoleplayer ].mo.speed *= 5;

so you can move more freely.
Actor, as game object, move more like "instantly warping from current position to another", and its new position "shader frame" almost instantly(~0.1 miliseconds) calculated in render overlay. But to make illusion that actor move normal, as IRL, gzdoom interpolate sprite position betweeen this two, previous and current, positions.
Here, or change gzdoom from within, or increase frame size.

If you mean "if I very fast move mouse "shader frame" dont fit to spectre position" I need in some way take into account camera slope/pitch change in between calculation of frame vertex.


Also, shader apply only to one spectre, even if there are more than one spectre on a screen.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Fri Jun 29, 2018 2:43 am

Apeirogon wrote:Summon spectre, type in consol i_timescale 0.1 and look. But firstly add to player enter event something like
Code: Select allExpand view
players[ consoleplayer ].mo.speed *= 5;

so you can move more freely.

Well that's trippy!

Could it be due to the 'doeffect()' in 'check_owner_fov'? I think that works in ticks...
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.1

Postby Apeirogon » Fri Jun 29, 2018 2:49 am

No, actor act, and move, every tick. Interpolations happens outside of game ticks.
I dont know how check sprite movement, in gzdoom, without chroma key. Because for game sprite just a picture bound to actor. Well, technically not exactly, but in zscript it is so.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Fri Jun 29, 2018 8:51 am

nochroma.jpg
NO CHROMA!
You do not have the required permissions to view the files attached to this post.
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.1

Postby Apeirogon » Fri Jun 29, 2018 9:21 am

My respect :thumb:

Also, lens effect inside frame was planned?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Fri Jun 29, 2018 9:44 am

Not planned but I wasn't aiming for perfection yet. This was the third try- 1st was upside down, 2nd was the last state's first frame. It's going to take a lot more work to accomplish but it's only possible thanks to your efforts :3:
I suspect it will still need chroma keying in the background for when the sprite gets eclipsed, but it shouldn't interfere much I don't think.
Another pic:
nochroma2.jpg

Here's the lookup table/sprite sheet:
sprite_lut.png

By telling the shader the Spectre's state and it's angle relative to the player's then it should be easy to animate it :D
You do not have the required permissions to view the files attached to this post.
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.1

Postby Apeirogon » Fri Jun 29, 2018 10:31 am

About angle...
UI restrictions dont allow to run deltaangle function, to find angle relative to the player, inside of it.
Use this this
Code: Select allExpand view
firstly find angle of player and angle of monster;

double result_angle = angle of player - angle of monster;

if(result_angle > 360)
{do{result_angle -= 360;}
while(result_angle > 360)
}

if(result_angle > 180)
{result_angle-=360;}


This return angle of monster relative to player in range from -180 to 180.



And about "eclipse". How do you imagine to self how it should work? Algorithm I mean. If some wall or othe actor sprite overlaps specter sprite it should...?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Fri Jun 29, 2018 4:57 pm

Cheers, I'll give that angle code a go when I next can :)

To handle the foreground overlapping I'll use the simpler chroma keying method from RetroSpectre. I'm hoping to use it only as an overlap test so that it doesn't have an impact on rendering. That is just a theory though and I won't know for sure until I can test it :ninja:
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.

PreviousNext

Return to Shaders

Who is online

Users browsing this forum: No registered users and 0 guests