Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / how to use mutliple fullscreen shaders?

Author
Message
krid
9
Years of Service
User Offline
Joined: 2nd Dec 2014
Location: Almaty / Kazakhstan
Posted: 5th Mar 2019 06:58
Can we do it using only AppGameKit functions? (without shader modification)
I need to apply one shader on top of render result of another shader.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 5th Mar 2019 07:07
Us a quad object. They use that technique in the "Bloom" example in
\Program Files (x86)\The Game Creators\AGK2\Projects\Shaders\Bloom
krid
9
Years of Service
User Offline
Joined: 2nd Dec 2014
Location: Almaty / Kazakhstan
Posted: 5th Mar 2019 07:25
I already use quad obj, but i dont know where exactly and how I can mix it all together.
If I set two shaders to one object it doesnt mix its result, only last shader is in effect.
I'll check this example too
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 5th Mar 2019 07:53 Edited at: 5th Mar 2019 07:53
Yeah. Check the example
krid
9
Years of Service
User Offline
Joined: 2nd Dec 2014
Location: Almaty / Kazakhstan
Posted: 6th Mar 2019 09:33
Ok, I get it how it done.
Now I have following question:
Is there any difference to render result on image that assigned to sprite or image that assigned to quad?
(Except quad can use only fullscreen shaders)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Mar 2019 19:24
I think the quad is for full screen. i'm not sure there is any other difference
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Mar 2019 11:28 Edited at: 7th Mar 2019 13:51
Yes you can render to an image and asign it to a quad or a sprite which is streched to the window size.
It's prety much the same, sprites are made of 4 vertices too (nowadays) like the quad object.
The Quad fits the screen by default.
The biggest difference is the shader used to render them and maybe there is a bit more memory allocated for sprites but thats a guess and probably not a reason to prefer one over the other.
[Edit]I correct myself as I just looked into the source code, so a quad is made out of 6 vertices and a sprite is made out of 4 vertices as a triangle strip[Edit]
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 8th Mar 2019 03:25 Edited at: 8th Mar 2019 03:26
you could use two full screen sprites


ideally if you want to mix them you would use a 3dr shader that would mix the images of the first two
but that would chew performance and would be better if you used just one shader that created the one effect
fubar

Login to post a reply

Server time is: 2024-11-21 13:31:46
Your offset time is: 2024-11-21 13:31:46