I've been looking all over for the name of this game that I saw some time ago. Gateways. Randomly just remembered the name, just like that. :'D
Anyways, there's a cool effect when you make a portal in the game. You can see a view of what's in the portal even though this is a 2D game.
Here is an image:
Can this effect be acheived in Love2D and how?!?
[HELP] How to do this portal view effect??
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[HELP] How to do this portal view effect??
I like to draw and program
Re: [HELP] How to do this portal view effect??
I cant help you but i can say that this is achivable because mari0 aleardy done this.
Twitter: https://twitter.com/Murii5
Re: [HELP] How to do this portal view effect??
my guess would be canvases + stencils + math
Re: [HELP] How to do this portal view effect??
Xgoff wrote:my guess would be canvases + stencils + math
What is a stencil?
I like to draw and program
Re: [HELP] How to do this portal view effect??
https://www.love2d.org/wiki/love.graphics.newStencilXHH wrote:Xgoff wrote:my guess would be canvases + stencils + math
What is a stencil?
Re: [HELP] How to do this portal view effect??
Ok but that doesn't quite explain what a stencil is and how it can be used for something like this.
I like to draw and program
Re: [HELP] How to do this portal view effect??
You would use it as a mask for the rendering.XHH wrote:Ok but that doesn't quite explain what a stencil is and how it can be used for something like this.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [HELP] How to do this portal view effect??
It's very complicated. But in simple terms, the stencil masks the drawing area and you'd have to draw everything that's supposed to be in the portal view as well as everything else that's in the camera view. Plus all the math of figuring out where the portal is and should be showing.
Re: [HELP] How to do this portal view effect??
You'd need to check if there are any portals that they player could see through.
Then you'd have to calculate all the angles for those lines on either side of the portal opening based on the angle between your character and the portal edges.
Then you'd have to create a stencil based on the where those lines are and stuff, so you can draw only to the parts of the screen that are "inside the portal".
Then you'd need to figure out how to draw what your character is supposed to see when he looks through the portal. Figuring this part out and actually drawing it is probably a real pain in the ass.
Then you'd have to calculate all the angles for those lines on either side of the portal opening based on the angle between your character and the portal edges.
Then you'd have to create a stencil based on the where those lines are and stuff, so you can draw only to the parts of the screen that are "inside the portal".
Then you'd need to figure out how to draw what your character is supposed to see when he looks through the portal. Figuring this part out and actually drawing it is probably a real pain in the ass.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [HELP] How to do this portal view effect??
Especially if you have the portals facing each other so you see yourself in both and you end up with a recursion loop where it's just mirrored you's over and over. Like when you point a video camera at a monitor that's displaying what the video camera sees.
Who is online
Users browsing this forum: No registered users and 5 guests