-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic environment map can only use cube reflection mode #7187
Comments
Just so I understand... |
@mrdoob It seems to me he wants to have a refractive material and use a You can do that by modifying the var material = new THREE.MeshBasicMaterial( { envMap: cubeCamera.renderTarget } );
cubeCamera.renderTarget.mapping = THREE.CubeRefractionMapping; // <=== add this line This is adding a |
Related: Should we rename |
@WestLangley That is exactly what I wanted to do. I know I can achieve what I need by adding an extra property. It just seems to me that this property should be inherent to I am thinking of using static environment map and dynamic environment map in pretty much the same way by passing the reflection/refraction mode and texture type info (spherical/cube) into
|
There is a related design problem here. The format of the environment map has nothing to do with the material properties. Instead of In http://threejs.org/examples/webgl_materials_cubemap.html we load the same texture cube twice because we have both a reflective and refractive material. |
That we'll solve by implementing |
For anyone else wanting to use a cubeCamera to create a refraction envMap, the latest way to do it is:
|
I think this is worth considering, or perhaps even |
I don't think so. That sounds like a method name. |
Fair point. Perhaps |
Closing since the actual question of the OP was answered (see #7187 (comment)). Since the discussion went a bit off-topic, I suggest to open a new issue if there is any interest in renaming
The leading issue for this topic is #17766. |
WebGLProgram is expecting a "mapping" property when generating environment mapping defines, as is seen here:
But "mapping" is only defined in CubeTexture and not on WebGLRenderTargetCube. When using dynamic environment mapping in a fashion similar to the example in the doc,
there is no way to let the shader use the environment map in refraction, except adding an extra property to the WebGLRenderTargetCube.
I am not sure if this is supposed to behave like this. Or should it be more consistent between using the static and dynamic environment map?
The text was updated successfully, but these errors were encountered: