Skip to content

Commit

Permalink
Fixed rest of refractionCube broken pattern. See #6839.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jul 15, 2015
1 parent 622ba6b commit e00dda3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/scenes/js/material.js
Expand Up @@ -105,12 +105,12 @@ var envMaps = (function () {
path + 'pz' + format, path + 'nz' + format
];

var textureCube = THREE.ImageUtils.loadTextureCube( urls, THREE.CubeRefractionMapping );
var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;

var refractionCube = new THREE.Texture( reflectionCube.image, THREE.CubeRefractionMapping );
reflectionCube.format = THREE.RGBFormat;
var refractionCube = THREE.ImageUtils.loadTextureCube( urls );
refractionCube.mapping = THREE.CubeRefractionMapping;
refractionCube.format = THREE.RGBFormat;

return {
none : null,
Expand Down
3 changes: 2 additions & 1 deletion examples/webgl_marchingcubes.html
Expand Up @@ -264,8 +264,9 @@
var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;

var refractionCube = new THREE.Texture( reflectionCube.image, THREE.CubeRefractionMapping );
var refractionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;
refractionCube.mapping = THREE.CubeRefractionMapping;

// toons

Expand Down
1 change: 1 addition & 0 deletions examples/webgl_materials_cubemap.html
Expand Up @@ -110,6 +110,7 @@

var refractionCube = THREE.ImageUtils.loadTextureCube( urls );
refractionCube.mapping = THREE.CubeRefractionMapping;
refractionCube.format = THREE.RGBFormat;

//var cubeMaterial3 = new THREE.MeshPhongMaterial( { color: 0x000000, specular:0xaa0000, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.25 } );
var cubeMaterial3 = new THREE.MeshLambertMaterial( { color: 0xff6600, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.3 } );
Expand Down

5 comments on commit e00dda3

@WestLangley
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, in the webgl_materials_cubemap.html example, renderer.info.memory.textures = 2. Should not it be 1 -- at least in theory?

@mrdoob
Copy link
Owner Author

@mrdoob mrdoob commented on e00dda3 Jul 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But the current approach was hacky. At some point we have to create THREE.Image and we'll be able to cache (and reuse) these.

@WestLangley
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But the current approach was hacky.

Oh, I agree. I am not questioning the code change....

I expected cacheing was working now... maybe only for 2D textures?

@mrdoob
Copy link
Owner Author

@mrdoob mrdoob commented on e00dda3 Jul 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is some cacheing working for xhttp and image requests but it still needs more work.

@WestLangley
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Thank you for the clarification. : - )

Please sign in to comment.