File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/dev/core/src/Engines Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1688,11 +1688,13 @@ export class Engine extends ThinEngine {
16881688 * @param texture defines the external texture
16891689 * @returns the babylon internal texture
16901690 */
1691- public wrapWebGLTexture ( texture : WebGLTexture ) : InternalTexture {
1691+ public wrapWebGLTexture ( texture : WebGLTexture , hasMipMaps : boolean = false , samplingMode : number = Constants . TEXTURE_TRILINEAR_SAMPLINGMODE ) : InternalTexture {
16921692 const hardwareTexture = new WebGLHardwareTexture ( texture , this . _gl ) ;
16931693 const internalTexture = new InternalTexture ( this , InternalTextureSource . Unknown , true ) ;
16941694 internalTexture . _hardwareTexture = hardwareTexture ;
16951695 internalTexture . isReady = true ;
1696+ internalTexture . useMipMaps = hasMipMaps ;
1697+ this . updateTextureSamplingMode ( samplingMode , internalTexture ) ;
16961698 return internalTexture ;
16971699 }
16981700
Original file line number Diff line number Diff line change @@ -1781,11 +1781,13 @@ export class NativeEngine extends Engine {
17811781 * @param texture defines the external texture
17821782 * @returns the babylon internal texture
17831783 */
1784- public wrapNativeTexture ( texture : any ) : InternalTexture {
1784+ public wrapNativeTexture ( texture : any , hasMipMaps : boolean = false , samplingMode : number = Constants . TEXTURE_TRILINEAR_SAMPLINGMODE ) : InternalTexture {
17851785 const hardwareTexture = new NativeHardwareTexture ( texture , this . _engine ) ;
17861786 const internalTexture = new InternalTexture ( this , InternalTextureSource . Unknown , true ) ;
17871787 internalTexture . _hardwareTexture = hardwareTexture ;
17881788 internalTexture . isReady = true ;
1789+ internalTexture . useMipMaps = hasMipMaps ;
1790+ this . updateTextureSamplingMode ( samplingMode , internalTexture ) ;
17891791 return internalTexture ;
17901792 }
17911793
You can’t perform that action at this time.
0 commit comments