ATOM-15295 Remove Unnecessary Enable Material Properties
The only remaining unnecessary enable flag I found was for the parallax property group. It is removed, and now we just use the texture map and useTexture flag to gate whether the feature is enabled.
This commit is contained in:
@@ -933,13 +933,6 @@
|
||||
}
|
||||
],
|
||||
"parallax": [
|
||||
{
|
||||
"id": "enable",
|
||||
"displayName": "Enable",
|
||||
"description": "Whether to enable the parallax feature.",
|
||||
"type": "Bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "textureMap",
|
||||
"displayName": "Texture Map",
|
||||
@@ -950,6 +943,13 @@
|
||||
"id": "m_depthMap"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "useTexture",
|
||||
"displayName": "Use Texture",
|
||||
"description": "Whether to use the texture map.",
|
||||
"type": "Bool",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"id": "textureMapUv",
|
||||
"displayName": "UV",
|
||||
|
||||
@@ -879,13 +879,6 @@
|
||||
}
|
||||
],
|
||||
"parallax": [
|
||||
{
|
||||
"id": "enable",
|
||||
"displayName": "Enable",
|
||||
"description": "Whether to enable the parallax feature.",
|
||||
"type": "Bool",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"id": "textureMap",
|
||||
"displayName": "Texture Map",
|
||||
@@ -896,6 +889,13 @@
|
||||
"id": "m_depthMap"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "useTexture",
|
||||
"displayName": "Use Texture",
|
||||
"description": "Whether to use the texture map.",
|
||||
"type": "Bool",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"id": "textureMapUv",
|
||||
"displayName": "UV",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
function GetMaterialPropertyDependencies()
|
||||
return {"parallax.enable", "parallax.textureMap"}
|
||||
return {"parallax.textureMap", "parallax.useTexture"}
|
||||
end
|
||||
|
||||
function GetShaderOptionDependencies()
|
||||
@@ -21,27 +21,31 @@ function GetShaderOptionDependencies()
|
||||
end
|
||||
|
||||
function Process(context)
|
||||
local enable = context:GetMaterialPropertyValue_bool("parallax.enable")
|
||||
local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap")
|
||||
local useTexture = context:GetMaterialPropertyValue_bool("parallax.useTexture")
|
||||
local enable = textureMap ~= nil and useTexture
|
||||
context:SetShaderOptionValue_bool("o_parallax_feature_enabled", enable)
|
||||
context:SetShaderOptionValue_bool("o_useDepthMap", enable and textureMap ~= nil)
|
||||
context:SetShaderOptionValue_bool("o_useDepthMap", enable)
|
||||
end
|
||||
|
||||
function ProcessEditor(context)
|
||||
local enable = context:GetMaterialPropertyValue_bool("parallax.enable")
|
||||
|
||||
if enable then
|
||||
context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Enabled)
|
||||
else
|
||||
context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Hidden)
|
||||
end
|
||||
|
||||
local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap")
|
||||
local visibility = MaterialPropertyVisibility_Enabled
|
||||
if(not enable or textureMap == nil) then
|
||||
visibility = MaterialPropertyVisibility_Hidden
|
||||
|
||||
if textureMap ~= nil then
|
||||
context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Enabled)
|
||||
else
|
||||
context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Hidden)
|
||||
end
|
||||
|
||||
local useTexture = context:GetMaterialPropertyValue_bool("parallax.useTexture")
|
||||
|
||||
local visibility = MaterialPropertyVisibility_Enabled
|
||||
if(textureMap == nil) then
|
||||
visibility = MaterialPropertyVisibility_Hidden
|
||||
elseif not useTexture then
|
||||
visibility = MaterialPropertyVisibility_Disabled
|
||||
end
|
||||
|
||||
context:SetMaterialPropertyVisibility("parallax.factor", visibility)
|
||||
context:SetMaterialPropertyVisibility("parallax.offset", visibility)
|
||||
context:SetMaterialPropertyVisibility("parallax.showClipping", visibility)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
function GetMaterialPropertyDependencies()
|
||||
return {"opacity.mode", "parallax.enable", "parallax.pdo"}
|
||||
return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"}
|
||||
end
|
||||
|
||||
OpacityMode_Opaque = 0
|
||||
@@ -37,7 +37,9 @@ end
|
||||
|
||||
function Process(context)
|
||||
local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode")
|
||||
local parallaxEnabled = context:GetMaterialPropertyValue_bool("parallax.enable")
|
||||
local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap")
|
||||
local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture")
|
||||
local parallaxEnabled = displacementMap ~= nil and useDisplacementMap
|
||||
local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo")
|
||||
|
||||
local depthPass = context:GetShaderByTag("DepthPass")
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
"textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg"
|
||||
},
|
||||
"parallax": {
|
||||
"enable": true,
|
||||
"algorithm": "POM",
|
||||
"factor": 0.03,
|
||||
"quality": "High",
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.02500000037252903,
|
||||
"quality": "High",
|
||||
"textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png"
|
||||
|
||||
-1
@@ -13,7 +13,6 @@
|
||||
"textureMap": "TestData/Textures/checker8x8_512.png"
|
||||
},
|
||||
"parallax": {
|
||||
"enable": true,
|
||||
"factor": 0.10000000149011612,
|
||||
"quality": "High",
|
||||
"textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png"
|
||||
|
||||
-1
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.10000000149011612,
|
||||
"quality": "High",
|
||||
"textureMap": "TestData/Objects/cube/cube_diff.tif"
|
||||
|
||||
-1
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.05000000074505806,
|
||||
"quality": "High",
|
||||
"textureMap": "TestData/Objects/cube/cube_diff.tif"
|
||||
|
||||
-1
@@ -26,7 +26,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.02500000037252903,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
|
||||
+2
-1
@@ -31,7 +31,8 @@
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.019999999552965165,
|
||||
"quality": "Ultra",
|
||||
"textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png"
|
||||
"textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Materials/Concrete016_8K/Concrete016_8K_Roughness.png"
|
||||
|
||||
-1
@@ -20,7 +20,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "ContactRefinement",
|
||||
"enable": true,
|
||||
"factor": 0.004999999888241291,
|
||||
"quality": "Ultra",
|
||||
"textureMap": "Materials/Fabric001_8K/Fabric001_8K_Displacement.png"
|
||||
|
||||
-1
@@ -20,7 +20,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "ContactRefinement",
|
||||
"enable": true,
|
||||
"factor": 0.0020000000949949028,
|
||||
"pdo": true,
|
||||
"quality": "Medium",
|
||||
|
||||
-1
@@ -19,7 +19,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "ContactRefinement",
|
||||
"enable": true,
|
||||
"factor": 0.009999999776482582,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
"factor": 0.02500000037252903,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
"textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png"
|
||||
"textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"factor": 0.4343433976173401,
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "POM",
|
||||
"enable": true,
|
||||
"factor": 0.02500000037252903,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
},
|
||||
"parallax": {
|
||||
"factor": 0.0010101000079885126,
|
||||
"textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg"
|
||||
"textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg",
|
||||
"useTexture": false
|
||||
},
|
||||
"specularF0": {
|
||||
"factor": 0.5050504803657532
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"factor": 0.050999999046325687,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/arch_1k_height.png"
|
||||
"textureMap": "Textures/arch_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/arch_1k_roughness.png"
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
"factor": 0.03099999949336052,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/background_1k_height.png"
|
||||
"textureMap": "Textures/background_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/background_1k_roughness.png"
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.03500000014901161,
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/bricks_1k_height.png"
|
||||
"textureMap": "Textures/bricks_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/bricks_1k_roughness.png"
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
"factor": 0.019999999552965165,
|
||||
"pdo": true,
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/ceiling_1k_height.png"
|
||||
"textureMap": "Textures/ceiling_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/ceiling_1k_roughness.png"
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
"factor": 0.017000000923871995,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/columnA_1k_height.png"
|
||||
"textureMap": "Textures/columnA_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/columnA_1k_roughness.png"
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
"factor": 0.020999999716877939,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/columnB_1k_height.png"
|
||||
"textureMap": "Textures/columnB_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/columnB_1k_roughness.png"
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
"factor": 0.014000000432133675,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/columnC_1k_height.png"
|
||||
"textureMap": "Textures/columnC_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/columnC_1k_roughness.png"
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
"algorithm": "POM",
|
||||
"factor": 0.02500000037252903,
|
||||
"pdo": true,
|
||||
"textureMap": "Textures/details_1k_height.png"
|
||||
"textureMap": "Textures/details_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/details_1k_roughness.png"
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"factor": 0.014000000432133675,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/flagpole_1k_height.png"
|
||||
"textureMap": "Textures/flagpole_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/flagpole_1k_roughness.png"
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
"algorithm": "POM",
|
||||
"factor": 0.012000000104308129,
|
||||
"pdo": true,
|
||||
"textureMap": "Textures/floor_1k_height.png"
|
||||
"textureMap": "Textures/floor_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/floor_1k_roughness.png"
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
"mode": "Cutout"
|
||||
},
|
||||
"parallax": {
|
||||
"textureMap": "Textures/thorn_height.png"
|
||||
"textureMap": "Textures/thorn_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/thorn_roughness.png"
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
},
|
||||
"parallax": {
|
||||
"algorithm": "ContactRefinement",
|
||||
"enable": true,
|
||||
"factor": 0.009999999776482582,
|
||||
"pdo": true,
|
||||
"quality": "Ultra",
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
"algorithm": "ContactRefinement",
|
||||
"factor": 0.019999999552965165,
|
||||
"quality": "Medium",
|
||||
"textureMap": "Textures/roof_1k_height.png"
|
||||
"textureMap": "Textures/roof_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/roof_1k_roughness.png"
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"factor": 0.027000000700354577,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/vase_1k_height.png"
|
||||
"textureMap": "Textures/vase_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/vase_1k_roughness.png"
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"factor": 0.04600000008940697,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/vaseHanging_1k_height.png"
|
||||
"textureMap": "Textures/vaseHanging_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/vaseHanging_1k_roughness.png"
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
"factor": 0.019999999552965165,
|
||||
"pdo": true,
|
||||
"quality": "High",
|
||||
"textureMap": "Textures/vaseRound_1k_height.png"
|
||||
"textureMap": "Textures/vaseRound_1k_height.png",
|
||||
"useTexture": false
|
||||
},
|
||||
"roughness": {
|
||||
"textureMap": "Textures/vaseRound_1k_roughness.png"
|
||||
|
||||
Reference in New Issue
Block a user