Fill Spectre v3.1

Re: Fill Spectre v3.1

Postby Pixel Eater » Sun Jul 01, 2018 11:45 pm

Alright, I've had a big long go at it and improved some things. Still seems a long way to go though :|

The improvements:
Overall smoother and clearer presentation.
There's some primitive sprite angle changing occuring- I think it needs to be based on relative position though, not angle?
The foreground (including the player sprite) no longer gets reflected in the lensing effect (always did).
The new lensing technique can now allow the Spectre to go behind other objects.
It is compatible with all texture filtering and upscaling options but not multisampling.

The Faults:
The purple sprite should only be enabled for the closest Spectre but is visible for those not being counteracted by the shader.
The lensing only works on the most recently seen Spectre.
No movement interpolation.
The frames don't animate for some reason apart from rotations. -Just figured out why apart from the death sequence.
The death sequence (now animates) but gets squashed by the bounding box.
The perspective is only being approximated by the shader by scaling to it's maximum area.
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 » Mon Jul 02, 2018 5:54 am

Now thats a great step to....step forward :P

I see that all vertices are sent to shader, but it processes only first one. Why?
Found out
Uniforms are so named because they do not change from one execution of a shader program to the next within a particular rendering call.


Shader dont support "for( true or false ) {do while true}" state at all, or it just cant cloak all spectres in sight due how it receive coordinate?
I can force code to store all vectors/coordonate of points into array, but shader cant iterate through array by itself, right!?

If no, maybe it makes sense to create several(dozens) of same shader copy, in every of which script must send coordinate of spectre? Like, shader "spectre1", shader "spectre2", shader "spectre[i]"...
Because this can solve first two "The sins of demon before father-of-all".


After quick view, diagonally, into opengl wiki, I see that shader CAN have array and CAN iterate through it, but looks like zscript cant fill such array with data.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Mon Jul 02, 2018 6:45 am

I swear I have sent an array to a shader once before (pre-release RetroSpectre) but can't for the life of me remember how I did it. It was way too slow due to it's size is all I can remember but should be okay for this. If we could do that it would remove any limits to the maximum number of Spectres too, right? Then a Do/While loop in the shader should do the rest of the work...
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 » Mon Jul 02, 2018 7:07 am

Yes.
But "for(){}" more suitable
for(number = 1, because in opengl arrays begins from 1, not 0; number smaller than size of vertex_array; number +=4)
{apply shader to screen rectangle with coordinate vertex_array[number]/[number+1]/[number+2]/[number+3];}

And what you means by "slow"? FPS drop or what?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Mon Jul 02, 2018 7:31 am

Ah fair enough, I'm not experienced with a lot of coding principles. I mostly use a lot of trial and error.

And what you means by "slow"? FPS drop or what?

Yeah, FPS. I sent the random number array from the 'software' fuzz out of ZScript and into RetroSpectre thinking it would make it faster than running it from inside the shader and got the same drastic slowdown that the actual fuzz gives me. For that reason I drew the array (actually two) into a texture and read from that instead.
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 » Mon Jul 02, 2018 8:18 am

For reference, you can type in console "stat gpu" which can show how much time gpu take to cope with shader.
Also, you can just type "stat" and see list of most commonly used stats. And there is fps stat.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Mon Jul 02, 2018 8:27 am

Oh yeah I use 'stat gpu' heaps :lol:

I've only used the vid_fps version for fps though. I'll try the 'stat' one now! :o
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 Pixel Eater » Fri Jul 06, 2018 10:11 pm

It can't go above eight and doesn't disable the shaders when you switch maps. I did learn how to use string concatenation for it though :mrgreen:
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 » Sat Jul 07, 2018 6:07 am

For some reason this version didnt work in my gzdoom copy. It only show purple spectre and show that shader initialized, with "stat gpu", but thats all.

Also
Code: Select allExpand view
string shadnam = string.Format("FillSpec%i", i);
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Sat Jul 07, 2018 6:20 am

Bizarre, it did that to me at one point too. I thought I'd fixed it though :?

Code: Select allExpand view
string shadnam = string.Format("FillSpec%i", i);
Ah cool, thanks :)

I'm just about finished a sprite shader that will make any sprite compatible by declaring it in GLDefs. Should make the stealth monsters easy.
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 Pixel Eater » Sat Jul 07, 2018 7:24 pm

This one has the new shader to make any sprite work, though I recommend making them greyscale for best results.
I'm hoping that by using String.Format() it fixes the previous bug because I no longer get it :?
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 Pixel Eater » Sat Jul 07, 2018 7:44 pm

Just to take a quote from the other thread:
Pixel Eater wrote:
So, you know what time it is now? Its feature suggestion time!
I have a feature suggestion... suggestion. There may be a better way to make the shader seamless and that is to have the engine send only flagged monsters to a sample texture. The back and foregrounds would need to be pitch black for it to work and the sprite would need to be invisible in the main view. It would put an end to the chroma keying altogether and all it's flaws. I suspect it would be much more complicated for anyone willing to implement the code though...

If that technique were ever to happen then I could do this with the sprites:
Encoded.png

And that would work as my own warped version of a normal map :geek:
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 » Sun Jul 08, 2018 6:19 am

No, still dont work as previous version.
I even comment every zscript string with console.printf(1/2/3/4/...); to check, maybe there are something wrong with it. But no, all numbers prints to console.

Check on shitty intel hd 3000 and geforce gt 540/950/1080.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Fill Spectre v3.1

Postby Pixel Eater » Sun Jul 08, 2018 6:44 am

Aw shoot. What happens when you add 'Enabled' into each shader definition in GLDefs?

For copying and pasting:
Code: Select allExpand view
HardwareShader PostProcess beforebloom
{
   Name "FillSpec0"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec1"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec2"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec3"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec4"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec5"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec6"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}

HardwareShader PostProcess beforebloom
{
   Name "FillSpec7"
   Shader "fillspectre.fp" 330
   Uniform float tolerance
   Uniform float tolerance2
   Uniform float tolerance3
   Uniform float depth
   Uniform float alpha
   Uniform vec2 vertex1
   Uniform vec2 vertex2
   Uniform vec2 vertex3
   Uniform vec2 vertex4
   Enabled
}
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 » Sun Jul 08, 2018 7:23 am

It still dont work.

Even more, if I change render mode to any non-opengl I see gray spectre.
If select opengl render mode I see purple spectre.
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 1 guest