Skybox Textures

0 views
Skip to first unread message

Cecila Dammrich

unread,
Aug 4, 2024, 6:26:43 PM8/4/24
to bidpoisynca
Onceupon a time... I collected 38 Elyvision skyboxes, corrected their texture names to be BJS-ready... put bottoms on the skyboxes that didn't have bottoms... and packed-up all 38 with a demo viewer... into THIS zip. _tour.zip

Note: Skyboxes without bottom textures - 5-texture skyboxes... expect the programmer to use a "ground" as the bottom texture. ie. No need for bottom texture when there is a floor/ground in the scene. BUT, BabylonJS cubeMaps need a 6th texture (negativeY/_ny)... so, I had to "make" some.


Yeah! Be patient as you tour with [ and ] keys. Textures take time to load. G-button toggles ground, M-button toggles model, R-button for reset. Skybox1 is possibly a non-Elyvision skybox. Not sure. "Skybox1" is the first skybox used in a BJS scene, EVER, I believe. It is available in our playground, too. I think 3 Elyvision skyboxes are playground-reachable, as well.


@Deltakosh only gets 100 emails a day from adoring female fans? Blimey old chap, you're slacking!!! I get at least 500 a day from Russian women who are apparently desperate to meet up with me ? heck, even some who are distant relatives and can send me a whole heap of cash for a small investment ? haha


I have a problem with a texture of a skybox made in webgl using babylonjs.My whole project is on the webserver and everything seemd to be good written but the box which should be a skybox doesn't show the texture - black outside and inside


Hi guys, so I was looking for some skybox textures, but no luck finding the right ones, what I'm looking for is a sky with clouds - even though I don't know anymore how to make that, I had an example WAD if anyone has it, it was with a night city I think, anyways, what I'm looking for:



Daylight sky, 3-ways: one side should be a city in a distance, best if on hills, other 2 sides should be mountains connected to the "city" and third one should be blank sky (sea side) if anyone could help me somehow I would be really grateful (will post WIP wad if I make "playable" advancement)


@Vinc3r @Evgeni_Popov thank you very much for your help, what you both suggest works and it works well. I have however an odd issue. In my code depending on the value of a state variable I want to switch the skybox texture to a different texture or to a solid color, like this:


This does not happen if that texture is the first original one of the project. It happens when switching from a texture to a different texture. Do I have to do something extra for the new texture to be applied correctly in the skybox?


@Vinc3r the textures are the standard ones that come with the playground, not created by me, so obviously they are good textures as they are provided by babylon.js

regarding the wrapU&V to be in clamp mode, so you mean to do something like this?

texture.wrapU=0

will give it a try thank you


@Evgeni_Popov thank you very much Evgeni, its odd, works great yes in the playground you sent, but fails for me, probably because in my app im doing quite a few more things around that, its a large react app so its diffficult for me to extract the relevant stuff to a playground mmm, i will try to identify what other stuff could be interfering with it, thank you very much again


@Evgeni_Popov very odd basically what happens is that when switching to a different texture, in my case the 6 parts of the texture appear in the wrong positions, the bottom appears up and the up bottom for example


If your environment is setup in Maya (say, using the builtin sky shader mapped to the inside of a sphere...I think thats the right name, but there is an enviro shader that lets you set sky colors, clouds, ground textures, sun position, etc), you could place six cameras at the world origin facing out to the six directions and render a still image from each cam.


On the iPhone, this only uses 1 draw call instead of 6. While this isn't as much of a concern on other platforms, it is still a waste of draw calls, especially if you have reflections, etc, that value can be multiplied.


You can use premade sky textures right out of the box, and it is trivial to make your own. Plus polar distortion is typically not very noticeable. (unless of course the poles feature prominently, but a solid color at the top 10% of the texture can eliminate any noticeable distortion.)


I've already found these and we implemented a quick skysphere instead of a skybox. But after testing we found out that the 2048x1024 resolution image was too low-res for our application, and we can't use the higher resolution version because of GPU limitations (we're developing this for a specific platform).


It's not "easy" to use, but it's "not difficult" either, and there is some tutorials on how to "navigate" into Celestia if you need some help. You can use scripts to manipulate the camera and capture images.


It is probably not the "easier" way to get what you want, but this way it will be exactly what you want because you can set lots of options. It is maybe not enough realistic tough but I think it could be ok.


What happens is that the skybox textures are upside down and switched. I'm using code from tutorials and searched everywhere what might cause this and maybe it is a silly thing. Ok I can just flip the actual textures and pass them in a different order, but that shouldn't be happening.


Call in main loop, where proj_mat is the regular perspective matrix, and vmat is the camera view matrix that will be stripped out of translation in the shader (it doesn't matter if i try to do different things here, like regenerating only the rotation matrices, skybox sides still upside down and some switched)


Be careful on how cubemap uses coordinate system. It is left handed. See here: _Texture#Upload_and_orientation So if your view matrix is right handed, then it will render wrong. Either use separate texcoords attribute that you can specify independently from vertex coords. Or flip the coordinate system in shader, by negating Z component if I'm not mistaken: texcoords = vec3(vPoints.xy, -vPoints.z);


The solution you suggested didn't work, it didn't perform any changes, which is weird, the shader should at least switch back to front and flip left and right horizontally, up and down vertically, but nothing.


I also just created a conversion from right-handed sys to lhs and I cannot just apply that to the projection matrix. I've followed the conversion matrix as here: -a-matrix-from-right-handed-to-left-handed-coordinate-system


If all those changes you do "does not change anything at all" then you're doing something wrong. Like editing wrong source code, running old exe or similar. Double check what exactly are you modifying.


To debug coordinate orientation problems I usually do structured art - create textures where I draw axis in directions I expect them to be. Put a text where top or bottom should be (literally text "top" or "bottom" and similar). Use images in OpenGL wiki link I gave as reference. Then draw using these images & debug values for known locations (like corner of texture) to see if they come up as expected. Use RenderDoc for that - to verify values in each stage of pipeline.


It depends, if you have zoom for weapons or similar implemented via fov changes you could have fov down to 20 degree, than you want to make sure, that 20% of the skybox are still fullhd (or whatever is targeted)


Current state of the art is micro texture. 64 pixels in view, get the game to upscale it. I can generate one, but symphony has a great example on vault discord. Also the benefit of no anti-dithering (to fix compression artifacts/banding) or color depth probs to deal with as well. Should be able to get 5000 skyboxes in the disk space of one stock cube map


I'm new to Enscape and I've been testing its features for now, and I got stuck with skyboxes: there's this drone panorama we took, it works great, except I can't make the skybox dark when I change the time in Enscape. Is there any way to make it get dark at night? Or will I have to take 2 panoramas and change then?


Hi comcasa , you can darken your custom Skybox through activating "Normalize brightness" in the same Atmosphere tab settings and afterward, move the "Brightness" slider to the left. If you want to have a night sky in your project though, you'll have to use a dedicated panorama which you took at night, or make use of our Horizon presets which still utilize our Enscape sky.


Using our Enscape sky in your own custom Skybox, would require a Transparency Map for your Skybox or generally a Transparent Skybox. You could separate things like mountains and buildings from the sky beforehand and keep our dynamic sky.


Navigate into your Enscape folder, by default "C:\Program Files\Enscape", but you might've also used a custom Destination Folder path in the installation process so the directory might differ.


While in the Enscape folder, head into -> "\SystemData\Textures\Horizons" to either just add your own skybox with a transparent sky as .png file, or otherwise you can also replace one of the horizon .png presets with your own file and use the same name (like Town.png), otherwise you'll end up with a custom preset which includes the directory path in the name:


I've tried shifting the "Normalize Brightness", and my preview window will look fine in all directions, but the panorama rendering will change the light output. For example, in some of my views (like the attached) the panorama will be overly lit, but in the same room, but a different location, the room is so under lit it looks like none of the ambient lighting is producing light.


Hey dobrodrummer , in this case, please disable the "Automatic Exposure" functionality in the General tab of your Enscape Settings and define your Exposure Brightness manually. Doing that should help with this behavior at hand.


we used such techniques a long time ago. The method was simple. a different scene than the environment was rendered to the viewport

the first pass rendered the scene first and then rendered the level. and it was visually the same as a cubemap. It was faster, of course.

3a8082e126
Reply all
Reply to author
Forward
0 new messages