3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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 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 : 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!
|
|
|
Re: "linked portal door"
[Re: 3run]
#457354
01/14/16 20:49
01/14/16 20:49
|
Joined: Feb 2012
Posts: 371
Dico
Senior Member
|
Senior Member
Joined: Feb 2012
Posts: 371
|
Haha this is my problem too , but with right angles and position this is another image link : http://i.imgur.com/3CJkwwE.jpg
|
|
|
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
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Nice video, it shows exactly what I'm trying to come up with instead of current 'flat' views Ohhh noooo, my eyes 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 Best regards!
|
|
|
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
Serious User
|
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
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
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 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: 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 ). 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. Take a look at this. As the video describtion says: 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 ): Download link
|
|
|
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
Serious User
|
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___________
outTex = outPos.xy / outPos.z;
if I am not wrong...
Last edited by txesmi; 01/14/16 22:34.
|
|
|
|