OpenGL Skyboxes - change camera position?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

OpenGL Skyboxes - change camera position?

Postby Enjay » Fri Aug 17, 2018 6:05 am

When messing around with the skyboxes from "Rogue Tropper" I found that most of the skyboxes in that game only have a useful image from half way up the sides of the skybox. From the mid point down, the sides (and bottom) are just one solid colour.

viewtopic.php?f=37&t=61685

Spoiler:


If I was constructing a skybox in a map, I could chose what height I wanted to have the skybox camera. So I was wondering if such a thing was possible in an OpenGL GLDefs-style virtual skybox?

GLDEFS#Skybox_definitions

I'm guessing that it isn't currently possible in GZDoom but I don't know if it would even be technically possible at all. If it was, then perhaps it might be possible to raise/lower the virtual camera, as appropriate, to make such skies more useful. Or maybe it just wouldn't work and moving the camera might distort the projection of the images?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: OpenGL Skyboxes - change camera position?

Postby Diode » Thu Aug 23, 2018 10:32 am

If you use a skybox viewpoint actor you can do whatever the hell you like. And if I were any good at writing shaders, I wouldn't even need that.
Diode
 
Joined: 29 Feb 2016

Re: OpenGL Skyboxes - change camera position?

Postby Enjay » Fri Aug 24, 2018 1:04 pm

True, but then you have to construct the skybox in the map and that isn't always desirable or even viable.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: OpenGL Skyboxes - change camera position?

Postby Graf Zahl » Fri Aug 24, 2018 1:15 pm

Keep in mind that a cubemap is a spherical projection onto the cube's planes with the camera in the center position. Changing the viewpoint inside the box will inevitably reveal its true nature.

If you want to see an example of what happens if the camera is not properly placed in relation to the projected image, check out Tormentor's City of the Damned 2. It has a moon in the skybox but it is perfectly circular in the image but not centered so when viewed with the center-based projection it will just jarringly look off. (This skybox looks to me like the moon was a retroactive addition and not a part of the original rendering.)
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: OpenGL Skyboxes - change camera position?

Postby Tormentor667 » Fri Aug 24, 2018 3:23 pm

Using my work as bad examples hurts my feelings :(
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: OpenGL Skyboxes - change camera position?

Postby Graf Zahl » Fri Aug 24, 2018 3:27 pm

You cannot deny that the moon in there doesn't look right in game, can you? :P
For me it stands as a perfect example of how an incorrectly made cubemap skybox can break the illusion of looking at some real scenery.

I never said that the mod itself is bad - it's still by a wide margin the best horror themed Doom map ever.
Last edited by Graf Zahl on Fri Aug 24, 2018 3:28 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: OpenGL Skyboxes - change camera position?

Postby Enjay » Fri Aug 24, 2018 3:28 pm

Graf Zahl wrote:Keep in mind that a cubemap is a spherical projection onto the cube's planes with the camera in the center position. Changing the viewpoint inside the box will inevitably reveal its true nature...

I guess that answers the very last question in my original post.
Enjay wrote:Or maybe it just wouldn't work and moving the camera might distort the projection of the images?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 1 guest