Brightness of a sky dome

Hi,
I am trying to set an environment space . So I just create a Dome by using the sphere geometry by following code

             let dome_material = new THREE.MeshPhysicalMaterial ({
                 map : req_texture("Dom.jpg"),
                 side : THREE.DoubleSide,
                 envMap : hdrCubeRenderTarget.texture
             });
             let dome = new THREE.Mesh( dome_geometry, dome_material);
             scene.add(dome);

Here, the envMap is made from an hdr image by using following code

            let hdrEquirect = new RGBELoader()

                .setDataType( THREE.UnsignedByteType)

                .setPath( 'textures/' )

                .load( 'in.hdr', function ( texture ) {

                    init();

                    animate();

                } );

under init function i am using the below code for getting the envmap from the hdr

               var pmremGenerator = new THREE.PMREMGenerator( renderer );

                hdrCubeRenderTarget = pmremGenerator.fromEquirectangular( hdrEquirect );

                hdrEquirect.dispose();

                pmremGenerator.dispose();

Now the problem is, while doing like this, the outside of the sphere is being bright as much as required. But I need this brightness in the inside of the sphere also. Please refer following images for the output I got.

  1. Outside


2. Inside.

How to get the same brightness of outside for the inside too?

What is your reason for not using Scene.background?

Thanks for your Reply @Mugen87 . That is just for testing to apply the texture for the entire scene. But I think that is not being the matter for my issue. Because I tried that without that line too

Sorry, I don’t understand. Your issue is probably related to double side rendering. When making a skybox with Scene.background, only the back side of the skybox’s mesh is rendered.

@Mugen87. Thanks. But I tried with changing the side like THREE.DoubleSide, THREE.BackSide, THREE.FrontSide . All changes doing the same thing. If I set this as FrontSide then the outer side of the sphere only visible with the high brightness. If I set this as BackSide, then the inner side of the sphere only visible with the same lower brightness as earlier. My question is, why I can’t achieve that much of brightness on the inside wall of the sphere.

This is a bug actually, when rendering double sided the normal isn’t flipped to the viewing side, the normal is only flipped when using front face culling.

This can be fixed by the sign of the dot product of the camera direction and normal. Otherwise you could use MeshBasicMaterial which isn’t affected by lighting.

I’ll open a issue regarding the normal flip.

@Fyrestar. Thanks for your reply. Now what should I do to fix this bug. I tried the MeshBasicMaterial now. But that is having some shade or reflection on the opposite wall within the sphere. Can you please suggest me a way to solve this lighting issue. What should I do now?

Before you do that, please check for existing issues. I believe this was investigated before.

Yes i believe that too, though i’m surprised it’s still there as it’s been couple years ^^

Reflection? Can you post a screenshot?

1 Like

Sure @Fyrestar.

@Fyrestar . are you able to find that reflection like shadow on opposite side ?

Any update on this. Please anyone help me

Any answers please

@jaya_kannan posting 4 times every day feels a bit obnoxious :man_facepalming: It’s not that we don’t want to help you - for what I see nobody really seems to understand what you’re trying to create (why would you need reflections on a skybox? And why use skybox sphere instead of equirectangular mapping on the scene background? Why is your ground lit up from underneath. :man_shrugging:)

Please prepare a clean, readable codepen that shows what you’re doing (and an explanation what it should be doing) - it will be much easier to help you compared to looking at screenshots and code snippets without context.

Oh. Sorry @mjurczyk. Nobody has responded to this, that’s why I was asking like that. Actually, My need is to place a car object on the floor with a perfect environment. To achieve this by doing following things.

  1. Create a dome to prepare a better environment. If I apply normal cube texture to the scene, then the zoom in and zoom out of the object won’t be merged with the background environment. So only I am doing like this.
  2. I am using an hdr image for setting the lighting to avoid adding lights to the scene. If I add ordinary directional, spot, point, ambient lights , that is spoiling the reality of the object. The reflection on the car paints related things also get damaged. So I prefer this hdr method.
  3. I am setting that hdr as envMap for all objects in the scene. To get the lighting and reflection I am using this for the dome , floor and the car object.

But while doing this, the brightness is being as much better on the outside of the dome. But while seeing inside of the wall of the dome, it is being dull. For this question, @Fyrestar suggested me to change the dome material to MeshBasicMaterial. I also accepted and tried that. Then the lighting has improved but there is a small amount of reflection or like the shadow effect is accord on the opposite sides. That have showed in the shared screen recorded video.

This is what the issue faced till now

  1. If you do that with a sphere it won’t be either, that’s not how perspective works and that’s why video games in 90s had such flat, ugly backgrounds. Either build environment using 3D models, shaders, or give up hopes of getting a realistic background by just using a skybox.
  1. Please go outside, look at the sky and ask yourself if it has any reflections on it. If it does, check your eyes.

  2. Fyi, HDR is not the same as a lightmap. And what you’re describing seems to be a lightmap.

  3. You ignored the entire second part of my earlier post (which, also, was the only meaning full part of it.) There’s no point in describing and explaining unless you give us code to look at.

:laughing: :laughing:.
Not like that @mjurczyk . I am safe.

Actually I mean the envMap for given lights for the objects in the scene. I have attached my source code file here. index.html (9.5 KB)