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>
This commit is contained in:
@@ -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.",
|
||||
"version": 3,
|
||||
"version": 4,
|
||||
"versionUpdates": [
|
||||
{
|
||||
"toVersion": 4,
|
||||
"actions": [
|
||||
{"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"propertyLayout": {
|
||||
"groups": [
|
||||
{
|
||||
@@ -715,12 +723,6 @@
|
||||
"name": "m_opacityFactor"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "doubleSided",
|
||||
"displayName": "Double-sided",
|
||||
"description": "Whether to render back-faces or just front-faces.",
|
||||
"type": "Bool"
|
||||
},
|
||||
{
|
||||
"name": "alphaAffectsSpecular",
|
||||
"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.",
|
||||
"version": 3,
|
||||
"version": 4,
|
||||
"versionUpdates": [
|
||||
{
|
||||
"toVersion": 4,
|
||||
"actions": [
|
||||
{"op": "rename", "from": "opacity.doubleSided", "to": "general.doubleSided"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"propertyLayout": {
|
||||
"groups": [
|
||||
{
|
||||
@@ -656,12 +664,6 @@
|
||||
"name": "m_opacityFactor"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "doubleSided",
|
||||
"displayName": "Double-sided",
|
||||
"description": "Whether to render back-faces or just front-faces.",
|
||||
"type": "Bool"
|
||||
},
|
||||
{
|
||||
"name": "alphaAffectsSpecular",
|
||||
"displayName": "Alpha affects specular",
|
||||
|
||||
+2
-4
@@ -10,7 +10,7 @@
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
function GetMaterialPropertyDependencies()
|
||||
return {"general.doubleSided", "opacity.doubleSided", "opacity.mode"}
|
||||
return {"general.doubleSided"}
|
||||
end
|
||||
|
||||
ForwardPassIndex = 0
|
||||
@@ -18,11 +18,9 @@ ForwardPassEdsIndex = 1
|
||||
|
||||
function Process(context)
|
||||
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;
|
||||
|
||||
if(doubleSided or (opacityDoubleSided and opacityMode ~= 0)) then
|
||||
if(doubleSided) then
|
||||
for i=0,lastShader do
|
||||
context:GetShader(i):GetRenderStatesOverride():SetCullMode(CullMode_None)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user