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.

AppGameKit Studio Chat / Field of view

Author
Message
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 19th Jul 2021 13:54 Edited at: 19th Jul 2021 13:56
I am experimenting with a 2d game where the field of view around a centered sprite changes. One way to do this would be to cover the entire screen with a sprite that contains a transparent part but I wonder if there are a better and more flexible way? Preferable the effect would be animated with some flickering.
Sincerely,
Max Tillberg

Attachments

Login to view attachments
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 21st Jul 2021 19:19
That looks like the job of a full screen shader.
Not my realm of expertise I'm afraid.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 24th Jul 2021 10:28
Is your game Tile based by anny chance that makes a fog of war effect much easier ?
Or do you just need a fancy(pixelated) vignette ?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 24th Jul 2021 14:44
@Janbo, you ever get round to that 2D shader pack?

There has been a £20 note in my wallet marked '2D Shaders" for the last 2 years, if you build it, they will come
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 25th Jul 2021 12:25 Edited at: 25th Jul 2021 12:25
[Offtopic]
@PartTimeCoder:
Well yeah there is something like a 2D shader Pack in my Project folder, but there is one pice missing which is an SetSpriteShaderConstantByName command to individually set uniforms to sprite shaders.
Ofcourse there are tricks to work around it, but tried to somehow get the comand impelemnted into Tier 1 first, which doesn't seem to happen anymore
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 25th Jul 2021 15:32
OH, yeah I remember now, maybe we need to petition TGC for the function you need, after all its a DLC waiting to happen I don't understand the heel dragging.

[Back on Topic]
Fog of War, even on its own its a staple of every RTS ever made, we could certainly use a shader solution for that.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 25th Jul 2021 15:42
Quote: "but there is one pice missing which is an SetSpriteShaderConstantByName command to individually set uniforms to sprite shaders."


SetShaderConstantByName works with sprite shaders doesn't it?
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 28th Jul 2021 11:33
The game is not tile based, that would help. I tried to use 5 sprites to create this effect but it requiers quite a lot of code and it does not scale very well. I want a pixel look and the pixel size is affected by the size of the view size. I also tried to use particles but that did not turn out well. I guess a shader would be the best solution but I have no idea how to do this.
Sincerely,
Max Tillberg

Login to post a reply

Server time is: 2024-04-25 21:31:42
Your offset time is: 2024-04-25 21:31:42