|
@@ -21,6 +21,7 @@ export interface IMaterialClearCoatDefines {
|
|
CLEARCOAT_TEXTUREDIRECTUV: number;
|
|
CLEARCOAT_TEXTUREDIRECTUV: number;
|
|
CLEARCOAT_BUMP: boolean;
|
|
CLEARCOAT_BUMP: boolean;
|
|
CLEARCOAT_BUMPDIRECTUV: number;
|
|
CLEARCOAT_BUMPDIRECTUV: number;
|
|
|
|
+ CLEARCOAT_REMAPP_F0: boolean;
|
|
|
|
|
|
CLEARCOAT_TINT: boolean;
|
|
CLEARCOAT_TINT: boolean;
|
|
CLEARCOAT_TINT_TEXTURE: boolean;
|
|
CLEARCOAT_TINT_TEXTURE: boolean;
|
|
@@ -79,6 +80,14 @@ export class PBRClearCoatConfiguration {
|
|
@expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
@expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
public texture: Nullable<BaseTexture> = null;
|
|
public texture: Nullable<BaseTexture> = null;
|
|
|
|
|
|
|
|
+ private _remapF0OnInterfaceChange = true;
|
|
|
|
+ /**
|
|
|
|
+ * Defines if the F0 value should be remapped to account for the interface change in the material.
|
|
|
|
+ */
|
|
|
|
+ @serialize()
|
|
|
|
+ @expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
|
|
+ public remapF0OnInterfaceChange = true;
|
|
|
|
+
|
|
private _bumpTexture: Nullable<BaseTexture> = null;
|
|
private _bumpTexture: Nullable<BaseTexture> = null;
|
|
/**
|
|
/**
|
|
* Define the clear coat specific bump texture.
|
|
* Define the clear coat specific bump texture.
|
|
@@ -186,6 +195,7 @@ export class PBRClearCoatConfiguration {
|
|
public prepareDefines(defines: IMaterialClearCoatDefines, scene: Scene): void {
|
|
public prepareDefines(defines: IMaterialClearCoatDefines, scene: Scene): void {
|
|
if (this._isEnabled) {
|
|
if (this._isEnabled) {
|
|
defines.CLEARCOAT = true;
|
|
defines.CLEARCOAT = true;
|
|
|
|
+ defines.CLEARCOAT_REMAPP_F0 = this._remapF0OnInterfaceChange;
|
|
|
|
|
|
if (defines._areTexturesDirty) {
|
|
if (defines._areTexturesDirty) {
|
|
if (scene.texturesEnabled) {
|
|
if (scene.texturesEnabled) {
|