Skip to content

Commit

Permalink
Merge pull request #1221 from pierotofy/shading2
Browse files Browse the repository at this point in the history
Bump mapping, environment maps during texture render
  • Loading branch information
pierotofy authored Aug 9, 2022
2 parents 3f901c0 + 0e3b2bf commit 869d577
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/static/app/js/vendor/MTLLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author angelxuanchang
*/

THREE.MTLLoader = function ( manager ) {
THREE.MTLLoader = function ( manager ) {

THREE.Loader.call( this, manager );

Expand Down Expand Up @@ -373,6 +373,7 @@ THREE.MTLLoader.MaterialCreator.prototype = {
// Diffuse texture map

setMapForType( "map", value );
setMapForType( "bumpMap", "-bm 0.025 " + value);

break;

Expand Down Expand Up @@ -458,7 +459,15 @@ THREE.MTLLoader.MaterialCreator.prototype = {

}

this.materials[ materialName ] = new THREE.MeshBasicMaterial( params );
const loader = new THREE.CubeTextureLoader();
loader.setPath( "/static/app/js/vendor/potree/envmaps/" );

textureCube = loader.load( [ 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg' ] );
textureCube.encoding = THREE.sRGBEncoding;

params.envMap = textureCube;

this.materials[ materialName ] = new THREE.MeshStandardMaterial( params );
return this.materials[ materialName ];

},
Expand Down
Binary file added app/static/app/js/vendor/potree/envmaps/nx.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/app/js/vendor/potree/envmaps/ny.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/app/js/vendor/potree/envmaps/nz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/app/js/vendor/potree/envmaps/px.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/app/js/vendor/potree/envmaps/py.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/app/js/vendor/potree/envmaps/pz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 869d577

Please sign in to comment.