OpenGL Skyboxes - change camera position?

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

Moderators: GZDoom Developers, Raze 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.
Post Reply
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

OpenGL Skyboxes - change camera position?

Post by Enjay »

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?

[wiki]GLDEFS#Skybox_definitions[/wiki]

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?
Diode
Posts: 53
Joined: Mon Feb 29, 2016 2:34 pm

Re: OpenGL Skyboxes - change camera position?

Post by Diode »

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.
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: OpenGL Skyboxes - change camera position?

Post by Enjay »

True, but then you have to construct the skybox in the map and that isn't always desirable or even viable.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OpenGL Skyboxes - change camera position?

Post by Graf Zahl »

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
Tormentor667
Posts: 13533
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: OpenGL Skyboxes - change camera position?

Post by Tormentor667 »

Using my work as bad examples hurts my feelings :(
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: OpenGL Skyboxes - change camera position?

Post by Graf Zahl »

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 2:28 pm, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: OpenGL Skyboxes - change camera position?

Post by Enjay »

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?
Post Reply

Return to “Assets (and other stuff)”