Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, Ayumi, PeWi, Quad, VoroneTZ), 513 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: "linked portal door" [Re: Dico] #457353
01/14/16 20:14
01/14/16 20:14
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Dico
i like portale style games , this method i tried to create it before but i stuck in views , i do all calculation for the mouvement exept the views i get problem in it .
i think the view need special shader smirk

This is what i did before :


so the camera portal 1 it move and rotate a l aid of player view .

i ask Rackscha before about the method and this what he say :
Originally Posted By: Rackscha
visual:
cameras are not rendered on a entity texture. entity renders a special color into the buffer for a screenshader to replace these pixels with the camera

the camera needs to keep an eye on the player and stay on the same line as the portal. so it moves along it.

and it is required to translate a relative point from one portal to another. which means making a position relative to a portal, rotating it back, then rotating it by the other portal and making it absolut again. Sabe goes for rotations


Hi Dico!

Unfortunately, screen you've posted doesn't show up :<
About shaders and what Rackscha said, I guess using shaders will be faster plus it does that 'cut-off' effect. I've done it differently (cause I'm not familiar with shaders) and just rendered view directly on the texture of the portal model (and I guess this is one of the worst ways to do this). Anyway, I'm still stuck and breaking my brain on how to add player's position/angles into the portal view, so it does look like a whole into the other room (f.e.) not like a flat TV.

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: "linked portal door" [Re: 3run] #457354
01/14/16 20:49
01/14/16 20:49
Joined: Feb 2012
Posts: 371
Dico Offline
Senior Member
Dico  Offline
Senior Member

Joined: Feb 2012
Posts: 371
Haha this is my problem too , but with right angles and position
Originally Posted By: 3run
like a flat TV.


this is another image link : http://i.imgur.com/3CJkwwE.jpg

Re: "linked portal door" [Re: Dico] #457355
01/14/16 20:53
01/14/16 20:53
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Now I see it. Well one of my main problem is, that I can't pick right words for search for those calculation things. I'm pretty sure there are some kind of a tutorials with basic calculations/algorithms etc.

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: "linked portal door" [Re: 3run] #457356
01/14/16 21:11
01/14/16 21:11
Joined: Feb 2012
Posts: 371
Dico Offline
Senior Member
Dico  Offline
Senior Member

Joined: Feb 2012
Posts: 371
I get the idea from this video : https://www.youtube.com/watch?v=51BSdESAMwM
so you can calcule the portal cam movement from player cam view.

Re: "linked portal door" [Re: 3run] #457357
01/14/16 21:18
01/14/16 21:18
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Maybe this will help (note: these links will take you to our nemesis, you have been warned tongue ):

http://answers.unity3d.com/questions/39509/portal-2-how-to-make-a-portal-in-unity-3d.html
http://answers.unity3d.com/questions/455799/is-it-posable-to-make-a-gun-shoot-a-portal.html

Quote:
add player's position/angles into the portal view, so it does look like a whole into the other room (f.e.) not like a flat TV.
, the answer here is probably shaders. You may also try changing the VIEW's arc to 'warp' your flatscreen TV (perhaps also try aspect).

PS: just some random silly idea that popped up in my head, perhaps create a dummy entity for that you see in the portal but render it behind your player.

Last edited by Reconnoiter; 01/14/16 21:22.
Re: "linked portal door" [Re: Reconnoiter] #457359
01/14/16 21:22
01/14/16 21:22
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Dico
I get the idea from this video : https://www.youtube.com/watch?v=51BSdESAMwM
so you can calcule the portal cam movement from player cam view.
Nice video, it shows exactly what I'm trying to come up with instead of current 'flat' views grin

Originally Posted By: Reconnoiter
Ohhh noooo, my eyes shocked
Originally Posted By: Reconnoiter
Quote:
add player's position/angles into the portal view, so it does look like a whole into the other room (f.e.) not like a flat TV.
, the answer here is probably shaders. You may also try changing the VIEW's arc to 'warp' your flatscreen TV (perhaps also try aspect).
Changing arc etc won't really help in my situation (sure they will need to be tweaked at the end, but the problem is that I need to add camera's positions/angles on the top of the view positions/angles (the view, which is rendered on the texture of the portal). At least this is what I think I need to do, but I just can't get the math part smirk


Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: "linked portal door" [Re: 3run] #457360
01/14/16 21:35
01/14/16 21:35
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Can't your rotate the portal's VIEW with the player's camera? Perhaps deforming/changing its shape so it doesn't look like you rotate the VIEW with the player? (just a wild quess)

ps: doesn't unreal 1 (not UT 1, but unreal) has also 'real' portals? Not does it matter much, but perhaps it can give you ideas.

Last edited by Reconnoiter; 01/14/16 21:37.
Re: "linked portal door" [Re: Reconnoiter] #457361
01/14/16 21:42
01/14/16 21:42
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Reconnoiter
Can't your rotate the portal's VIEW with the player's camera? Perhaps deforming/changing its shape so it doesn't look like you rotate the VIEW with the player? (just a wild quess)
Sure you can, and I guess that's the key to sucsess grin But the problem is, that simply moving/rotating it won't help. I need some kind of algorithm which will calculate all those rotations/movement stuff automatically. F.e. Uhrwerk said this about rotation:
Quote:
target portal view angle = camera.angle + (see through portal angle - target portal angle)
And I got it to work somehow, but without movement only rotation looks really weird (or maybe it just doesn't work correctly grin ).


Originally Posted By: Reconnoiter
ps: doesn't unreal 1 (not UT 1, but unreal) has also 'real' portals? Not does it matter much, but perhaps it can give you ideas.
Originally Posted By: 3run
Anyway, I found a nice video demostraiting what I want to archive:
World Portals - What's the big deal?
Take a look at this. As the video describtion says:
Quote:
Duke Nukem 3D supported non-euclidean geometry, in 1996.
Maybe Unreal had same non-euclidean geometry support, I don't know unfortunately. Tomorrow I'll make a small research probably, it's too late right now here at my place.


Edit: Here is what I've made so far right now (code is dirty and too many comments I know, just ignore them grin ):
Download link


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: "linked portal door" [Re: 3run] #457362
01/14/16 22:01
01/14/16 22:01
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
I can imagine the way but never did it.

It needs portals as two different models. One looking to +X axe and the other to -X axe, so both models share their orientation in reference to the wall. First portal is placed looking in front of the wall and the second looking to the wall.

It needs three cameras, one for player and one for each portal. All same render target size and arc. Portal cameras are placed by computing offsets from portals to player, rotating them by portals inverse orientations (in order to get the offsets in object space of each portal), rotating them again by opposite portals orientations and adding opposite portals positions. The process is same for orientations but with angles, you know. As Wjbender stated, portal cameras need a clipping plane to be set so polygons behind portals are not drawn. Look at cameras PORTALCLIP flag, no mysteries. Portal cameras have to be rendered before player camera.

The shader of portals has to calculate the screen space coords of vertex inside vertex shader and sample the render target of their linked camera on pixel shader. I can't find the algorithm right now but it is very simple.

edited___________
Code:
outTex = outPos.xy / outPos.z;


if I am not wrong...

Last edited by txesmi; 01/14/16 22:34.
Re: "linked portal door" [Re: txesmi] #457366
01/15/16 07:24
01/15/16 07:24
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
I found an example on unity for the view angles , I am sure someone here can translate the math .

http://answers.unity3d.com/questions/992289/portal-effect-using-render-textures-how-should-i-m.html


Compulsive compiler
Page 2 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1