threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627
  1. import {IMaterial} from './IMaterial'
  2. import {Texture} from 'three'
  3. export interface ITextureUserData{
  4. disposeOnIdle?: boolean // automatically dispose when added to a material and then not used in any material
  5. __appliedMaterials?: Set<IMaterial>
  6. }
  7. export interface ITexture extends Texture {
  8. assetType?: 'texture'
  9. userData: ITextureUserData
  10. readonly isTexture: true
  11. isDataTexture?: boolean
  12. isCubeTexture?: boolean
  13. isVideoTexture?: boolean
  14. isCanvasTexture?: boolean
  15. isCompressedTexture?: boolean
  16. is3DDataTexture?: boolean
  17. }
  18. export function upgradeTexture(this: ITexture) {
  19. this.assetType = 'texture'
  20. if (!this.userData) this.userData = {}
  21. if (!this.userData.__appliedMaterials) this.userData.__appliedMaterials = new Set()
  22. // todo: uiconfig, dispose, etc
  23. }