OpenBVE
OpenBVE copied to clipboard
[Request] Equirectangular/sphere projection for sky texture in route
when we make a route usually we got some stretching at some part of the sky because AFAIK openbve using cylinder shape for mapping the texture so the part get stretch is the caps of cylinder.
i have tried test it on demo route but the mapping is so weird because is based on cylinder.
so i propose a new equirectangular projection for 360 images.
some way to implement it is :
- implement the projection as is
- add new shape as sphere internally
- using object based background through xml in route (this has bug with clipping when zooming out the camera) and we can't use dynamic background (fade in or out) in xml
what i prefer is number 2, because in my non coder brain is openbve already have cylinder shape why didnt add a sphere ?, a "bruteforce" way (i think) is :
- Take all the vertex data from some sphere object and store it internally.
- Take all the UV coord and also store it internally
- Make a new mode for background command in route such as
TextureBackground(index)
.SkyType 0 is cylinder, 1 is sphere
For dynamic background or using xml a new section also introduced
</SkyType>cylinder/sphere or use number index as above 0/1<SkyType>
here the example using object based background bg.zip