Skybox anchor/non-static skybox viewpoints

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Skybox anchor/non-static skybox viewpoints

Re: Skybox anchor/non-static skybox viewpoints

by Caligari87 » Tue Jul 04, 2017 10:36 am

In the interest of self-defense I wasn't aware this didn't fulfill the OP's request. I considered the same use case for some projects in the past, and the approach I posted would is the exact one I would have used. Now that the limitations of that approach have been clarified I see the need for such a feature.

8-)

Re: Skybox anchor/non-static skybox viewpoints

by Rachael » Tue Jul 04, 2017 2:15 am

Caligari87 wrote:Isn't this already possible by just moving the skybox viewpoint? Granted you'd have to do the math yourself but all the various skybox abuses/tricks I've seen over the years (moving vehicles in particular) makes this sound unnecessary.

http://zdoom.org/files/other_examples/starbox.zip

8-)
This is not an alternative we want.

First of all, such movement only occurs 35 times every second, which is less frequently than the display refreshes.

Secondly, I would like to refresh this post:
Graf Zahl wrote:I wouldn't add this to the first post but it needs to be said here, too:

If you want to suggest a workaround for a requested feature please think first if your workaround meets the suggester's needs. I have seen it too many times that some people post stuff that completely ignores the original post's motivation or suggests some laborious things that would be more an annoyance than anything else to do repeatedly. Often these things come equipped with the word 'just' as if it was the most normal thing to do repeated cumbersome routines.

Such posts tend to create tension because the OP might feel ignored on purpose by that. Here's a good example of this kind of behavior which I really don't want to see anymore on the Feature Suggestions forum.

Re: Skybox anchor/non-static skybox viewpoints

by Shadow Hog » Tue Jul 04, 2017 1:32 am

Unfortunately not. Though I'll concede I didn't know you could move a SkyboxViewpoint in the middle of a stage (news to me!), there's a few problems with that approach:
  • Since there's only one SkyboxViewpoint available to be moved, the parallax is only gonna look correct for one player; Lord knows what that'll look like for the rest of the players. Adding more SkyboxViewpoints won't help, because sectors can only be displaying one viewpoint at a time, and that will apply to all players. This also extends to any Camera objects or CameraTextures.
  • There is no interpolation for moving the SkyboxViewpoint in this fashion - at least, not the way I attempted to do it (via ACS and SetActorPosition) - so it doesn't exactly feel like it's moving 100% with you, even though it is.
  • For that matter, this doesn't take things like movebob into consideration, either, which I imagine a proper solution would have to.
You're welcome to play with the proof of concept I quickly whipped up on seeing your own link there here; if nothing else, it'll sort of give you an idea of what it is I'm shooting for, if in a rather half-baked state. Source ACS should be included as well (I mean, assuming it's included automatically; I certainly didn't actively remove it...).

Re: Skybox anchor/non-static skybox viewpoints

by Caligari87 » Mon Jul 03, 2017 11:36 pm

Isn't this already possible by just moving the skybox viewpoint? Granted you'd have to do the math yourself but all the various skybox abuses/tricks I've seen over the years (moving vehicles in particular) makes this sound unnecessary.

http://zdoom.org/files/other_examples/starbox.zip

8-)

Re: Skybox anchor/non-static skybox viewpoints

by nazakomu » Mon Jul 03, 2017 9:14 pm

Rachael wrote:But yeah - this is something I've wanted as well.
I second this; it would come in very handy for a map where you can run into a different sector that has an entirely new skybox – which would be quite a sight to see!

But that aside, this is a great idea for anybody who has crazy ideas that utilize different skyboxes in one map! :D

Re: Skybox anchor/non-static skybox viewpoints

by Rachael » Mon Jul 03, 2017 5:41 pm

This sounds doable, and I've wanted to do this too, but unfortunately the implementation is a bit more complicated than it sounds algorithmicly. The main reason is - the code as it is makes a lot of assumptions about things and would have to be changed and adapted to it (or refactored).

But yeah - this is something I've wanted as well.

Skybox anchor/non-static skybox viewpoints

by Shadow Hog » Mon Jul 03, 2017 5:39 pm

One thing that's sort of annoyed me about ZDoom's otherwise really-nifty skybox implementation (where you make 3D level geometry that appears everywhere there's sky visible in the map, not to be confused with OpenGL skyboxes) is that they're completely and utterly static; no matter how you're moving in a map, they appear to be infinitely far away and do not move along with the non-sky level geometry in any convincing fashion. I'd like to change that to something a bit more like the Source Engine's implementation (or SRB2's, if you'd rather a more Doom-centric analogy), where there's a bit of parallax to work with.

I've put a bit of thought as to how such a thing could be accomplished without breaking older maps that use the skybox functionality as it currently is. What I'm thinking is there'd be a related Actor to SkyboxViewpoint - SkyboxAnchor, let's call it. It works like so:
  • A map maker creates their skybox outside the main level geometry, and places a SkyboxViewpoint in there, as currently.
  • They then place a SkyboxAnchor inside the actual level's geometry where they'd want that skybox's parallax to be centered around.
  • Next, they tie the newly-placed SkyboxAnchor to its corresponding SkyboxViewpoint, presumably either with a matching TID or a Thing argument that'd serve the same purpose (I'm not sure which would be considered preferable, code-wise).
  • After that, they'd put in a Thing argument that specifies the parallax scale - presumably value n in this parameter would translate to a 1/n scale, if only because trying to define the proper decimal values in GZDB tends to truncate it to three decimal places, even though AFAIK UDMF itself supports much larger than that.
After that setup, when rendering the skybox in-game, there would be an offset applied away from the position defined by the relevant SkyboxViewpoint, calculated using the offset between the client's current camera position (whether that's the player's position, the chasecam's position, a security camera that's in current use or whatever's relevant at that particular tic) and the position defined by the corresponding SkyboxAnchor, and scaled according to the SkyboxAnchor's parameter.

As for how this would be backwards compatible, it's pretty simple: if the SkyboxAnchor Thing isn't present, as it wouldn't be for any map using a SkyboxViewpoint prior to this feature, then the current implementation is used as-is, verbatim, with no fuss. The player moves in the level, the skybox doesn't move accordingly. Along that line, the default behavior would presumably be the fallback for these scenarios as well (although appropriate warnings would presumably be raised):
  • The SkyboxAnchor's scale parameter is set to 0 or undefined.
  • More than one SkyboxAnchor is defined for a single SkyboxViewpoint.
To give an example how this could be used in an actual map: you could make a city stage seem larger than it actually is, by placing geometry for buildings into the skybox that'd move along with the player as if they were actually put into the map, even though they're actually in the skybox, out of reach. As it is, if a mapper attempted this, the buildings would be the same distance away from the player no matter where in the map they were looking at the building from. Another example: adding rolling hills outside the boundaries of the map to give the impression of the area around the map rolling off into the horizon (as opposed to just using Line_Horizon for a perfectly flat plane).

Top