123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- import { Engine } from "../Engines/engine.js";
- /**
- * This groups all the flags used to control the materials channel.
- */
- export class MaterialFlags {
- /**
- * Are diffuse textures enabled in the application.
- */
- static get DiffuseTextureEnabled() {
- return this._DiffuseTextureEnabled;
- }
- static set DiffuseTextureEnabled(value) {
- if (this._DiffuseTextureEnabled === value) {
- return;
- }
- this._DiffuseTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are detail textures enabled in the application.
- */
- static get DetailTextureEnabled() {
- return this._DetailTextureEnabled;
- }
- static set DetailTextureEnabled(value) {
- if (this._DetailTextureEnabled === value) {
- return;
- }
- this._DetailTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are decal maps enabled in the application.
- */
- static get DecalMapEnabled() {
- return this._DecalMapEnabled;
- }
- static set DecalMapEnabled(value) {
- if (this._DecalMapEnabled === value) {
- return;
- }
- this._DecalMapEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are ambient textures enabled in the application.
- */
- static get AmbientTextureEnabled() {
- return this._AmbientTextureEnabled;
- }
- static set AmbientTextureEnabled(value) {
- if (this._AmbientTextureEnabled === value) {
- return;
- }
- this._AmbientTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are opacity textures enabled in the application.
- */
- static get OpacityTextureEnabled() {
- return this._OpacityTextureEnabled;
- }
- static set OpacityTextureEnabled(value) {
- if (this._OpacityTextureEnabled === value) {
- return;
- }
- this._OpacityTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are reflection textures enabled in the application.
- */
- static get ReflectionTextureEnabled() {
- return this._ReflectionTextureEnabled;
- }
- static set ReflectionTextureEnabled(value) {
- if (this._ReflectionTextureEnabled === value) {
- return;
- }
- this._ReflectionTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are emissive textures enabled in the application.
- */
- static get EmissiveTextureEnabled() {
- return this._EmissiveTextureEnabled;
- }
- static set EmissiveTextureEnabled(value) {
- if (this._EmissiveTextureEnabled === value) {
- return;
- }
- this._EmissiveTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are specular textures enabled in the application.
- */
- static get SpecularTextureEnabled() {
- return this._SpecularTextureEnabled;
- }
- static set SpecularTextureEnabled(value) {
- if (this._SpecularTextureEnabled === value) {
- return;
- }
- this._SpecularTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are bump textures enabled in the application.
- */
- static get BumpTextureEnabled() {
- return this._BumpTextureEnabled;
- }
- static set BumpTextureEnabled(value) {
- if (this._BumpTextureEnabled === value) {
- return;
- }
- this._BumpTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are lightmap textures enabled in the application.
- */
- static get LightmapTextureEnabled() {
- return this._LightmapTextureEnabled;
- }
- static set LightmapTextureEnabled(value) {
- if (this._LightmapTextureEnabled === value) {
- return;
- }
- this._LightmapTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are refraction textures enabled in the application.
- */
- static get RefractionTextureEnabled() {
- return this._RefractionTextureEnabled;
- }
- static set RefractionTextureEnabled(value) {
- if (this._RefractionTextureEnabled === value) {
- return;
- }
- this._RefractionTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are color grading textures enabled in the application.
- */
- static get ColorGradingTextureEnabled() {
- return this._ColorGradingTextureEnabled;
- }
- static set ColorGradingTextureEnabled(value) {
- if (this._ColorGradingTextureEnabled === value) {
- return;
- }
- this._ColorGradingTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are fresnels enabled in the application.
- */
- static get FresnelEnabled() {
- return this._FresnelEnabled;
- }
- static set FresnelEnabled(value) {
- if (this._FresnelEnabled === value) {
- return;
- }
- this._FresnelEnabled = value;
- Engine.MarkAllMaterialsAsDirty(4);
- }
- /**
- * Are clear coat textures enabled in the application.
- */
- static get ClearCoatTextureEnabled() {
- return this._ClearCoatTextureEnabled;
- }
- static set ClearCoatTextureEnabled(value) {
- if (this._ClearCoatTextureEnabled === value) {
- return;
- }
- this._ClearCoatTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are clear coat bump textures enabled in the application.
- */
- static get ClearCoatBumpTextureEnabled() {
- return this._ClearCoatBumpTextureEnabled;
- }
- static set ClearCoatBumpTextureEnabled(value) {
- if (this._ClearCoatBumpTextureEnabled === value) {
- return;
- }
- this._ClearCoatBumpTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are clear coat tint textures enabled in the application.
- */
- static get ClearCoatTintTextureEnabled() {
- return this._ClearCoatTintTextureEnabled;
- }
- static set ClearCoatTintTextureEnabled(value) {
- if (this._ClearCoatTintTextureEnabled === value) {
- return;
- }
- this._ClearCoatTintTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are sheen textures enabled in the application.
- */
- static get SheenTextureEnabled() {
- return this._SheenTextureEnabled;
- }
- static set SheenTextureEnabled(value) {
- if (this._SheenTextureEnabled === value) {
- return;
- }
- this._SheenTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are anisotropic textures enabled in the application.
- */
- static get AnisotropicTextureEnabled() {
- return this._AnisotropicTextureEnabled;
- }
- static set AnisotropicTextureEnabled(value) {
- if (this._AnisotropicTextureEnabled === value) {
- return;
- }
- this._AnisotropicTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are thickness textures enabled in the application.
- */
- static get ThicknessTextureEnabled() {
- return this._ThicknessTextureEnabled;
- }
- static set ThicknessTextureEnabled(value) {
- if (this._ThicknessTextureEnabled === value) {
- return;
- }
- this._ThicknessTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are refraction intensity textures enabled in the application.
- */
- static get RefractionIntensityTextureEnabled() {
- return this._ThicknessTextureEnabled;
- }
- static set RefractionIntensityTextureEnabled(value) {
- if (this._RefractionIntensityTextureEnabled === value) {
- return;
- }
- this._RefractionIntensityTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are translucency intensity textures enabled in the application.
- */
- static get TranslucencyIntensityTextureEnabled() {
- return this._ThicknessTextureEnabled;
- }
- static set TranslucencyIntensityTextureEnabled(value) {
- if (this._TranslucencyIntensityTextureEnabled === value) {
- return;
- }
- this._TranslucencyIntensityTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- /**
- * Are translucency intensity textures enabled in the application.
- */
- static get IridescenceTextureEnabled() {
- return this._IridescenceTextureEnabled;
- }
- static set IridescenceTextureEnabled(value) {
- if (this._IridescenceTextureEnabled === value) {
- return;
- }
- this._IridescenceTextureEnabled = value;
- Engine.MarkAllMaterialsAsDirty(1);
- }
- }
- // Flags used to enable or disable a type of texture for all Standard Materials
- MaterialFlags._DiffuseTextureEnabled = true;
- MaterialFlags._DetailTextureEnabled = true;
- MaterialFlags._DecalMapEnabled = true;
- MaterialFlags._AmbientTextureEnabled = true;
- MaterialFlags._OpacityTextureEnabled = true;
- MaterialFlags._ReflectionTextureEnabled = true;
- MaterialFlags._EmissiveTextureEnabled = true;
- MaterialFlags._SpecularTextureEnabled = true;
- MaterialFlags._BumpTextureEnabled = true;
- MaterialFlags._LightmapTextureEnabled = true;
- MaterialFlags._RefractionTextureEnabled = true;
- MaterialFlags._ColorGradingTextureEnabled = true;
- MaterialFlags._FresnelEnabled = true;
- MaterialFlags._ClearCoatTextureEnabled = true;
- MaterialFlags._ClearCoatBumpTextureEnabled = true;
- MaterialFlags._ClearCoatTintTextureEnabled = true;
- MaterialFlags._SheenTextureEnabled = true;
- MaterialFlags._AnisotropicTextureEnabled = true;
- MaterialFlags._ThicknessTextureEnabled = true;
- MaterialFlags._RefractionIntensityTextureEnabled = true;
- MaterialFlags._TranslucencyIntensityTextureEnabled = true;
- MaterialFlags._IridescenceTextureEnabled = true;
- //# sourceMappingURL=materialFlags.js.map
|