Carve out sections of an env, which is just being used for scenery

I wanted an environment texture used for a skybox, not a reflection texture. Only a section will ever be seen, like on the outside of a window where you cannot go out, so all of the detail outside can be black.

If you go to sites like poly haven, they have multiple resolutions 1, 2, 4, 8, 16, & 24k. The big ones are massive. If I settled on only needing 2 vertical sides, would the be any savings by clearing out the top, bottom, and other 2 sides? If so, how would it be done?

Sorry to answer my own question. A cube texture is both limited in size and it would not matter if there was any non-black detail.

I just took a really big one & processed it through the texture tools. Basically the same size as a much smaller version. Looks same in BJS too.

I think I need to try some kind of curved screen approach, like

I am not that good with Blender’s UV Editor, but hopefully can make an image appear real. If so, in addition to higher detail, this also has the advantage of a much large, and honestly better selection.

@JCPalmer : How about parts of a hemisphere shape? I used a hemisphere with a texture I converted from an HDRI to a jpg on this example:

Graveyard

The texture out in the distance is on a hemisphere.

Stay safe, gryff :slight_smile:

1 Like

Thanks. So, I could save half the size or more, and have much higher detail. Did you just make a take a sphere, cut it in half & flip the normals?

I am actually using it for the background on a balcony, so I would want to do a vertical chop as opposed to horizontal. If you got close, you could look up or down, but never see the other side.

A quick search of hdri to jpg got me a number of online options. One I have apparently visited before.

I took an 8k hdri (80 mb), down to a jpg of (6.1 mb) from a site named convertio.co. I cropped it then saved a 533 kb jpg / 3156 kb png. The png size is what it will be in gpu. Improvement was dramatic.

I could actually drop down to a smaller hdri (4k) and still get better than an env, which was 4.3 mb.

1 Like

Yes indeed Jeff. Exactly what I did :smiley:

I used this online site to get the jpg :

https://convertio.co/hdr-jpg/

Stay Safe, gryff :slight_smile:

2 Likes

I am using a Blender sphere rather than a BABYLON.MeshBuilder for more control & building a material, with insignificant file size for import. This works really well, especially in a XR headset. The image is backwards when viewed from the inside, but who cares. If it mattered, you could just flip the image.

There is one thing I have yet to resolve in a robust way. That is the part of the picture I want seen from the balcony. I am not particularly wedded to the picture above, but am using that to be consistent. I can rotate the sphere like the earth rotates every day to get the view I want from that dimension. I can also rotate like the seasons, which I definitely need, to avoid looking to high. I cannot rotate both ways at the same time, because things turn all sideways.

Temporarily, I have rotated one way, applied it to the sphere, then rotated the other way & exported. All culling have been turned off, and the sphere’s material was also made 2 sided to show this. The room was originally made out of a cylinder, so you can see the top peaking out. The bottom is very faint.

Think there might be a way less drastic than actually changing the geometry for the first rotation. Any thoughts, anyone? FYI, it is important that I not rotate the “room”.

1 Like

Solved it! Blender to the rescue. There is always a way to get a globe to appear in an orientation you want , of course You just need to rotate in all 3 dimensions. But what are the settings is the tricky part.

You can rotate in Blender putting in numbers for each dim, or you can use the mouse, after pressing ‘R’. If you also press ‘X’, ‘Y’, or ‘Z’, then you are restricted, but the mouse does what you want. If you want to be able to change the image, just load a different one in Blender, get it to where you want it, & see what the 3 values end up at. Use those in your code. Export the sphere @ 0, 0, 0

2 Likes

Or use the node material like this ? I always thought this effect was very interesting
https://www.babylonjs.com/demos/productpage/

2 Likes

I assume you are talking about the animation. I do not know Node Materials, but it appears that the rotation in in only one dimension combined with a move in one dimension.

I am actually just now parenting the sphere to the building, as it is very important where the scene origin is & where that appears in the room. I do not want to move the origin of building geo to make this work, so I am just moving the room.

As this is actually just “fluff”, not going to investigate this, but may be useful for searcher who come across this in the future.

2 Likes