@@ -7,20 +7,29 @@ import { UVTransformProperty } from "../../properties/UVTransformProperty";
77import { TextureTypeNode } from "./BaseTextureNode" ;
88import { Script } from '../../export/Script' ;
99import { TextureColorSpaceProperty } from '../../properties/TextureColorSpaceProperty' ;
10+ import { TextureInterpolationProperty } from '../../properties/TextureInterpolationProperty' ;
11+ import { ComboBoxProperty } from '../../properties/ComboBoxProperty' ;
1012export class ImageTextureNode extends TextureTypeNode {
1113
1214 private imageProp :TextureProperty ;
1315 private uv :UVTransformProperty ;
1416 private extensionPolicy :TextureExtensionProperty ;
1517 private mappingPolicy :TextureMappingModeProperty ;
1618 private colorSpace :TextureColorSpaceProperty ;
19+ private interpolation :TextureInterpolationProperty ;
20+ private useMipmaps :ComboBoxProperty ;
1721
1822 constructor ( ) {
1923 super ( "Image Texture" ,
2024 [
2125 new Vector3Output ( "Color" ) ,
2226 new Vector1Output ( "Alpha" ) . outputProp ( "a" ) ,
2327 new TextureProperty ( ) ,
28+ new ComboBoxProperty ( "generate Mipmaps" , [
29+ [ "true" , "use Mipmaps" ] ,
30+ [ "false" , "Don't use Mipmaps" ]
31+ ] ) ,
32+ new TextureInterpolationProperty ( ) ,
2433 new TextureExtensionProperty ( ) ,
2534 new TextureMappingModeProperty ( ) ,
2635 new TextureColorSpaceProperty ( ) ,
@@ -33,6 +42,8 @@ export class ImageTextureNode extends TextureTypeNode {
3342 this . extensionPolicy = this . getChildOfType ( TextureExtensionProperty ) ! ;
3443 this . mappingPolicy = this . getChildOfType ( TextureMappingModeProperty ) ! ;
3544 this . colorSpace = this . getChildOfType ( TextureColorSpaceProperty ) ! ;
45+ this . interpolation = this . getChildOfType ( TextureInterpolationProperty ) ! ;
46+ this . useMipmaps = this . getChildOfType ( ComboBoxProperty ) ! ;
3647 }
3748
3849 override writeScript ( script : Script ) : string {
@@ -52,7 +63,9 @@ ${texture}.wrapT = ${ this.extensionPolicy.value };
5263${ texture } .mapping = ${ this . mappingPolicy . value } ;
5364${ texture } .colorSpace = ${ this . colorSpace . value } ;
5465${ texture } .flipY = false;
55- `
66+ ${ texture } .generateMipmaps = ${ this . useMipmaps . value } ;
67+ ${ this . interpolation . returnTextureSetupJs ( texture ) }
68+ `
5669 ) ;
5770
5871 const uv = this . uv . writeScript ( script ) ;
@@ -67,7 +80,9 @@ ${texture}.flipY = false;
6780 src : this . imageProp . isFromDisk ? "" : this . imageProp . imageSrc ,
6881 extension : this . extensionPolicy . value ,
6982 mapping : this . mappingPolicy . value ,
70- colorSpace : this . colorSpace . value
83+ colorSpace : this . colorSpace . value ,
84+ interpolation : this . interpolation . value ,
85+ usemipmap : this . useMipmaps . value ,
7186 }
7287 }
7388
@@ -80,6 +95,8 @@ ${texture}.flipY = false;
8095 this . extensionPolicy . value = data . extension ;
8196 this . mappingPolicy . value = data . mapping ;
8297 this . colorSpace . value = data . colorSpace ;
98+ this . interpolation . value = data . interpolation ;
99+ this . useMipmaps . value = data . usemipmap ;
83100 }
84101
85102 override onRemoved ( ) : void {
0 commit comments