Pages: [1]
  Print  
Author Topic: 360 degree view  (Read 13116 times)
ker
Ok i've posted twice!


Cakes 0
Posts: 2


« on: September 13, 2012, 06:07:24 AM »

Hi everyone,

Before I get to my topic: I do not ask anyone to do this, I want to implement this myself, I just ask for help as I don't know much about the engine's capabilities and such.
I also do not care about the usefulness of the idea. I have written a small spaceshooter showing the effects and while it is quite mad, I'm sure one can get used to it.
The load it puts on the graphics card is irrelevant, I assume it won't make much of a difference.

Now Cheesy I have always wanted to play a fps while being able to see everything around me. There are many ways to implement a 360 degree view, but outside of raycast renderers or non realtime renderers I have NEVER seen this.
I have looked at several ways to project a whole 3d world on a 2d screen.
Playing around with some math I figured the easiest way would be to dump everything on the graphics card (instead of just everything infront of you) and use a vertex shader to place all triangles "infront" of you so they show up on the viewscreen.
To convert a 3d coordinate of a triangle to a 2d coordinate on the viewscreen the following pseudocode is used:

Code:
distance = magnitude(v);
azimuth = atan2(-v.z, v.x); // assuming -z is forward and x is right
inclination = acos(y/distance); // assuming y is up
screen_x = azimuth/(2*pi)*screen_width + screen_width/4;
screen_y = inclination/(2*pi)*screen_height*2;
// screen_x and screen_y need to be wrapped around screen_width and screen_height
// in case of a vertex shader this can be done by assuming screen_width and screen_height to be 1.0 and therefore simply taking the post comma digits would do the job

I'm assuming OA uses vertex shaders for some objects and default vertex shaders for others, I would need to replace all vertex shaders (actually duplicate all and add the changes and make the game choose from some setting which shaders to use).
I'm also assuming OA has some optimizations that prevent stuff behind the player from being drawn, any clue on how to disable that?

Does anyone know of a reason why the whole thing could be impossible?
Does anyone know specific parts of the engine that will make it really hard for me to implement this?

greetings

/ker
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #1 on: September 13, 2012, 08:27:43 AM »

I'm sorry I can't help you at all at thinking to the algorithm to follow to do such stuff.


Only thing I know is that, in OA 085/088, your field of view (cg_fov) is usually limited to an effective maximum of 140 (I suppose degrees) by a "videoflags" lock (that you can easily disable). If you disable that lock, the effective maximux returns to be the one from Quake 3, 160. Note: if you set an higher number, only your weapon is drawn according to that number... the world continues to be drawn like with 140 or 160.
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Manual/Graphic_options#Field_of_view
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Videoflags

I have no idea about what would happen if you would remove the "max 160" limit (and I don't know if it is placed in engine or gamecode)... Maybe it would work correctly up to 179 or 180 degrees, and then make strange things? Or may work up to 359 degrees? Or even up to 360? I really don't know.
However, you may try to locate that "160" limit in the source code and remove it, recompile and try what happens... If you do it, I'm curious to know the result!  Smiley
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
dbX
Member


Cakes 11
Posts: 199

Shazpaca!


WWW
« Reply #2 on: September 13, 2012, 09:40:35 AM »

Does anyone know of a reason why the whole thing could be impossible?

The 3D rendering API's usually have a limit on the maximum FOV you can use. 160 or so is max I think for OpenGL. To achieve a 360 panoramic display, you can render 4 separate 90 degree scenes and then glue the final image together. I don't know what you would need to do in the engine to achieve this.
Logged

In defeat we learn.
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #3 on: September 13, 2012, 10:32:03 AM »

Quake had the PanQuake and Fisheye Quake mods, which might give you a few clues on how to implement this.

The usual solution for multi monitor installations is what dbX mentioned, render separate scenes and glue them together or just display them on different screens.
One example would be SusiQuake, which IIRC is just multiple instances of Q3 running as spectator with offset viewpos (and thus does not match your plan).

P.S.: FromHell dislikes Fisheye Quake Smiley
Logged

This space is for rent.
ker
Ok i've posted twice!


Cakes 0
Posts: 2


« Reply #4 on: September 13, 2012, 10:36:01 AM »

Quote
The 3D rendering API's usually have a limit on the maximum FOV you can use. 160 or so is max I think for OpenGL. To achieve a 360 panoramic display, you can render 4 separate 90 degree scenes and then glue the final image together. I don't know what you would need to do in the engine to achieve this.
That will most definitely not yield the desired effect (horizontal lines where the images don't actually fit + odd stretching) and would not allow vertical full view.

Quote
I have no idea about what would happen if you would remove the "max 160" limit (and I don't know if it is placed in engine or gamecode)... Maybe it would work correctly up to 179 or 180 degrees, and then make strange things? Or may work up to 359 degrees? Or even up to 360? I really don't know.
no, there's a mathematical issue for 180 degrees or more due to the way the scene is projected onto the viewport


fov does not help at all, it will only cause horrible distortions

Quote
Quake had the PanQuake …
yeeees that is what i want, looks awesome!

nah, susiquake & patching scenes together is crap
PanQuake actually uses the same "algorithm" (it's such a simplistic conversion, it does not qualify as an algorithm) as I do.
I will take a look at that.
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #5 on: September 24, 2012, 01:29:34 AM »

When you will have a working "mod" for testing, let us know...
I'm cursious to try it...  Smiley
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Suicizer
Member
Member
*

Cakes 2
Posts: 402


WWW
« Reply #6 on: January 16, 2013, 05:08:50 AM »

As several other games once had this also (Aardappel's original Cube Engine and even Cube Engine 2: Sauerbraten for while), it certainly should be possible to perform (There is even just an OpenGL/Assembly script for Sauerbraten which has a very similar effect as back in the good ol' fisheye days, yet it can't reach that far as 360 degrees).
Logged

I'm good at everything but can't do anything...
Pages: [1]
  Print  
 
Jump to: