Cube shader Bug?

Hey,

check out this little cube inside a snowy park: https://jsfiddle.net/fo40zarx/5/

now:
scroll down and comment-out the applying of the cubetexture to the objectMaterial.envMap
–> run -> cubeshader background will stop working, everything is black ???

2nd Test:
revert first change, so everything works again, now go to the first line in html and set the three version from r120 to r121
–> run -> cubeshader background will also stop working, but the ???

So Whats wrong here?

Yes I know there is a scene.background… dont want to user for reasons…

Thanks
Philipp

Notice that using the cube shader like this is not recommended. However, you can still get this to work in r121 like so: Cube Shader problem - JSFiddle - Code Playground

You have to make sure that you build the skybox exactly like WebGLBackground and you have to make sure that the skybox is placed at the first place in the render list.

Can you please explain? There are normally always solutions without hacking a custom skybox.

Hi Mugen87,

we use to stretch, squeeze and translate the background a little and combine it with suitable images to let the model appear, standing on the ground… not perfect but better than floating.

You did not use the OnLoad callback but directly set the texture, so thats ok?

Thanks
Philipp

Yes, that should not make a difference. I think the code without callback is just more clear.