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.
main
Chris Santora 5 years ago
parent 755d1b7abc
commit b206e7ffe5

@ -933,13 +933,6 @@
} }
], ],
"parallax": [ "parallax": [
{
"id": "enable",
"displayName": "Enable",
"description": "Whether to enable the parallax feature.",
"type": "Bool",
"defaultValue": false
},
{ {
"id": "textureMap", "id": "textureMap",
"displayName": "Texture Map", "displayName": "Texture Map",
@ -950,6 +943,13 @@
"id": "m_depthMap" "id": "m_depthMap"
} }
}, },
{
"id": "useTexture",
"displayName": "Use Texture",
"description": "Whether to use the texture map.",
"type": "Bool",
"defaultValue": true
},
{ {
"id": "textureMapUv", "id": "textureMapUv",
"displayName": "UV", "displayName": "UV",

@ -879,13 +879,6 @@
} }
], ],
"parallax": [ "parallax": [
{
"id": "enable",
"displayName": "Enable",
"description": "Whether to enable the parallax feature.",
"type": "Bool",
"defaultValue": false
},
{ {
"id": "textureMap", "id": "textureMap",
"displayName": "Texture Map", "displayName": "Texture Map",
@ -896,6 +889,13 @@
"id": "m_depthMap" "id": "m_depthMap"
} }
}, },
{
"id": "useTexture",
"displayName": "Use Texture",
"description": "Whether to use the texture map.",
"type": "Bool",
"defaultValue": true
},
{ {
"id": "textureMapUv", "id": "textureMapUv",
"displayName": "UV", "displayName": "UV",

@ -13,7 +13,7 @@
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
function GetMaterialPropertyDependencies() function GetMaterialPropertyDependencies()
return {"parallax.enable", "parallax.textureMap"} return {"parallax.textureMap", "parallax.useTexture"}
end end
function GetShaderOptionDependencies() function GetShaderOptionDependencies()
@ -21,25 +21,29 @@ function GetShaderOptionDependencies()
end end
function Process(context) function Process(context)
local enable = context:GetMaterialPropertyValue_bool("parallax.enable")
local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") 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_parallax_feature_enabled", enable)
context:SetShaderOptionValue_bool("o_useDepthMap", enable and textureMap ~= nil) context:SetShaderOptionValue_bool("o_useDepthMap", enable)
end end
function ProcessEditor(context) function ProcessEditor(context)
local enable = context:GetMaterialPropertyValue_bool("parallax.enable") local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap")
if enable then if textureMap ~= nil then
context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Enabled) context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Enabled)
else else
context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Hidden)
end end
local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") local useTexture = context:GetMaterialPropertyValue_bool("parallax.useTexture")
local visibility = MaterialPropertyVisibility_Enabled local visibility = MaterialPropertyVisibility_Enabled
if(not enable or textureMap == nil) then if(textureMap == nil) then
visibility = MaterialPropertyVisibility_Hidden visibility = MaterialPropertyVisibility_Hidden
elseif not useTexture then
visibility = MaterialPropertyVisibility_Disabled
end end
context:SetMaterialPropertyVisibility("parallax.factor", visibility) context:SetMaterialPropertyVisibility("parallax.factor", visibility)

@ -13,7 +13,7 @@
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
function GetMaterialPropertyDependencies() function GetMaterialPropertyDependencies()
return {"opacity.mode", "parallax.enable", "parallax.pdo"} return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"}
end end
OpacityMode_Opaque = 0 OpacityMode_Opaque = 0
@ -37,7 +37,9 @@ end
function Process(context) function Process(context)
local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") 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 parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo")
local depthPass = context:GetShaderByTag("DepthPass") local depthPass = context:GetShaderByTag("DepthPass")

@ -17,7 +17,6 @@
"textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg" "textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg"
}, },
"parallax": { "parallax": {
"enable": true,
"algorithm": "POM", "algorithm": "POM",
"factor": 0.03, "factor": 0.03,
"quality": "High", "quality": "High",

@ -8,7 +8,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "POM", "algorithm": "POM",
"enable": true,
"factor": 0.02500000037252903, "factor": 0.02500000037252903,
"quality": "High", "quality": "High",
"textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png" "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png"

@ -13,7 +13,6 @@
"textureMap": "TestData/Textures/checker8x8_512.png" "textureMap": "TestData/Textures/checker8x8_512.png"
}, },
"parallax": { "parallax": {
"enable": true,
"factor": 0.10000000149011612, "factor": 0.10000000149011612,
"quality": "High", "quality": "High",
"textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png" "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png"

@ -13,7 +13,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "POM", "algorithm": "POM",
"enable": true,
"factor": 0.10000000149011612, "factor": 0.10000000149011612,
"quality": "High", "quality": "High",
"textureMap": "TestData/Objects/cube/cube_diff.tif" "textureMap": "TestData/Objects/cube/cube_diff.tif"

@ -13,7 +13,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "POM", "algorithm": "POM",
"enable": true,
"factor": 0.05000000074505806, "factor": 0.05000000074505806,
"quality": "High", "quality": "High",
"textureMap": "TestData/Objects/cube/cube_diff.tif" "textureMap": "TestData/Objects/cube/cube_diff.tif"

@ -26,7 +26,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "POM", "algorithm": "POM",
"enable": true,
"factor": 0.02500000037252903, "factor": 0.02500000037252903,
"pdo": true, "pdo": true,
"quality": "Ultra", "quality": "Ultra",

@ -31,7 +31,8 @@
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"factor": 0.019999999552965165, "factor": 0.019999999552965165,
"quality": "Ultra", "quality": "Ultra",
"textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png" "textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Materials/Concrete016_8K/Concrete016_8K_Roughness.png" "textureMap": "Materials/Concrete016_8K/Concrete016_8K_Roughness.png"

@ -20,7 +20,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"enable": true,
"factor": 0.004999999888241291, "factor": 0.004999999888241291,
"quality": "Ultra", "quality": "Ultra",
"textureMap": "Materials/Fabric001_8K/Fabric001_8K_Displacement.png" "textureMap": "Materials/Fabric001_8K/Fabric001_8K_Displacement.png"

@ -20,7 +20,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"enable": true,
"factor": 0.0020000000949949028, "factor": 0.0020000000949949028,
"pdo": true, "pdo": true,
"quality": "Medium", "quality": "Medium",

@ -19,7 +19,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"enable": true,
"factor": 0.009999999776482582, "factor": 0.009999999776482582,
"pdo": true, "pdo": true,
"quality": "Ultra", "quality": "Ultra",

@ -30,7 +30,8 @@
"factor": 0.02500000037252903, "factor": 0.02500000037252903,
"pdo": true, "pdo": true,
"quality": "Ultra", "quality": "Ultra",
"textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png" "textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"factor": 0.4343433976173401, "factor": 0.4343433976173401,

@ -22,7 +22,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "POM", "algorithm": "POM",
"enable": true,
"factor": 0.02500000037252903, "factor": 0.02500000037252903,
"pdo": true, "pdo": true,
"quality": "Ultra", "quality": "Ultra",

@ -19,7 +19,8 @@
}, },
"parallax": { "parallax": {
"factor": 0.0010101000079885126, "factor": 0.0010101000079885126,
"textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg" "textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg",
"useTexture": false
}, },
"specularF0": { "specularF0": {
"factor": 0.5050504803657532 "factor": 0.5050504803657532

@ -41,7 +41,8 @@
"factor": 0.050999999046325687, "factor": 0.050999999046325687,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/arch_1k_height.png" "textureMap": "Textures/arch_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/arch_1k_roughness.png" "textureMap": "Textures/arch_1k_roughness.png"

@ -47,7 +47,8 @@
"factor": 0.03099999949336052, "factor": 0.03099999949336052,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/background_1k_height.png" "textureMap": "Textures/background_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/background_1k_roughness.png" "textureMap": "Textures/background_1k_roughness.png"

@ -46,7 +46,8 @@
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"factor": 0.03500000014901161, "factor": 0.03500000014901161,
"quality": "Medium", "quality": "Medium",
"textureMap": "Textures/bricks_1k_height.png" "textureMap": "Textures/bricks_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/bricks_1k_roughness.png" "textureMap": "Textures/bricks_1k_roughness.png"

@ -48,7 +48,8 @@
"factor": 0.019999999552965165, "factor": 0.019999999552965165,
"pdo": true, "pdo": true,
"quality": "Medium", "quality": "Medium",
"textureMap": "Textures/ceiling_1k_height.png" "textureMap": "Textures/ceiling_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/ceiling_1k_roughness.png" "textureMap": "Textures/ceiling_1k_roughness.png"

@ -47,7 +47,8 @@
"factor": 0.017000000923871995, "factor": 0.017000000923871995,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/columnA_1k_height.png" "textureMap": "Textures/columnA_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/columnA_1k_roughness.png" "textureMap": "Textures/columnA_1k_roughness.png"

@ -46,7 +46,8 @@
"factor": 0.020999999716877939, "factor": 0.020999999716877939,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/columnB_1k_height.png" "textureMap": "Textures/columnB_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/columnB_1k_roughness.png" "textureMap": "Textures/columnB_1k_roughness.png"

@ -47,7 +47,8 @@
"factor": 0.014000000432133675, "factor": 0.014000000432133675,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/columnC_1k_height.png" "textureMap": "Textures/columnC_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/columnC_1k_roughness.png" "textureMap": "Textures/columnC_1k_roughness.png"

@ -38,7 +38,8 @@
"algorithm": "POM", "algorithm": "POM",
"factor": 0.02500000037252903, "factor": 0.02500000037252903,
"pdo": true, "pdo": true,
"textureMap": "Textures/details_1k_height.png" "textureMap": "Textures/details_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/details_1k_roughness.png" "textureMap": "Textures/details_1k_roughness.png"

@ -41,7 +41,8 @@
"factor": 0.014000000432133675, "factor": 0.014000000432133675,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/flagpole_1k_height.png" "textureMap": "Textures/flagpole_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/flagpole_1k_roughness.png" "textureMap": "Textures/flagpole_1k_roughness.png"

@ -43,7 +43,8 @@
"algorithm": "POM", "algorithm": "POM",
"factor": 0.012000000104308129, "factor": 0.012000000104308129,
"pdo": true, "pdo": true,
"textureMap": "Textures/floor_1k_height.png" "textureMap": "Textures/floor_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/floor_1k_roughness.png" "textureMap": "Textures/floor_1k_roughness.png"

@ -42,7 +42,8 @@
"mode": "Cutout" "mode": "Cutout"
}, },
"parallax": { "parallax": {
"textureMap": "Textures/thorn_height.png" "textureMap": "Textures/thorn_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/thorn_roughness.png" "textureMap": "Textures/thorn_roughness.png"

@ -38,7 +38,6 @@
}, },
"parallax": { "parallax": {
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"enable": true,
"factor": 0.009999999776482582, "factor": 0.009999999776482582,
"pdo": true, "pdo": true,
"quality": "Ultra", "quality": "Ultra",

@ -35,7 +35,8 @@
"algorithm": "ContactRefinement", "algorithm": "ContactRefinement",
"factor": 0.019999999552965165, "factor": 0.019999999552965165,
"quality": "Medium", "quality": "Medium",
"textureMap": "Textures/roof_1k_height.png" "textureMap": "Textures/roof_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/roof_1k_roughness.png" "textureMap": "Textures/roof_1k_roughness.png"

@ -41,7 +41,8 @@
"factor": 0.027000000700354577, "factor": 0.027000000700354577,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/vase_1k_height.png" "textureMap": "Textures/vase_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/vase_1k_roughness.png" "textureMap": "Textures/vase_1k_roughness.png"

@ -41,7 +41,8 @@
"factor": 0.04600000008940697, "factor": 0.04600000008940697,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/vaseHanging_1k_height.png" "textureMap": "Textures/vaseHanging_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/vaseHanging_1k_roughness.png" "textureMap": "Textures/vaseHanging_1k_roughness.png"

@ -45,7 +45,8 @@
"factor": 0.019999999552965165, "factor": 0.019999999552965165,
"pdo": true, "pdo": true,
"quality": "High", "quality": "High",
"textureMap": "Textures/vaseRound_1k_height.png" "textureMap": "Textures/vaseRound_1k_height.png",
"useTexture": false
}, },
"roughness": { "roughness": {
"textureMap": "Textures/vaseRound_1k_roughness.png" "textureMap": "Textures/vaseRound_1k_roughness.png"

Loading…
Cancel
Save