Now that we have material version auto update support, I remove the old opacity.doubleSided property and added a rename versionUpdate step to rename it to general.doubleSided.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
monroegm-disable-blank-issue-2
santorac 4 years ago
parent 0f60d37fec
commit 59da09c68b

@ -1,6 +1,14 @@
{ {
"description": "Material Type with properties used to define Enhanced PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model, with advanced features like subsurface scattering, transmission, and anisotropy.", "description": "Material Type with properties used to define Enhanced PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model, with advanced features like subsurface scattering, transmission, and anisotropy.",
"version": 3, "version": 4,
"versionUpdates": [
{
"toVersion": 4,
"actions": [
{"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"}
]
}
],
"propertyLayout": { "propertyLayout": {
"groups": [ "groups": [
{ {
@ -715,12 +723,6 @@
"name": "m_opacityFactor" "name": "m_opacityFactor"
} }
}, },
{
"name": "doubleSided",
"displayName": "Double-sided",
"description": "Whether to render back-faces or just front-faces.",
"type": "Bool"
},
{ {
"name": "alphaAffectsSpecular", "name": "alphaAffectsSpecular",
"displayName": "Alpha affects specular", "displayName": "Alpha affects specular",

@ -1,6 +1,14 @@
{ {
"description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.", "description": "Material Type with properties used to define Standard PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model.",
"version": 3, "version": 4,
"versionUpdates": [
{
"toVersion": 4,
"actions": [
{"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"}
]
}
],
"propertyLayout": { "propertyLayout": {
"groups": [ "groups": [
{ {
@ -656,12 +664,6 @@
"name": "m_opacityFactor" "name": "m_opacityFactor"
} }
}, },
{
"name": "doubleSided",
"displayName": "Double-sided",
"description": "Whether to render back-faces or just front-faces.",
"type": "Bool"
},
{ {
"name": "alphaAffectsSpecular", "name": "alphaAffectsSpecular",
"displayName": "Alpha affects specular", "displayName": "Alpha affects specular",

@ -10,7 +10,7 @@
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
function GetMaterialPropertyDependencies() function GetMaterialPropertyDependencies()
return {"general.doubleSided", "opacity.doubleSided", "opacity.mode"} return {"general.doubleSided"}
end end
ForwardPassIndex = 0 ForwardPassIndex = 0
@ -18,11 +18,9 @@ ForwardPassEdsIndex = 1
function Process(context) function Process(context)
local doubleSided = context:GetMaterialPropertyValue_bool("general.doubleSided") local doubleSided = context:GetMaterialPropertyValue_bool("general.doubleSided")
local opacityDoubleSided = context:GetMaterialPropertyValue_bool("opacity.doubleSided")
local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode")
local lastShader = context:GetShaderCount() - 1; local lastShader = context:GetShaderCount() - 1;
if(doubleSided or (opacityDoubleSided and opacityMode ~= 0)) then if(doubleSided) then
for i=0,lastShader do for i=0,lastShader do
context:GetShader(i):GetRenderStatesOverride():SetCullMode(CullMode_None) context:GetShader(i):GetRenderStatesOverride():SetCullMode(CullMode_None)
end end

Loading…
Cancel
Save