We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Cube projection map & lighting

Home Forums General Questions Cube projection map & lighting

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #14022
    Pottsie
    Participant

    Hi!

    I’m actually hoping “elk” will jump on this because they started a great thread regarding environment maps, and I didn’t want to hijack that thread :)

    Wondering if somebody could help me out with some questions I had regarding the subject.

    Is a cube map and equirectangular map essentially the same thing?
    Is the benefit to using a cube map as opposed to an environment map the performance?
    Do cube maps provide the same kind of lighting as a HDRI image (provided it’s the same image)?

    I’m just trying to wrap my head around these concepts as they apply to real-time rendering.

    Thanks in advance!

    Check out my sketch book :) | www.instagram.com/b.potts.art/

    #14025

    Cubemap is odd method to create environemts, now it mostly gone from most of the 3d modelling softwares and stays only in the game engines such as Ubity and Unreal but it’s very difficult to find a tool to create such maps. It’s also difficult to create and hdr cube map to light the scene with it proportly, so it’s better to use equarectangular maps.

    Co-founder and lead graphics specialist at Soft8Soft.

    #14062
    elk
    Customer

    Hi. Thanks for the vote of confidence Pottsie :) . Was “offline” all day today, but looks like Mikhail did a good job of covering the basics, but i thought I elaborate a bit since you mentioned me;

    So to go all the way back, and probably going over some things you may already know, cube maps is like if you take 6 cameras at the same position each pointing along one of the axis of the positive and negative axis with each camera having a square 90 degrees horizontal and vertical field of view, so putting it in the middle of a cube would have each camera covering one side of the cube exactly, and thus covering everything around it in 6 images, usually either as separate images or lined up in a 3×2 image containing all 6 “angles” and projecting that back onto a cube with the normals pointing inwards would then produce a view from inside of the entire environment. This was used in older games to make the map or level seem bigger, especialy for outdoore scenes, hens often being called skyboxes in games. Using just a simple cube for this was a big “quality/performance” win when poligon count used to be a bigger resource eater.

    Equirectangular on the other hand is like wrapping a flatt 2D world map onto a UV sphere. This will then use much more geometry than a simple 6 quad / 12 tri mesh that the cube is made up of, but as computers are more powerful these days, that is not so much of an issues.

    Bothe of these methods, or at least very similar methods, used to be done on actual static meshes in the scenes or levels of a game, making them not only change once you rotate the view but also move with changing position. As the skymap was mostly used to mimic the sky, the scale of the skybox/cubemap would need to be huge to do a good job. As most of us have noticed we need to move quite a distance down on the ground to notice any change in a cloudes actual position, so now moste engines have there own implementation to only project either the cubemap or an equirectangular map as if the camera is always at the center, effectively making the “paralaxing” non existant. Doing this mapping as a first/back-pass and not really needing any mesh to support it also means it can be done more efficiently in most cases.

    With the basics out of the way, both mappings have their advantages, and I will only mention two points here that I see might being of particular interest in our context here;

    As most enviroment maps these days are equirectangular they already have a huge advantadge or being easy to just pop in where you need them, and they are also alot easyer to adjust right in blender without having to go to different software to adjust. Say you got a HDRi and you want the horizont to be higher or lower , you can add a maping node and adjust it to move the horizon higher or lower without much noticable distortion, also rotating it around its Z(for blender) axis in smaler increments is also easyer. On a cube map that is potentialy a lot harder to do without recreating the actual map from a different location or doing som fancy maths on it, atleast if it is not mapped to an actual mesh, but then you have the problem of the scale and “paralaxing” again to make it more “realisic”.

    Cubemaps on the other hand has an advantidge of being a lot more straight forword in a different way. The fact that it is just a straight camera and no distortion I think makes it a better candidate for potential realtime reflections where you could basicaly live project the 6 cameras to the 6 sides of the cube map, and moving the camera “rig” around with an object would recalculate the cubemap on every frame. I think think there is such a camera setup in three js, but i have not done a lot or research on that yet, but my guess here is that this ofcource would be expensive to calculate, doing this with an equirectangular map would be quite a bit more expencive.

    So that is a bit of information, and this is just of the top of my head, so there might be a thing or two not quite acurate, but I think it gets tha point across.

    If anyone else botheres to read this, pleas feel free to correct me if I made some wrong assumptions or inacurate statements here.

    OMG. If i knew this was gonna be this long when i started writing I would not have started writing :wacko: but I hope you find this atlest a little helpefull, lett me know if you need anything clearifyed.

    EDIT: And in regards to the lighting, this is technicly an issue of the image format and not the mapping itself, and it rely comes down to what three js / Verge3D supports of the different implementations of the different mappings avalable, and I have not done the research of what options are actualy avalable at this time. There might be some internal remapping from one map type to the other to i guess.

    #14088
    Pottsie
    Participant

    Elk – this is all great information, thank you!

    Ok, I think I’m getting closer to understand these concepts.

    My main hangup now is when to use an environment map vs. an equirectangular map that is projected onto a sphere, for instance. Let’s just say for the case of an archviz application.

    In your Environment Map Size thread, you mentioned having a “pre rendered” equirectangular map, for performance reasons on mobile. So is an environment map not pre rendered? Or am I not understanding another principle?

    Again, thank you for your insight. Always so helpful! :good:

    Check out my sketch book :) | www.instagram.com/b.potts.art/

    #14089
    elk
    Customer

    Glad you found it helpful :good: What i meant by “pre rendered” is simply that i render my entire scene into equirectangular maps, so instead of having all my geometry for my ArchViz to walk around in I will have a “view” from a couple of pre selected sport to move between, like the 360 photos you would se on facebook or like a 360 video on youtube.

    Something like the “Home Hazard Infographics” app in the gallery, but I would just use a renders from my archViz scenes instead of an equirectangular photo;

    Made with Verge3D

    If you look straight up or down in the app you will se some slight distorition at the “north” and “south pole” so to speak, this is often but not always an effect of an equirectangular mapping, so in similar case a cube map could give better results. Performance vice i think it is not that huge a differens. Equirectangular is mostly the default these days, so would just go with that in most cases.

    Oh, and the reason I am considering using a mesh instead of the environment itself is that I was having trouble with chrome not working properly with hight resolution maps on mobile for the enviroment, but mapping it to a UV sphere made it possible with higher resolution textures.

    #14091
    Pottsie
    Participant

    Ahhh ok, I understand what you’re trying to do now.

    I had to struggle with this but now I’m clear! Good learning experience. Thanks as always!

    Check out my sketch book :) | www.instagram.com/b.potts.art/

    #14092
    elk
    Customer

    No problem. Glad you found it usefull :good:

    #14588
    Philip Fong
    Customer

    I use Cube Map due to the nature of my scenes, the free version of https://www.ptgui.com/ 360 photo stitcher can convert equirectangular photo to Cube map, with option of individual output or in a single file.

    #14602

    https://www.ptgui.com/

    Seems soon it will be the last sowteare that can produce a cubemap :) .

    Co-founder and lead graphics specialist at Soft8Soft.

    #14616
    Philip Fong
    Customer

    There are other software or addon for cube map rendering such as: https://www.blendswap.com/blends/view/83386

    Cubemap Support is here!

    #14653

    There are other software or addon for cube map rendering such as: https://www.blendswap.com/blends/view/83386

    I’ve tried it a long time ago and I’ve found it not so comfortable to work. Anyway cubemap is leaving Blender 2.8, so if EEVEE woudn’t support it in the future then there’s no future for cubemap in Verge3D.

    Co-founder and lead graphics specialist at Soft8Soft.

    #14656
    Philip Fong
    Customer

    Oh, I meant to use a cube model in the scene not in environment projection. I can do wonderful effects with it like swap the image or images. I also read about projecting environment map onto a cube and render into texture, either way, creative products will need greater flexibility.

    #14665

    Oh, I meant to use a cube model in the scene not in environment projection. I can do wonderful effects with it like swap the image or images. I also read about projecting environment map onto a cube and render into texture, either way, creative products will need greater flexibility.

    You mean you just crete a cube around a scene and place a cubemap on it, it may work for some time but can produce some glitches on cube edges.

    Co-founder and lead graphics specialist at Soft8Soft.

    #14670
    Philip Fong
    Customer

    I have an example here: https://s3-ap-southeast-1.amazonaws.com/3d-publication/prototype/butterfly/butterfly.html

    In 10sec, a portal will open, front image swapped.

    #14671

    I have an example here: https://s3-ap-southeast-1.amazonaws.com/3d-publication/prototype/butterfly/butterfly.html

    In 10sec, a portal will open, front image swapped.

    Ok, it’s good. Then it’s ok to use it. No glitches.

    Co-founder and lead graphics specialist at Soft8Soft.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.